Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
chore: rebuild registry and biome-format public/r in build/check scripts
dev_wandry601fc057cd89
diff --git a/package.json b/package.jsonindex 88ff9a64..de0befdd 100644--- a/package.json+++ b/package.json@@ -10,8 +10,8 @@"typecheck": "tsc --noEmit","lint": "biome check","format": "biome format --write",- "registry:build": "shadcn build",- "registry:check": "shadcn build && git diff --quiet -- public/r || (echo 'public/r is out of sync with registry/ sources. Run: bun run registry:build and commit the result.' && exit 1)",+ "registry:build": "shadcn build && biome format --write public/r",+ "registry:check": "shadcn build && biome format --write public/r && git diff --quiet -- public/r || (echo 'public/r is out of sync with registry/ sources. Run: bun run registry:build and commit the result.' && exit 1)","remotion:browser": "bun scripts/ensure-browser.mts","bundle:remotion": "bun scripts/bundle-remotion.mts","render:demos": "bun scripts/render-demos.mts",diff --git a/public/r/accordion.json b/public/r/accordion.jsonindex 66cc592f..82e8423c 100644--- a/public/r/accordion.json+++ b/public/r/accordion.json@@ -14,7 +14,7 @@},{"path": "registry/remocn-ui/accordion/use-accordion-transition.ts",- "content": "\"use client\";\n\nimport {\n easings,\n mixOklch,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\nimport {\n accordionStyle,\n accordionStyleContext,\n type AccordionState,\n type AccordionStyle,\n} from \"@/components/remocn/accordion\";\n\nexport const DEFAULT_DURATION = 14;\n\nexport function tweenAccordionStyle(\n a: AccordionStyle,\n b: AccordionStyle,\n t: number,\n): AccordionStyle {\n return {\n panelHeight: a.panelHeight + (b.panelHeight - a.panelHeight) * t,\n panelOpacity: a.panelOpacity + (b.panelOpacity - a.panelOpacity) * t,\n chevronRotation:\n a.chevronRotation + (b.chevronRotation - a.chevronRotation) * t,\n background: mixOklch(a.background, b.background, t),\n };\n}\n\nexport interface AccordionTransitionOptions {\n variant?: \"default\" | \"ghost\";\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useAccordionTransition(\n steps: Step<AccordionState>[],\n opts: AccordionTransitionOptions = {},\n): AccordionStyle {\n const {\n variant = \"default\",\n theme: themeOverride,\n mode,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = accordionStyleContext(variant, theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"closed\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenAccordionStyle(\n accordionStyle(from, ctx),\n accordionStyle(to, ctx),\n t,\n );\n}\n",+ "content": "\"use client\";\n\nimport {\n type AccordionState,\n type AccordionStyle,\n accordionStyle,\n accordionStyleContext,\n} from \"@/components/remocn/accordion\";\nimport {\n easings,\n mixOklch,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\n\nexport const DEFAULT_DURATION = 14;\n\nexport function tweenAccordionStyle(\n a: AccordionStyle,\n b: AccordionStyle,\n t: number,\n): AccordionStyle {\n return {\n panelHeight: a.panelHeight + (b.panelHeight - a.panelHeight) * t,\n panelOpacity: a.panelOpacity + (b.panelOpacity - a.panelOpacity) * t,\n chevronRotation:\n a.chevronRotation + (b.chevronRotation - a.chevronRotation) * t,\n background: mixOklch(a.background, b.background, t),\n };\n}\n\nexport interface AccordionTransitionOptions {\n variant?: \"default\" | \"ghost\";\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useAccordionTransition(\n steps: Step<AccordionState>[],\n opts: AccordionTransitionOptions = {},\n): AccordionStyle {\n const {\n variant = \"default\",\n theme: themeOverride,\n mode,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = accordionStyleContext(variant, theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"closed\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenAccordionStyle(\n accordionStyle(from, ctx),\n accordionStyle(to, ctx),\n t,\n );\n}\n","type": "registry:component","target": "components/remocn/use-accordion-transition.ts"}diff --git a/public/r/ai-prompt-flow.json b/public/r/ai-prompt-flow.jsonindex 49cebdfe..89c4bd53 100644--- a/public/r/ai-prompt-flow.json+++ b/public/r/ai-prompt-flow.json@@ -15,7 +15,7 @@"files": [{"path": "registry/remocn-ui/ai-prompt-flow/index.tsx",- "content": "\"use client\";\n\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\nimport { Input } from \"@/components/remocn/input\";\nimport { useInputTransition } from \"@/components/remocn/use-input-transition\";\nimport { Button } from \"@/components/remocn/button\";\nimport { useButtonTransition } from \"@/components/remocn/use-button-transition\";\nimport { Skeleton } from \"@/components/remocn/skeleton\";\nimport { SkeletonBlock } from \"@/components/remocn/skeleton-block\";\nimport { useSkeletonTransition } from \"@/components/remocn/use-skeleton-transition\";\nimport { Toast } from \"@/components/remocn/toast\";\nimport { useToastTransition } from \"@/components/remocn/use-toast-transition\";\n\nexport interface AiPromptFlowProps {\n prompt?: string;\n buttonLabel?: string;\n answerLines?: string[];\n toastTitle?: string;\n theme?: Partial<RemocnTheme>;\n}\n\nconst STAGE_W = 1280;\nconst PROMPT_W = 520;\nconst PROMPT_LEFT = (STAGE_W - PROMPT_W) / 2;\nconst PROMPT_TOP = 168;\nconst PROMPT_H = 92;\n\nconst BTN_W = 200;\nconst BTN_LEFT = (STAGE_W - BTN_W) / 2;\nconst BTN_TOP = 278;\nconst BTN_H = 64;\n\nconst ANSWER_W = 560;\nconst ANSWER_LEFT = (STAGE_W - ANSWER_W) / 2;\nconst ANSWER_TOP = 380;\n\nconst DEFAULT_ANSWER = [\n \"The thread debates the Q3 roadmap: ship the editor first,\",\n \"defer billing to Q4, and pull the migration forward so\",\n \"infra is unblocked before the team scales next quarter.\",\n];\n\nexport function AiPromptFlow({\n prompt = \"Summarize this thread\",\n buttonLabel = \"Generate\",\n answerLines = DEFAULT_ANSWER,\n toastTitle = \"Response ready\",\n theme,\n}: AiPromptFlowProps) {\n const resolved = useRemocnTheme(theme);\n const opts = { theme };\n\n const inputStyle = useInputTransition(\n [\n { at: 0, state: \"active\", duration: 1 },\n { at: 0, state: \"typing\", duration: 50 },\n ],\n opts,\n );\n\n const buttonStyle = useButtonTransition(\n [\n { at: 52, state: \"hover\", duration: 6 },\n { at: 58, state: \"press\", duration: 4 },\n { at: 62, state: \"loading\", duration: 4 },\n ],\n opts,\n );\n\n const skeletonStyle = useSkeletonTransition(\n [\n { at: 64, state: \"loading\", duration: 1 },\n { at: 150, state: \"loaded\", duration: 16 },\n ],\n {},\n );\n\n const panelOpacity = buttonStyle.spinnerOpacity;\n\n const toastStyle = useToastTransition(\n [\n { at: 160, state: \"visible\", duration: 14 },\n { at: 220, state: \"hidden\", duration: 14 },\n ],\n {},\n );\n\n return (\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n background: \"transparent\",\n }}\n >\n {}\n <div\n style={{\n position: \"absolute\",\n left: PROMPT_LEFT,\n top: PROMPT_TOP,\n width: PROMPT_W,\n height: PROMPT_H,\n }}\n >\n <Input\n placeholder=\"Ask anything…\"\n value={prompt}\n style={inputStyle}\n theme={theme}\n />\n </div>\n\n {}\n <div\n style={{\n position: \"absolute\",\n left: BTN_LEFT,\n top: BTN_TOP,\n width: BTN_W,\n height: BTN_H,\n }}\n >\n <Button\n label={buttonLabel}\n style={buttonStyle}\n theme={theme}\n />\n </div>\n\n {}\n <div\n style={{\n position: \"absolute\",\n left: ANSWER_LEFT,\n top: ANSWER_TOP,\n width: ANSWER_W,\n display: \"flex\",\n justifyContent: \"center\",\n opacity: panelOpacity,\n }}\n >\n <Skeleton\n style={skeletonStyle}\n theme={theme}\n placeholder={\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 14,\n width: ANSWER_W,\n }}\n >\n {answerLines.map((_, i) => (\n <SkeletonBlock\n key={i}\n width={i === answerLines.length - 1 ? \"70%\" : \"100%\"}\n height={18}\n baseColor={resolved.muted}\n />\n ))}\n </div>\n }\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n width: ANSWER_W,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n fontSize: 18,\n lineHeight: 1.45,\n letterSpacing: \"-0.01em\",\n color: resolved.foreground,\n }}\n >\n {answerLines.map((line, i) => (\n <span key={i}>{line}</span>\n ))}\n </div>\n </Skeleton>\n </div>\n\n {}\n <div style={{ position: \"absolute\", right: 32, bottom: 32 }}>\n <Toast\n title={toastTitle}\n variant=\"success\"\n style={toastStyle}\n theme={theme}\n />\n </div>\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport { Button } from \"@/components/remocn/button\";\nimport { Input } from \"@/components/remocn/input\";\nimport { Skeleton } from \"@/components/remocn/skeleton\";\nimport { SkeletonBlock } from \"@/components/remocn/skeleton-block\";\nimport { Toast } from \"@/components/remocn/toast\";\nimport { useButtonTransition } from \"@/components/remocn/use-button-transition\";\nimport { useInputTransition } from \"@/components/remocn/use-input-transition\";\nimport { useSkeletonTransition } from \"@/components/remocn/use-skeleton-transition\";\nimport { useToastTransition } from \"@/components/remocn/use-toast-transition\";\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport interface AiPromptFlowProps {\n prompt?: string;\n buttonLabel?: string;\n answerLines?: string[];\n toastTitle?: string;\n theme?: Partial<RemocnTheme>;\n}\n\nconst STAGE_W = 1280;\nconst PROMPT_W = 520;\nconst PROMPT_LEFT = (STAGE_W - PROMPT_W) / 2;\nconst PROMPT_TOP = 168;\nconst PROMPT_H = 92;\n\nconst BTN_W = 200;\nconst BTN_LEFT = (STAGE_W - BTN_W) / 2;\nconst BTN_TOP = 278;\nconst BTN_H = 64;\n\nconst ANSWER_W = 560;\nconst ANSWER_LEFT = (STAGE_W - ANSWER_W) / 2;\nconst ANSWER_TOP = 380;\n\nconst DEFAULT_ANSWER = [\n \"The thread debates the Q3 roadmap: ship the editor first,\",\n \"defer billing to Q4, and pull the migration forward so\",\n \"infra is unblocked before the team scales next quarter.\",\n];\n\nexport function AiPromptFlow({\n prompt = \"Summarize this thread\",\n buttonLabel = \"Generate\",\n answerLines = DEFAULT_ANSWER,\n toastTitle = \"Response ready\",\n theme,\n}: AiPromptFlowProps) {\n const resolved = useRemocnTheme(theme);\n const opts = { theme };\n\n const inputStyle = useInputTransition(\n [\n { at: 0, state: \"active\", duration: 1 },\n { at: 0, state: \"typing\", duration: 50 },\n ],\n opts,\n );\n\n const buttonStyle = useButtonTransition(\n [\n { at: 52, state: \"hover\", duration: 6 },\n { at: 58, state: \"press\", duration: 4 },\n { at: 62, state: \"loading\", duration: 4 },\n ],\n opts,\n );\n\n const skeletonStyle = useSkeletonTransition(\n [\n { at: 64, state: \"loading\", duration: 1 },\n { at: 150, state: \"loaded\", duration: 16 },\n ],\n {},\n );\n\n const panelOpacity = buttonStyle.spinnerOpacity;\n\n const toastStyle = useToastTransition(\n [\n { at: 160, state: \"visible\", duration: 14 },\n { at: 220, state: \"hidden\", duration: 14 },\n ],\n {},\n );\n\n return (\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n background: \"transparent\",\n }}\n >\n {}\n <div\n style={{\n position: \"absolute\",\n left: PROMPT_LEFT,\n top: PROMPT_TOP,\n width: PROMPT_W,\n height: PROMPT_H,\n }}\n >\n <Input\n placeholder=\"Ask anything…\"\n value={prompt}\n style={inputStyle}\n theme={theme}\n />\n </div>\n\n {}\n <div\n style={{\n position: \"absolute\",\n left: BTN_LEFT,\n top: BTN_TOP,\n width: BTN_W,\n height: BTN_H,\n }}\n >\n <Button label={buttonLabel} style={buttonStyle} theme={theme} />\n </div>\n\n {}\n <div\n style={{\n position: \"absolute\",\n left: ANSWER_LEFT,\n top: ANSWER_TOP,\n width: ANSWER_W,\n display: \"flex\",\n justifyContent: \"center\",\n opacity: panelOpacity,\n }}\n >\n <Skeleton\n style={skeletonStyle}\n theme={theme}\n placeholder={\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 14,\n width: ANSWER_W,\n }}\n >\n {answerLines.map((_, i) => (\n <SkeletonBlock\n key={i}\n width={i === answerLines.length - 1 ? \"70%\" : \"100%\"}\n height={18}\n baseColor={resolved.muted}\n />\n ))}\n </div>\n }\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n width: ANSWER_W,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n fontSize: 18,\n lineHeight: 1.45,\n letterSpacing: \"-0.01em\",\n color: resolved.foreground,\n }}\n >\n {answerLines.map((line, i) => (\n <span key={i}>{line}</span>\n ))}\n </div>\n </Skeleton>\n </div>\n\n {}\n <div style={{ position: \"absolute\", right: 32, bottom: 32 }}>\n <Toast\n title={toastTitle}\n variant=\"success\"\n style={toastStyle}\n theme={theme}\n />\n </div>\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/ai-prompt-flow.tsx"}diff --git a/public/r/alert-dialog.json b/public/r/alert-dialog.jsonindex 37d59d1d..1ce786c1 100644--- a/public/r/alert-dialog.json+++ b/public/r/alert-dialog.json@@ -14,7 +14,7 @@},{"path": "registry/remocn-ui/alert-dialog/use-alert-dialog-transition.ts",- "content": "\"use client\";\n\nimport {\n easings,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\nimport {\n alertDialogStyle,\n alertDialogStyleContext,\n type AlertDialogState,\n type AlertDialogStyle,\n} from \"@/components/remocn/alert-dialog\";\n\nexport const DEFAULT_DURATION = 12;\n\nexport function tweenAlertDialogStyle(\n a: AlertDialogStyle,\n b: AlertDialogStyle,\n t: number,\n): AlertDialogStyle {\n return {\n overlayOpacity: a.overlayOpacity + (b.overlayOpacity - a.overlayOpacity) * t,\n popupOpacity: a.popupOpacity + (b.popupOpacity - a.popupOpacity) * t,\n popupScale: a.popupScale + (b.popupScale - a.popupScale) * t,\n popupTranslateY:\n a.popupTranslateY + (b.popupTranslateY - a.popupTranslateY) * t,\n };\n}\n\nexport interface AlertDialogTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useAlertDialogTransition(\n steps: Step<AlertDialogState>[],\n opts: AlertDialogTransitionOptions = {},\n): AlertDialogStyle {\n const {\n theme: themeOverride,\n mode,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = alertDialogStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"closed\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenAlertDialogStyle(\n alertDialogStyle(from, ctx),\n alertDialogStyle(to, ctx),\n t,\n );\n}\n",+ "content": "\"use client\";\n\nimport {\n type AlertDialogState,\n type AlertDialogStyle,\n alertDialogStyle,\n alertDialogStyleContext,\n} from \"@/components/remocn/alert-dialog\";\nimport {\n easings,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\n\nexport const DEFAULT_DURATION = 12;\n\nexport function tweenAlertDialogStyle(\n a: AlertDialogStyle,\n b: AlertDialogStyle,\n t: number,\n): AlertDialogStyle {\n return {\n overlayOpacity:\n a.overlayOpacity + (b.overlayOpacity - a.overlayOpacity) * t,\n popupOpacity: a.popupOpacity + (b.popupOpacity - a.popupOpacity) * t,\n popupScale: a.popupScale + (b.popupScale - a.popupScale) * t,\n popupTranslateY:\n a.popupTranslateY + (b.popupTranslateY - a.popupTranslateY) * t,\n };\n}\n\nexport interface AlertDialogTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useAlertDialogTransition(\n steps: Step<AlertDialogState>[],\n opts: AlertDialogTransitionOptions = {},\n): AlertDialogStyle {\n const {\n theme: themeOverride,\n mode,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = alertDialogStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"closed\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenAlertDialogStyle(\n alertDialogStyle(from, ctx),\n alertDialogStyle(to, ctx),\n t,\n );\n}\n","type": "registry:component","target": "components/remocn/use-alert-dialog-transition.ts"}diff --git a/public/r/animated-bar-chart.json b/public/r/animated-bar-chart.jsonindex df6c6132..bd672a89 100644--- a/public/r/animated-bar-chart.json+++ b/public/r/animated-bar-chart.json@@ -7,7 +7,7 @@"files": [{"path": "registry/remocn/animated-bar-chart/index.tsx",- "content": "\"use client\";\n\nimport { spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface AnimatedBarChartProps {\n data?: number[];\n labels?: string[];\n width?: number;\n height?: number;\n barColor?: string;\n gap?: number;\n staggerFrames?: number;\n speed?: number;\n className?: string;\n}\n\nexport function AnimatedBarChart({\n data = [35, 60, 45, 80, 55, 70, 90, 65],\n labels,\n width = 1000,\n height = 500,\n barColor = \"#0ea5e9\",\n gap = 16,\n staggerFrames = 6,\n speed = 1,\n className,\n}: AnimatedBarChartProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const padding = 60;\n const labelSpace = labels ? 40 : 0;\n const innerWidth = width - padding * 2;\n const innerHeight = height - padding * 2 - labelSpace;\n const max = Math.max(...data);\n const barWidth = (innerWidth - gap * (data.length - 1)) / data.length;\n const baseY = padding + innerHeight;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <svg width={width} height={height} viewBox={`0 0 ${width} ${height}`}>\n {/* Baseline */}\n <line\n x1={padding}\n x2={padding + innerWidth}\n y1={baseY}\n y2={baseY}\n stroke=\"#27272a\"\n strokeWidth={2}\n />\n\n {data.map((value, index) => {\n const targetHeight = (value / max) * innerHeight;\n const x = padding + index * (barWidth + gap);\n const y = baseY - targetHeight;\n\n const scaleY = spring({\n frame: frame - index * staggerFrames,\n fps,\n config: { damping: 12, stiffness: 100, mass: 0.8 },\n from: 0,\n to: 1,\n });\n\n return (\n <g key={index}>\n <rect\n x={x}\n y={y}\n width={barWidth}\n height={targetHeight}\n rx={6}\n fill={barColor}\n style={{\n transform: `scaleY(${scaleY})`,\n transformOrigin: `${x + barWidth / 2}px ${baseY}px`,\n transformBox: \"fill-box\",\n filter: `drop-shadow(0 4px 16px ${barColor}55)`,\n }}\n />\n {labels && labels[index] && (\n <text\n x={x + barWidth / 2}\n y={baseY + 28}\n fill=\"#a1a1aa\"\n fontSize={16}\n textAnchor=\"middle\"\n style={{\n opacity: scaleY,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {labels[index]}\n </text>\n )}\n </g>\n );\n })}\n </svg>\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport { spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface AnimatedBarChartProps {\n data?: number[];\n labels?: string[];\n width?: number;\n height?: number;\n barColor?: string;\n gap?: number;\n staggerFrames?: number;\n speed?: number;\n className?: string;\n}\n\nexport function AnimatedBarChart({\n data = [35, 60, 45, 80, 55, 70, 90, 65],\n labels,\n width = 1000,\n height = 500,\n barColor = \"#0ea5e9\",\n gap = 16,\n staggerFrames = 6,\n speed = 1,\n className,\n}: AnimatedBarChartProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const padding = 60;\n const labelSpace = labels ? 40 : 0;\n const innerWidth = width - padding * 2;\n const innerHeight = height - padding * 2 - labelSpace;\n const max = Math.max(...data);\n const barWidth = (innerWidth - gap * (data.length - 1)) / data.length;\n const baseY = padding + innerHeight;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <svg width={width} height={height} viewBox={`0 0 ${width} ${height}`}>\n {/* Baseline */}\n <line\n x1={padding}\n x2={padding + innerWidth}\n y1={baseY}\n y2={baseY}\n stroke=\"#27272a\"\n strokeWidth={2}\n />\n\n {data.map((value, index) => {\n const targetHeight = (value / max) * innerHeight;\n const x = padding + index * (barWidth + gap);\n const y = baseY - targetHeight;\n\n const scaleY = spring({\n frame: frame - index * staggerFrames,\n fps,\n config: { damping: 12, stiffness: 100, mass: 0.8 },\n from: 0,\n to: 1,\n });\n\n return (\n <g key={index}>\n <rect\n x={x}\n y={y}\n width={barWidth}\n height={targetHeight}\n rx={6}\n fill={barColor}\n style={{\n transform: `scaleY(${scaleY})`,\n transformOrigin: `${x + barWidth / 2}px ${baseY}px`,\n transformBox: \"fill-box\",\n filter: `drop-shadow(0 4px 16px ${barColor}55)`,\n }}\n />\n {labels?.[index] && (\n <text\n x={x + barWidth / 2}\n y={baseY + 28}\n fill=\"#a1a1aa\"\n fontSize={16}\n textAnchor=\"middle\"\n style={{\n opacity: scaleY,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {labels[index]}\n </text>\n )}\n </g>\n );\n })}\n </svg>\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/animated-bar-chart.tsx"}diff --git a/public/r/blur-in.json b/public/r/blur-in.jsonindex 395d2ffa..9415726b 100644--- a/public/r/blur-in.json+++ b/public/r/blur-in.json@@ -8,13 +8,13 @@"files": [{"path": "registry/remocn-ui/blur-in/index.tsx",- "content": "\"use client\";\n\nimport type { CSSProperties, ReactNode } from \"react\";\n\nexport type BlurInState = \"hidden\" | \"revealed\";\nexport type BlurInDirection = \"up\" | \"down\" | \"left\" | \"right\";\n\nexport interface BlurInStyle {\n blur: number;\n opacity: number;\n translateX: number;\n translateY: number;\n}\n\nexport interface BlurInStyleContext {\n blur: number;\n distance: number;\n axis: \"x\" | \"y\";\n sign: 1 | -1;\n}\n\nexport function blurInStyleContext(\n blur: number,\n direction: BlurInDirection,\n distance: number,\n): BlurInStyleContext {\n const axis: \"x\" | \"y\" =\n direction === \"left\" || direction === \"right\" ? \"x\" : \"y\";\n const sign: 1 | -1 = direction === \"up\" || direction === \"left\" ? 1 : -1;\n return { blur, distance, axis, sign };\n}\n\nexport function blurInStyle(\n state: BlurInState,\n ctx: BlurInStyleContext,\n): BlurInStyle {\n if (state === \"revealed\")\n return { blur: 0, opacity: 1, translateX: 0, translateY: 0 };\n return {\n blur: ctx.blur,\n opacity: 0,\n translateX: ctx.axis === \"x\" ? ctx.sign * ctx.distance : 0,\n translateY: ctx.axis === \"y\" ? ctx.sign * ctx.distance : 0,\n };\n}\n\nexport interface BlurInProps {\n state?: BlurInState;\n style?: BlurInStyle;\n children: ReactNode;\n blur?: number;\n direction?: BlurInDirection;\n distance?: number;\n display?: CSSProperties[\"display\"];\n className?: string;\n}\n\nexport function BlurIn({\n state = \"hidden\",\n style,\n children,\n blur = 8,\n direction = \"up\",\n distance = 12,\n display = \"inline-block\",\n className,\n}: BlurInProps) {\n const v = style ?? blurInStyle(state, blurInStyleContext(blur, direction, distance));\n return (\n <div\n className={className}\n style={{\n display,\n opacity: v.opacity,\n filter: v.blur > 0 ? `blur(${v.blur}px)` : \"none\",\n transform: `translate(${v.translateX}px, ${v.translateY}px)`,\n }}\n >\n {children}\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport type { CSSProperties, ReactNode } from \"react\";\n\nexport type BlurInState = \"hidden\" | \"revealed\";\nexport type BlurInDirection = \"up\" | \"down\" | \"left\" | \"right\";\n\nexport interface BlurInStyle {\n blur: number;\n opacity: number;\n translateX: number;\n translateY: number;\n}\n\nexport interface BlurInStyleContext {\n blur: number;\n distance: number;\n axis: \"x\" | \"y\";\n sign: 1 | -1;\n}\n\nexport function blurInStyleContext(\n blur: number,\n direction: BlurInDirection,\n distance: number,\n): BlurInStyleContext {\n const axis: \"x\" | \"y\" =\n direction === \"left\" || direction === \"right\" ? \"x\" : \"y\";\n const sign: 1 | -1 = direction === \"up\" || direction === \"left\" ? 1 : -1;\n return { blur, distance, axis, sign };\n}\n\nexport function blurInStyle(\n state: BlurInState,\n ctx: BlurInStyleContext,\n): BlurInStyle {\n if (state === \"revealed\")\n return { blur: 0, opacity: 1, translateX: 0, translateY: 0 };\n return {\n blur: ctx.blur,\n opacity: 0,\n translateX: ctx.axis === \"x\" ? ctx.sign * ctx.distance : 0,\n translateY: ctx.axis === \"y\" ? ctx.sign * ctx.distance : 0,\n };\n}\n\nexport interface BlurInProps {\n state?: BlurInState;\n style?: BlurInStyle;\n children: ReactNode;\n blur?: number;\n direction?: BlurInDirection;\n distance?: number;\n display?: CSSProperties[\"display\"];\n className?: string;\n}\n\nexport function BlurIn({\n state = \"hidden\",\n style,\n children,\n blur = 8,\n direction = \"up\",\n distance = 12,\n display = \"inline-block\",\n className,\n}: BlurInProps) {\n const v =\n style ?? blurInStyle(state, blurInStyleContext(blur, direction, distance));\n return (\n <div\n className={className}\n style={{\n display,\n opacity: v.opacity,\n filter: v.blur > 0 ? `blur(${v.blur}px)` : \"none\",\n transform: `translate(${v.translateX}px, ${v.translateY}px)`,\n }}\n >\n {children}\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/blur-in.tsx"},{"path": "registry/remocn-ui/blur-in/use-blur-in-transition.ts",- "content": "\"use client\";\n\nimport {\n easings,\n type Step,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\nimport {\n blurInStyle,\n blurInStyleContext,\n type BlurInDirection,\n type BlurInState,\n type BlurInStyle,\n} from \"@/components/remocn/blur-in\";\n\nexport const DEFAULT_DURATION = 18;\n\nexport function tweenBlurInStyle(\n a: BlurInStyle,\n b: BlurInStyle,\n t: number,\n): BlurInStyle {\n return {\n blur: a.blur + (b.blur - a.blur) * t,\n opacity: a.opacity + (b.opacity - a.opacity) * t,\n translateX: a.translateX + (b.translateX - a.translateX) * t,\n translateY: a.translateY + (b.translateY - a.translateY) * t,\n };\n}\n\nexport interface BlurInTransitionOptions {\n blur?: number;\n direction?: BlurInDirection;\n distance?: number;\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useBlurInTransition(\n steps: Step<BlurInState>[],\n opts: BlurInTransitionOptions = {},\n): BlurInStyle {\n const {\n blur = 8,\n direction = \"up\",\n distance = 12,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const ctx = blurInStyleContext(blur, direction, distance);\n const { from, to, progress } = useStateTransition(\n steps,\n \"hidden\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenBlurInStyle(blurInStyle(from, ctx), blurInStyle(to, ctx), t);\n}\n",+ "content": "\"use client\";\n\nimport {\n type BlurInDirection,\n type BlurInState,\n type BlurInStyle,\n blurInStyle,\n blurInStyleContext,\n} from \"@/components/remocn/blur-in\";\nimport { easings, type Step, useStateTransition } from \"@/lib/remocn-ui\";\n\nexport const DEFAULT_DURATION = 18;\n\nexport function tweenBlurInStyle(\n a: BlurInStyle,\n b: BlurInStyle,\n t: number,\n): BlurInStyle {\n return {\n blur: a.blur + (b.blur - a.blur) * t,\n opacity: a.opacity + (b.opacity - a.opacity) * t,\n translateX: a.translateX + (b.translateX - a.translateX) * t,\n translateY: a.translateY + (b.translateY - a.translateY) * t,\n };\n}\n\nexport interface BlurInTransitionOptions {\n blur?: number;\n direction?: BlurInDirection;\n distance?: number;\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useBlurInTransition(\n steps: Step<BlurInState>[],\n opts: BlurInTransitionOptions = {},\n): BlurInStyle {\n const {\n blur = 8,\n direction = \"up\",\n distance = 12,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const ctx = blurInStyleContext(blur, direction, distance);\n const { from, to, progress } = useStateTransition(\n steps,\n \"hidden\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenBlurInStyle(blurInStyle(from, ctx), blurInStyle(to, ctx), t);\n}\n","type": "registry:component","target": "components/remocn/use-blur-in-transition.ts"}diff --git a/public/r/blur-out-up.json b/public/r/blur-out-up.jsonindex d4532352..480a8ac3 100644--- a/public/r/blur-out-up.json+++ b/public/r/blur-out-up.json@@ -7,7 +7,7 @@"files": [{"path": "registry/remocn/blur-out-up/index.tsx",- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface BlurOutUpProps {\n text: string;\n staggerDelay?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function BlurOutUp({\n text,\n staggerDelay = 1,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: BlurOutUpProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const words = text.split(\" \");\n\n const enterDur = 17;\n const exitDur = 14;\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterEnd = enterDur + (words.length - 1) * staggerDelay;\n const exitStart = Math.max(enterEnd, durationInFrames - exitDur - (words.length - 1) * staggerDelay);\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {words.map((word, i) => {\n const enterLocal = frame - i * staggerDelay;\n const exitLocal = frame - exitStart - i * staggerDelay;\n\n const enterP = interpolate(enterLocal, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(exitLocal, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(enterLocal, [0, enterDur], [10, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const yExit = interpolate(exitLocal, [0, exitDur], [0, -14], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const y = yEnter + yExit;\n\n const blurEnter = interpolate(enterLocal, [0, enterDur], [6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const blurExit = interpolate(exitLocal, [0, exitDur], [0, 8], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const blur = blurEnter + blurExit;\n\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n filter: `blur(${blur}px)`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface BlurOutUpProps {\n text: string;\n staggerDelay?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function BlurOutUp({\n text,\n staggerDelay = 1,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: BlurOutUpProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const words = text.split(\" \");\n\n const enterDur = 17;\n const exitDur = 14;\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterEnd = enterDur + (words.length - 1) * staggerDelay;\n const exitStart = Math.max(\n enterEnd,\n durationInFrames - exitDur - (words.length - 1) * staggerDelay,\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {words.map((word, i) => {\n const enterLocal = frame - i * staggerDelay;\n const exitLocal = frame - exitStart - i * staggerDelay;\n\n const enterP = interpolate(enterLocal, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(exitLocal, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(enterLocal, [0, enterDur], [10, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const yExit = interpolate(exitLocal, [0, exitDur], [0, -14], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const y = yEnter + yExit;\n\n const blurEnter = interpolate(enterLocal, [0, enterDur], [6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const blurExit = interpolate(exitLocal, [0, exitDur], [0, 8], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const blur = blurEnter + blurExit;\n\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n filter: `blur(${blur}px)`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/blur-out-up.tsx"}diff --git a/public/r/bottom-up-letters.json b/public/r/bottom-up-letters.jsonindex 6bba9629..d6e5d75b 100644--- a/public/r/bottom-up-letters.json+++ b/public/r/bottom-up-letters.json@@ -7,7 +7,7 @@"files": [{"path": "registry/remocn/bottom-up-letters/index.tsx",- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface BottomUpLettersProps {\n text: string;\n staggerDelay?: number;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function BottomUpLetters({\n text,\n staggerDelay = 3,\n distance = 46,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: BottomUpLettersProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 12;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerDelay;\n const easing = Easing.bezier(0.18, 1, 0.32, 1);\n const opacity = interpolate(\n local,\n [0, charDurationFrames],\n [0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\", easing },\n );\n const y = interpolate(\n local,\n [0, charDurationFrames],\n [distance, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\", easing },\n );\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface BottomUpLettersProps {\n text: string;\n staggerDelay?: number;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function BottomUpLetters({\n text,\n staggerDelay = 3,\n distance = 46,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: BottomUpLettersProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 12;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerDelay;\n const easing = Easing.bezier(0.18, 1, 0.32, 1);\n const opacity = interpolate(local, [0, charDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const y = interpolate(local, [0, charDurationFrames], [distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/bottom-up-letters.tsx"}diff --git a/public/r/button.json b/public/r/button.jsonindex 62166045..d4f85db8 100644--- a/public/r/button.json+++ b/public/r/button.json@@ -14,7 +14,7 @@},{"path": "registry/remocn-ui/button/use-button-transition.ts",- "content": "\"use client\";\n\nimport {\n easings,\n mixOklch,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\nimport {\n buttonStyle,\n buttonStyleContext,\n type ButtonState,\n type ButtonStyle,\n} from \"@/components/remocn/button\";\n\nexport const DEFAULT_DURATION = 8;\n\nexport function tweenButtonStyle(\n a: ButtonStyle,\n b: ButtonStyle,\n t: number,\n): ButtonStyle {\n return {\n translateY: a.translateY + (b.translateY - a.translateY) * t,\n scale: a.scale + (b.scale - a.scale) * t,\n labelOpacity: a.labelOpacity + (b.labelOpacity - a.labelOpacity) * t,\n spinnerOpacity:\n a.spinnerOpacity + (b.spinnerOpacity - a.spinnerOpacity) * t,\n checkOpacity: a.checkOpacity + (b.checkOpacity - a.checkOpacity) * t,\n background: mixOklch(a.background, b.background, t),\n };\n}\n\nexport interface ButtonTransitionOptions {\n variant?: \"default\" | \"secondary\" | \"destructive\" | \"outline\" | \"ghost\";\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n primary?: string;\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useButtonTransition(\n steps: Step<ButtonState>[],\n opts: ButtonTransitionOptions = {},\n): ButtonStyle {\n const {\n variant = \"default\",\n theme: themeOverride,\n mode,\n primary,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(\n { ...themeOverride, ...(primary ? { primary } : {}) },\n mode,\n );\n const ctx = buttonStyleContext(variant, theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"idle\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenButtonStyle(buttonStyle(from, ctx), buttonStyle(to, ctx), t);\n}\n",+ "content": "\"use client\";\n\nimport {\n type ButtonState,\n type ButtonStyle,\n buttonStyle,\n buttonStyleContext,\n} from \"@/components/remocn/button\";\nimport {\n easings,\n mixOklch,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\n\nexport const DEFAULT_DURATION = 8;\n\nexport function tweenButtonStyle(\n a: ButtonStyle,\n b: ButtonStyle,\n t: number,\n): ButtonStyle {\n return {\n translateY: a.translateY + (b.translateY - a.translateY) * t,\n scale: a.scale + (b.scale - a.scale) * t,\n labelOpacity: a.labelOpacity + (b.labelOpacity - a.labelOpacity) * t,\n spinnerOpacity:\n a.spinnerOpacity + (b.spinnerOpacity - a.spinnerOpacity) * t,\n checkOpacity: a.checkOpacity + (b.checkOpacity - a.checkOpacity) * t,\n background: mixOklch(a.background, b.background, t),\n };\n}\n\nexport interface ButtonTransitionOptions {\n variant?: \"default\" | \"secondary\" | \"destructive\" | \"outline\" | \"ghost\";\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n primary?: string;\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useButtonTransition(\n steps: Step<ButtonState>[],\n opts: ButtonTransitionOptions = {},\n): ButtonStyle {\n const {\n variant = \"default\",\n theme: themeOverride,\n mode,\n primary,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(\n { ...themeOverride, ...(primary ? { primary } : {}) },\n mode,\n );\n const ctx = buttonStyleContext(variant, theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"idle\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenButtonStyle(buttonStyle(from, ctx), buttonStyle(to, ctx), t);\n}\n","type": "registry:component","target": "components/remocn/use-button-transition.ts"}diff --git a/public/r/chat-flow.json b/public/r/chat-flow.jsonindex b3266ca3..6c7fac5c 100644--- a/public/r/chat-flow.json+++ b/public/r/chat-flow.json@@ -13,7 +13,7 @@"files": [{"path": "registry/remocn-ui/chat-flow/index.tsx",- "content": "\"use client\";\n\nimport { interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport {\n type RemocnTheme,\n mixOklch,\n revealedText,\n useRemocnTheme,\n} from \"@/lib/remocn-ui\";\nimport { Caret } from \"@/components/remocn/caret\";\nimport {\n MessageBubble,\n type MessageBubbleReactionStyle,\n type MessageBubbleStyle,\n} from \"@/components/remocn/message-bubble\";\nimport { useMessageBubbleTransition } from \"@/components/remocn/use-message-bubble-transition\";\nimport { TypingIndicator } from \"@/components/remocn/typing-indicator\";\n\nexport interface ChatMessage {\n from: \"me\" | \"them\";\n text: string;\n reaction?: string;\n}\n\nexport interface ChatContact {\n name: string;\n avatar?: string;\n}\n\nexport interface ChatFlowProps {\n messages?: ChatMessage[];\n contact?: ChatContact;\n accentColor?: string;\n speed?: number;\n theme?: Partial<RemocnTheme>;\n}\n\nconst MOBILE_WIDTH = 460;\nconst LEAD_IN = 12;\nconst FRAMES_PER_CHAR = 2.2;\nconst MIN_TYPE = 18;\nconst MAX_TYPE = 86;\nconst SEND_GAP = 10;\nconst REVEAL = 14;\nconst REACT_DELAY = 8;\nconst REACT_DUR = 14;\nconst MSG_GAP = 18;\nconst TYPING_MIN = 34;\nconst TYPING_MAX = 70;\nconst TAIL = 28;\nconst PRESS_WINDOW = 7;\n\nconst DEFAULT_MESSAGES: ChatMessage[] = [\n { from: \"me\", text: \"Hey — ready for the demo?\" },\n { from: \"them\", text: \"Yep, pushing it live now\", reaction: \"🔥\" },\n { from: \"me\", text: \"Perfect, sending the link over\", reaction: \"👍\" },\n];\n\nfunction clamp(value: number, lo: number, hi: number): number {\n return Math.max(lo, Math.min(hi, value));\n}\n\nexport interface ScheduledMessage {\n index: number;\n from: \"me\" | \"them\";\n text: string;\n reaction?: string;\n presenceStart: number;\n typeStart?: number;\n sendAt?: number;\n typingStart?: number;\n revealAt: number;\n reactAt?: number;\n}\n\nexport interface ChatFlowSchedule {\n items: ScheduledMessage[];\n duration: number;\n}\n\nexport function chatFlowSchedule(messages: ChatMessage[]): ChatFlowSchedule {\n const items: ScheduledMessage[] = [];\n let cursor = LEAD_IN;\n\n messages.forEach((message, index) => {\n const hasReaction =\n message.reaction !== undefined && message.reaction !== \"\";\n if (message.from === \"me\") {\n const typeStart = cursor;\n const typeDur = clamp(\n Math.round(message.text.length * FRAMES_PER_CHAR),\n MIN_TYPE,\n MAX_TYPE,\n );\n const sendAt = typeStart + typeDur + SEND_GAP;\n const revealAt = sendAt;\n const reactAt = hasReaction ? revealAt + REVEAL + REACT_DELAY : undefined;\n items.push({\n index,\n from: \"me\",\n text: message.text,\n reaction: hasReaction ? message.reaction : undefined,\n presenceStart: sendAt - 2,\n typeStart,\n sendAt,\n revealAt,\n reactAt,\n });\n cursor =\n revealAt +\n REVEAL +\n (hasReaction ? REACT_DELAY + REACT_DUR : 0) +\n MSG_GAP;\n } else {\n const typingStart = cursor;\n const typingDur = clamp(\n Math.round(message.text.length * FRAMES_PER_CHAR),\n TYPING_MIN,\n TYPING_MAX,\n );\n const revealAt = typingStart + typingDur;\n const reactAt = hasReaction ? revealAt + REVEAL + REACT_DELAY : undefined;\n items.push({\n index,\n from: \"them\",\n text: message.text,\n reaction: hasReaction ? message.reaction : undefined,\n presenceStart: typingStart,\n typingStart,\n revealAt,\n reactAt,\n });\n cursor =\n revealAt +\n REVEAL +\n (hasReaction ? REACT_DELAY + REACT_DUR : 0) +\n MSG_GAP;\n }\n });\n\n const duration = Math.max(cursor - MSG_GAP + TAIL, LEAD_IN + TAIL);\n return { items, duration };\n}\n\nexport function chatFlowDuration(\n messages: ChatMessage[] = DEFAULT_MESSAGES,\n speed = 1,\n): number {\n const raw = chatFlowSchedule(messages).duration;\n return Math.ceil(raw / (speed <= 0 ? 1 : speed));\n}\n\nexport function sendPulse(items: ScheduledMessage[], eff: number): number {\n let best = 0;\n for (const item of items) {\n if (item.sendAt === undefined) continue;\n const distance = Math.abs(eff - item.sendAt);\n if (distance <= PRESS_WINDOW) {\n best = Math.max(best, 1 - distance / PRESS_WINDOW);\n }\n }\n return best;\n}\n\nfunction typingBubbleStyle(\n eff: number,\n typingStart: number,\n revealAt: number,\n): MessageBubbleStyle {\n const inOpacity = interpolate(eff, [typingStart, typingStart + 8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const outOpacity = interpolate(eff, [revealAt - 6, revealAt], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const translateY = interpolate(eff, [typingStart, typingStart + 8], [10, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n return { opacity: inOpacity * outOpacity, translateY, scale: 1 };\n}\n\nfunction Avatar({\n contact,\n theme,\n}: {\n contact: ChatContact;\n theme: RemocnTheme;\n}) {\n const initial = contact.name.trim().charAt(0).toUpperCase();\n return (\n <div\n style={{\n flexShrink: 0,\n width: 32,\n height: 32,\n minWidth: 32,\n borderRadius: \"50%\",\n overflow: \"hidden\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: theme.muted,\n color: theme.mutedForeground,\n fontSize: 14,\n fontWeight: 600,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {contact.avatar !== undefined ? (\n <img\n src={contact.avatar}\n alt={contact.name}\n style={{ width: \"100%\", height: \"100%\", objectFit: \"cover\" }}\n />\n ) : (\n initial\n )}\n </div>\n );\n}\n\nfunction SendIcon({ color }: { color: string }) {\n return (\n <svg width={20} height={20} viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d=\"M12 19V5M12 5l-6 6M12 5l6 6\"\n stroke={color}\n strokeWidth={2.2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction PlusIcon({ color }: { color: string }) {\n return (\n <svg width={20} height={20} viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d=\"M12 5v14M5 12h14\"\n stroke={color}\n strokeWidth={2.2}\n strokeLinecap=\"round\"\n />\n </svg>\n );\n}\n\nexport function ChatFlow({\n messages = DEFAULT_MESSAGES,\n contact,\n accentColor,\n speed = 1,\n theme: themeOverride,\n}: ChatFlowProps) {\n const frame = useCurrentFrame();\n const eff = frame * speed;\n\n const themeProp = {\n ...themeOverride,\n ...(accentColor ? { primary: accentColor } : {}),\n };\n const resolved = useRemocnTheme(themeProp, \"light\");\n\n const { items } = chatFlowSchedule(messages);\n\n const activeMe = items.find(\n (item) =>\n item.from === \"me\" &&\n item.typeStart !== undefined &&\n item.sendAt !== undefined &&\n eff >= item.typeStart &&\n eff < item.sendAt,\n );\n let composerText = \"\";\n let typing = false;\n if (\n activeMe &&\n activeMe.typeStart !== undefined &&\n activeMe.sendAt !== undefined\n ) {\n const typeDur = Math.max(\n activeMe.sendAt - SEND_GAP - activeMe.typeStart,\n 1,\n );\n const progress = clamp((eff - activeMe.typeStart) / typeDur, 0, 1);\n composerText = revealedText(\n activeMe.text,\n Math.floor(progress * activeMe.text.length),\n );\n typing = true;\n }\n\n const sendActive = composerText.length > 0;\n const sendScale = 1 - 0.16 * sendPulse(items, eff);\n const present = items.filter((item) => eff >= item.presenceStart);\n\n const composerBackground = mixOklch(\n resolved.background,\n resolved.muted,\n 0.55,\n );\n\n return (\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n justifyContent: \"center\",\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n width: \"100%\",\n maxWidth: MOBILE_WIDTH,\n height: \"100%\",\n padding: \"24px 16px 18px\",\n boxSizing: \"border-box\",\n }}\n >\n {contact !== undefined && (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n paddingBottom: 16,\n marginBottom: 8,\n borderBottom: `1px solid ${resolved.border}`,\n }}\n >\n <Avatar contact={contact} theme={resolved} />\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 2 }}>\n <span\n style={{\n fontSize: 15,\n fontWeight: 600,\n lineHeight: 1.25,\n letterSpacing: \"-0.01em\",\n color: resolved.foreground,\n }}\n >\n {contact.name}\n </span>\n <span\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 5,\n fontSize: 12,\n lineHeight: 1.2,\n color: \"oklch(0.62 0.17 150)\",\n }}\n >\n <span\n style={{\n width: 6,\n height: 6,\n borderRadius: \"50%\",\n background: \"oklch(0.62 0.17 150)\",\n }}\n />\n online\n </span>\n </div>\n </div>\n )}\n\n <div\n style={{\n position: \"relative\",\n flex: 1,\n minHeight: 0,\n overflow: \"hidden\",\n WebkitMaskImage:\n \"linear-gradient(to bottom, transparent 0, #000 48px, #000 100%)\",\n maskImage:\n \"linear-gradient(to bottom, transparent 0, #000 48px, #000 100%)\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flex-end\",\n gap: 20,\n minHeight: \"100%\",\n paddingTop: 24,\n paddingBottom: 22,\n }}\n >\n {present.map((item) => (\n <ChatRow\n key={item.index}\n item={item}\n eff={eff}\n speed={speed}\n contact={contact}\n themeProp={themeProp}\n theme={resolved}\n />\n ))}\n </div>\n </div>\n\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 10,\n marginTop: 14,\n padding: 14,\n borderRadius: 24,\n background: composerBackground,\n border: `1px solid ${resolved.border}`,\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-start\",\n minHeight: 24,\n fontSize: 15,\n lineHeight: 1.45,\n letterSpacing: \"-0.01em\",\n color: sendActive\n ? resolved.foreground\n : resolved.mutedForeground,\n }}\n >\n <span style={{ whiteSpace: \"pre-wrap\", wordBreak: \"break-word\" }}>\n {sendActive ? composerText : \"Message\"}\n </span>\n {typing && (\n <Caret\n color={resolved.foreground}\n height={18}\n radius={1}\n blink\n marginLeft={composerText.length > 0 ? 2 : 0}\n />\n )}\n </div>\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n }}\n >\n <div\n style={{\n width: 38,\n height: 38,\n borderRadius: \"50%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n border: `1px solid ${resolved.border}`,\n background: \"transparent\",\n }}\n >\n <PlusIcon color={resolved.mutedForeground} />\n </div>\n <div\n style={{\n width: 38,\n height: 38,\n borderRadius: \"50%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: sendActive\n ? resolved.primary\n : mixOklch(resolved.background, resolved.muted, 0.6),\n transform: `scale(${sendScale})`,\n }}\n >\n <SendIcon\n color={\n sendActive\n ? resolved.primaryForeground\n : resolved.mutedForeground\n }\n />\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nfunction ChatRow({\n item,\n eff,\n speed,\n contact,\n themeProp,\n theme,\n}: {\n item: ScheduledMessage;\n eff: number;\n speed: number;\n contact?: ChatContact;\n themeProp: Partial<RemocnTheme>;\n theme: RemocnTheme;\n}) {\n const { fps } = useVideoConfig();\n const variant = item.from === \"me\" ? \"outgoing\" : \"incoming\";\n const showTyping =\n item.from === \"them\" &&\n item.typingStart !== undefined &&\n eff < item.revealAt;\n\n const bubbleStyle = useMessageBubbleTransition(\n [{ at: item.revealAt, state: \"visible\", duration: REVEAL }],\n { speed },\n );\n\n let reactionStyle: MessageBubbleReactionStyle | undefined;\n if (item.reactAt !== undefined) {\n const reactAt = item.reactAt;\n const pop = spring({\n fps,\n frame: eff - reactAt,\n config: { damping: 11, stiffness: 220, mass: 0.6 },\n });\n const opacity = interpolate(eff, [reactAt, reactAt + 5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n reactionStyle = { opacity, scale: pop };\n }\n\n const bubbleNode = showTyping ? (\n <MessageBubble\n variant=\"incoming\"\n style={typingBubbleStyle(eff, item.typingStart ?? 0, item.revealAt)}\n theme={themeProp}\n >\n <TypingIndicator color={theme.mutedForeground} />\n </MessageBubble>\n ) : (\n <MessageBubble\n variant={variant}\n style={bubbleStyle}\n reaction={item.reaction}\n reactionStyle={reactionStyle}\n theme={themeProp}\n >\n {item.text}\n </MessageBubble>\n );\n\n if (item.from === \"them\" && contact !== undefined) {\n return (\n <div style={{ display: \"flex\", alignItems: \"flex-end\", gap: 8 }}>\n <Avatar contact={contact} theme={theme} />\n <div style={{ flex: 1, minWidth: 0 }}>{bubbleNode}</div>\n </div>\n );\n }\n\n return bubbleNode;\n}\n",+ "content": "\"use client\";\n\nimport { interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { Caret } from \"@/components/remocn/caret\";\nimport {\n MessageBubble,\n type MessageBubbleReactionStyle,\n type MessageBubbleStyle,\n} from \"@/components/remocn/message-bubble\";\nimport { TypingIndicator } from \"@/components/remocn/typing-indicator\";\nimport { useMessageBubbleTransition } from \"@/components/remocn/use-message-bubble-transition\";\nimport {\n mixOklch,\n type RemocnTheme,\n revealedText,\n useRemocnTheme,\n} from \"@/lib/remocn-ui\";\n\nexport interface ChatMessage {\n from: \"me\" | \"them\";\n text: string;\n reaction?: string;\n}\n\nexport interface ChatContact {\n name: string;\n avatar?: string;\n}\n\nexport interface ChatFlowProps {\n messages?: ChatMessage[];\n contact?: ChatContact;\n accentColor?: string;\n speed?: number;\n theme?: Partial<RemocnTheme>;\n}\n\nconst MOBILE_WIDTH = 460;\nconst LEAD_IN = 12;\nconst FRAMES_PER_CHAR = 2.2;\nconst MIN_TYPE = 18;\nconst MAX_TYPE = 86;\nconst SEND_GAP = 10;\nconst REVEAL = 14;\nconst REACT_DELAY = 8;\nconst REACT_DUR = 14;\nconst MSG_GAP = 18;\nconst TYPING_MIN = 34;\nconst TYPING_MAX = 70;\nconst TAIL = 28;\nconst PRESS_WINDOW = 7;\n\nconst DEFAULT_MESSAGES: ChatMessage[] = [\n { from: \"me\", text: \"Hey — ready for the demo?\" },\n { from: \"them\", text: \"Yep, pushing it live now\", reaction: \"🔥\" },\n { from: \"me\", text: \"Perfect, sending the link over\", reaction: \"👍\" },\n];\n\nfunction clamp(value: number, lo: number, hi: number): number {\n return Math.max(lo, Math.min(hi, value));\n}\n\nexport interface ScheduledMessage {\n index: number;\n from: \"me\" | \"them\";\n text: string;\n reaction?: string;\n presenceStart: number;\n typeStart?: number;\n sendAt?: number;\n typingStart?: number;\n revealAt: number;\n reactAt?: number;\n}\n\nexport interface ChatFlowSchedule {\n items: ScheduledMessage[];\n duration: number;\n}\n\nexport function chatFlowSchedule(messages: ChatMessage[]): ChatFlowSchedule {\n const items: ScheduledMessage[] = [];\n let cursor = LEAD_IN;\n\n messages.forEach((message, index) => {\n const hasReaction =\n message.reaction !== undefined && message.reaction !== \"\";\n if (message.from === \"me\") {\n const typeStart = cursor;\n const typeDur = clamp(\n Math.round(message.text.length * FRAMES_PER_CHAR),\n MIN_TYPE,\n MAX_TYPE,\n );\n const sendAt = typeStart + typeDur + SEND_GAP;\n const revealAt = sendAt;\n const reactAt = hasReaction ? revealAt + REVEAL + REACT_DELAY : undefined;\n items.push({\n index,\n from: \"me\",\n text: message.text,\n reaction: hasReaction ? message.reaction : undefined,\n presenceStart: sendAt - 2,\n typeStart,\n sendAt,\n revealAt,\n reactAt,\n });\n cursor =\n revealAt +\n REVEAL +\n (hasReaction ? REACT_DELAY + REACT_DUR : 0) +\n MSG_GAP;\n } else {\n const typingStart = cursor;\n const typingDur = clamp(\n Math.round(message.text.length * FRAMES_PER_CHAR),\n TYPING_MIN,\n TYPING_MAX,\n );\n const revealAt = typingStart + typingDur;\n const reactAt = hasReaction ? revealAt + REVEAL + REACT_DELAY : undefined;\n items.push({\n index,\n from: \"them\",\n text: message.text,\n reaction: hasReaction ? message.reaction : undefined,\n presenceStart: typingStart,\n typingStart,\n revealAt,\n reactAt,\n });\n cursor =\n revealAt +\n REVEAL +\n (hasReaction ? REACT_DELAY + REACT_DUR : 0) +\n MSG_GAP;\n }\n });\n\n const duration = Math.max(cursor - MSG_GAP + TAIL, LEAD_IN + TAIL);\n return { items, duration };\n}\n\nexport function chatFlowDuration(\n messages: ChatMessage[] = DEFAULT_MESSAGES,\n speed = 1,\n): number {\n const raw = chatFlowSchedule(messages).duration;\n return Math.ceil(raw / (speed <= 0 ? 1 : speed));\n}\n\nexport function sendPulse(items: ScheduledMessage[], eff: number): number {\n let best = 0;\n for (const item of items) {\n if (item.sendAt === undefined) continue;\n const distance = Math.abs(eff - item.sendAt);\n if (distance <= PRESS_WINDOW) {\n best = Math.max(best, 1 - distance / PRESS_WINDOW);\n }\n }\n return best;\n}\n\nfunction typingBubbleStyle(\n eff: number,\n typingStart: number,\n revealAt: number,\n): MessageBubbleStyle {\n const inOpacity = interpolate(eff, [typingStart, typingStart + 8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const outOpacity = interpolate(eff, [revealAt - 6, revealAt], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const translateY = interpolate(eff, [typingStart, typingStart + 8], [10, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n return { opacity: inOpacity * outOpacity, translateY, scale: 1 };\n}\n\nfunction Avatar({\n contact,\n theme,\n}: {\n contact: ChatContact;\n theme: RemocnTheme;\n}) {\n const initial = contact.name.trim().charAt(0).toUpperCase();\n return (\n <div\n style={{\n flexShrink: 0,\n width: 32,\n height: 32,\n minWidth: 32,\n borderRadius: \"50%\",\n overflow: \"hidden\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: theme.muted,\n color: theme.mutedForeground,\n fontSize: 14,\n fontWeight: 600,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {contact.avatar !== undefined ? (\n // biome-ignore lint/performance/noImgElement: Remotion output, not a Next.js app — next/image isn't available where this component ships\n <img\n src={contact.avatar}\n alt={contact.name}\n style={{ width: \"100%\", height: \"100%\", objectFit: \"cover\" }}\n />\n ) : (\n initial\n )}\n </div>\n );\n}\n\nfunction SendIcon({ color }: { color: string }) {\n return (\n <svg width={20} height={20} viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d=\"M12 19V5M12 5l-6 6M12 5l6 6\"\n stroke={color}\n strokeWidth={2.2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction PlusIcon({ color }: { color: string }) {\n return (\n <svg width={20} height={20} viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d=\"M12 5v14M5 12h14\"\n stroke={color}\n strokeWidth={2.2}\n strokeLinecap=\"round\"\n />\n </svg>\n );\n}\n\nexport function ChatFlow({\n messages = DEFAULT_MESSAGES,\n contact,\n accentColor,\n speed = 1,\n theme: themeOverride,\n}: ChatFlowProps) {\n const frame = useCurrentFrame();\n const eff = frame * speed;\n\n const themeProp = {\n ...themeOverride,\n ...(accentColor ? { primary: accentColor } : {}),\n };\n const resolved = useRemocnTheme(themeProp, \"light\");\n\n const { items } = chatFlowSchedule(messages);\n\n const activeMe = items.find(\n (item) =>\n item.from === \"me\" &&\n item.typeStart !== undefined &&\n item.sendAt !== undefined &&\n eff >= item.typeStart &&\n eff < item.sendAt,\n );\n let composerText = \"\";\n let typing = false;\n if (\n activeMe &&\n activeMe.typeStart !== undefined &&\n activeMe.sendAt !== undefined\n ) {\n const typeDur = Math.max(\n activeMe.sendAt - SEND_GAP - activeMe.typeStart,\n 1,\n );\n const progress = clamp((eff - activeMe.typeStart) / typeDur, 0, 1);\n composerText = revealedText(\n activeMe.text,\n Math.floor(progress * activeMe.text.length),\n );\n typing = true;\n }\n\n const sendActive = composerText.length > 0;\n const sendScale = 1 - 0.16 * sendPulse(items, eff);\n const present = items.filter((item) => eff >= item.presenceStart);\n\n const composerBackground = mixOklch(\n resolved.background,\n resolved.muted,\n 0.55,\n );\n\n return (\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n justifyContent: \"center\",\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n width: \"100%\",\n maxWidth: MOBILE_WIDTH,\n height: \"100%\",\n padding: \"24px 16px 18px\",\n boxSizing: \"border-box\",\n }}\n >\n {contact !== undefined && (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n paddingBottom: 16,\n marginBottom: 8,\n borderBottom: `1px solid ${resolved.border}`,\n }}\n >\n <Avatar contact={contact} theme={resolved} />\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 2 }}>\n <span\n style={{\n fontSize: 15,\n fontWeight: 600,\n lineHeight: 1.25,\n letterSpacing: \"-0.01em\",\n color: resolved.foreground,\n }}\n >\n {contact.name}\n </span>\n <span\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 5,\n fontSize: 12,\n lineHeight: 1.2,\n color: \"oklch(0.62 0.17 150)\",\n }}\n >\n <span\n style={{\n width: 6,\n height: 6,\n borderRadius: \"50%\",\n background: \"oklch(0.62 0.17 150)\",\n }}\n />\n online\n </span>\n </div>\n </div>\n )}\n\n <div\n style={{\n position: \"relative\",\n flex: 1,\n minHeight: 0,\n overflow: \"hidden\",\n WebkitMaskImage:\n \"linear-gradient(to bottom, transparent 0, #000 48px, #000 100%)\",\n maskImage:\n \"linear-gradient(to bottom, transparent 0, #000 48px, #000 100%)\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flex-end\",\n gap: 20,\n minHeight: \"100%\",\n paddingTop: 24,\n paddingBottom: 22,\n }}\n >\n {present.map((item) => (\n <ChatRow\n key={item.index}\n item={item}\n eff={eff}\n speed={speed}\n contact={contact}\n themeProp={themeProp}\n theme={resolved}\n />\n ))}\n </div>\n </div>\n\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 10,\n marginTop: 14,\n padding: 14,\n borderRadius: 24,\n background: composerBackground,\n border: `1px solid ${resolved.border}`,\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-start\",\n minHeight: 24,\n fontSize: 15,\n lineHeight: 1.45,\n letterSpacing: \"-0.01em\",\n color: sendActive\n ? resolved.foreground\n : resolved.mutedForeground,\n }}\n >\n <span style={{ whiteSpace: \"pre-wrap\", wordBreak: \"break-word\" }}>\n {sendActive ? composerText : \"Message\"}\n </span>\n {typing && (\n <Caret\n color={resolved.foreground}\n height={18}\n radius={1}\n blink\n marginLeft={composerText.length > 0 ? 2 : 0}\n />\n )}\n </div>\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n }}\n >\n <div\n style={{\n width: 38,\n height: 38,\n borderRadius: \"50%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n border: `1px solid ${resolved.border}`,\n background: \"transparent\",\n }}\n >\n <PlusIcon color={resolved.mutedForeground} />\n </div>\n <div\n style={{\n width: 38,\n height: 38,\n borderRadius: \"50%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: sendActive\n ? resolved.primary\n : mixOklch(resolved.background, resolved.muted, 0.6),\n transform: `scale(${sendScale})`,\n }}\n >\n <SendIcon\n color={\n sendActive\n ? resolved.primaryForeground\n : resolved.mutedForeground\n }\n />\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nfunction ChatRow({\n item,\n eff,\n speed,\n contact,\n themeProp,\n theme,\n}: {\n item: ScheduledMessage;\n eff: number;\n speed: number;\n contact?: ChatContact;\n themeProp: Partial<RemocnTheme>;\n theme: RemocnTheme;\n}) {\n const { fps } = useVideoConfig();\n const variant = item.from === \"me\" ? \"outgoing\" : \"incoming\";\n const showTyping =\n item.from === \"them\" &&\n item.typingStart !== undefined &&\n eff < item.revealAt;\n\n const bubbleStyle = useMessageBubbleTransition(\n [{ at: item.revealAt, state: \"visible\", duration: REVEAL }],\n { speed },\n );\n\n let reactionStyle: MessageBubbleReactionStyle | undefined;\n if (item.reactAt !== undefined) {\n const reactAt = item.reactAt;\n const pop = spring({\n fps,\n frame: eff - reactAt,\n config: { damping: 11, stiffness: 220, mass: 0.6 },\n });\n const opacity = interpolate(eff, [reactAt, reactAt + 5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n reactionStyle = { opacity, scale: pop };\n }\n\n const bubbleNode = showTyping ? (\n <MessageBubble\n variant=\"incoming\"\n style={typingBubbleStyle(eff, item.typingStart ?? 0, item.revealAt)}\n theme={themeProp}\n >\n <TypingIndicator color={theme.mutedForeground} />\n </MessageBubble>\n ) : (\n <MessageBubble\n variant={variant}\n style={bubbleStyle}\n reaction={item.reaction}\n reactionStyle={reactionStyle}\n theme={themeProp}\n >\n {item.text}\n </MessageBubble>\n );\n\n if (item.from === \"them\" && contact !== undefined) {\n return (\n <div style={{ display: \"flex\", alignItems: \"flex-end\", gap: 8 }}>\n <Avatar contact={contact} theme={theme} />\n <div style={{ flex: 1, minWidth: 0 }}>{bubbleNode}</div>\n </div>\n );\n }\n\n return bubbleNode;\n}\n","type": "registry:component","target": "components/remocn/chat-flow.tsx"}diff --git a/public/r/chat-gpt.json b/public/r/chat-gpt.jsonindex 36f53599..986a9227 100644--- a/public/r/chat-gpt.json+++ b/public/r/chat-gpt.json@@ -8,7 +8,7 @@"files": [{"path": "registry/remocn/chat-gpt/index.tsx",- "content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/Inter\";\nimport {\n AbsoluteFill,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Caret } from \"@/components/remocn/caret\";\nimport { useTypewriter } from \"@/lib/remocn-ui\";\n\nconst { fontFamily: SANS_FAMILY } = loadFont();\n\nexport interface ChatGptProps {\n greeting?: string;\n placeholder?: string;\n prompt?: string;\n accentColor?: string;\n speed?: number;\n}\n\ninterface Theme {\n page: string;\n inputBg: string;\n inputBorder: string;\n fg: string;\n fgMuted: string;\n chipBorder: string;\n chipFg: string;\n sendBg: string;\n sendArrow: string;\n iconColor: string;\n}\n\nexport const THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n page: \"#FFFFFF\",\n inputBg: \"#FFFFFF\",\n inputBorder: \"#E3E3E3\",\n fg: \"#0D0D0D\",\n fgMuted: \"#9B9B9B\",\n chipBorder: \"#E3E3E3\",\n chipFg: \"#5D5D5D\",\n sendBg: \"#0D0D0D\",\n sendArrow: \"#FFFFFF\",\n iconColor: \"#5D5D5D\",\n },\n dark: {\n page: \"#212121\",\n inputBg: \"#303030\",\n inputBorder: \"#454545\",\n fg: \"#ECECEC\",\n fgMuted: \"#9B9B9B\",\n chipBorder: \"#454545\",\n chipFg: \"#C5C5C5\",\n sendBg: \"#FFFFFF\",\n sendArrow: \"#0D0D0D\",\n iconColor: \"#C5C5C5\",\n },\n};\n\nexport const TYPING_START_FRAME = 42;\n\nexport const TYPING_CPS = 22;\n\nexport function morphProgressAt(\n frame: number,\n opts: { startFrame?: number; fps: number; speed: number },\n): number {\n const startFrame = opts.startFrame ?? TYPING_START_FRAME;\n const value = spring({\n fps: opts.fps,\n frame: frame * opts.speed - startFrame,\n config: { damping: 14, stiffness: 200, mass: 0.6 },\n });\n return Math.max(0, Math.min(value, 1));\n}\n\nfunction introBounceIn(\n frame: number,\n fps: number,\n): { translateY: number; scale: number } {\n const s = spring({\n fps,\n frame,\n config: { damping: 14, stiffness: 110, mass: 0.7 },\n });\n const translateY = interpolate(s, [0, 1], [28, 0]);\n const scale = interpolate(s, [0, 1], [0.97, 1]);\n return { translateY, scale };\n}\n\nfunction fadeUpAt(\n frame: number,\n range: [number, number],\n): { opacity: number; translateY: number } {\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n return {\n opacity: interpolate(frame, range, [0, 1], opts),\n translateY: interpolate(frame, range, [12, 0], opts),\n };\n}\n\nfunction PlusIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Add</title>\n <path\n d=\"M12 5v14M5 12h14\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n />\n </svg>\n );\n}\n\nfunction MicIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Voice input</title>\n <rect\n x={9}\n y={3}\n width={6}\n height={11}\n rx={3}\n stroke={color}\n strokeWidth={1.8}\n />\n <path\n d=\"M5.5 11a6.5 6.5 0 0013 0M12 17.5V21M9 21h6\"\n stroke={color}\n strokeWidth={1.8}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction WaveformIcon({ size, color }: { size: number; color: string }) {\n const bars = [\n { x: 4, h: 8 },\n { x: 9, h: 16 },\n { x: 14, h: 12 },\n { x: 19, h: 20 },\n ];\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Voice</title>\n {bars.map((bar) => (\n <rect\n key={bar.x}\n x={bar.x - 1}\n y={(24 - bar.h) / 2}\n width={2.4}\n height={bar.h}\n rx={1.2}\n fill={color}\n />\n ))}\n </svg>\n );\n}\n\nfunction ArrowUpIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Send</title>\n <path\n d=\"M12 19V6M12 6l-6 6M12 6l6 6\"\n stroke={color}\n strokeWidth={2.2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction ImageIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Create an image</title>\n <rect\n x={3}\n y={4}\n width={18}\n height={16}\n rx={3}\n stroke={color}\n strokeWidth={1.7}\n />\n <circle cx={8.5} cy={9} r={1.6} stroke={color} strokeWidth={1.7} />\n <path\n d=\"M5 18l5-5 4 4 2-2 3 3\"\n stroke={color}\n strokeWidth={1.7}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction PencilIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Write or edit</title>\n <path\n d=\"M4 20h4L19 9a2.1 2.1 0 00-3-3L5 17v3z\"\n stroke={color}\n strokeWidth={1.7}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M14 7l3 3\"\n stroke={color}\n strokeWidth={1.7}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction GlobeIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Look something up</title>\n <circle cx={12} cy={12} r={9} stroke={color} strokeWidth={1.7} />\n <path\n d=\"M3 12h18M12 3c2.5 2.5 2.5 15 0 18M12 3c-2.5 2.5-2.5 15 0 18\"\n stroke={color}\n strokeWidth={1.7}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction SuggestionChip({\n label,\n border,\n color,\n icon,\n}: {\n label: string;\n border: string;\n color: string;\n icon: React.ReactNode;\n}) {\n return (\n <div\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 8,\n padding: \"10px 16px\",\n borderRadius: 20,\n border: `1px solid ${border}`,\n color,\n fontFamily: SANS_FAMILY,\n fontSize: 15,\n }}\n >\n {icon}\n <span>{label}</span>\n </div>\n );\n}\n\nexport function ChatGpt({\n greeting = \"What's on your mind today?\",\n placeholder = \"Ask anything\",\n prompt = \"Make a sunset over a calm ocean\",\n accentColor = \"#2F6FED\",\n speed = 1,\n}: ChatGptProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = THEMES.light;\n\n const refW = 1280;\n const refH = 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const tw = useTypewriter(prompt, {\n cps: TYPING_CPS,\n speed,\n startFrame: TYPING_START_FRAME,\n });\n const visibleText = tw.text;\n const showText = tw.count > 0;\n const morph = morphProgressAt(frame, { fps, speed });\n\n const intro = introBounceIn(frame * speed, fps);\n const headingFade = fadeUpAt(frame * speed, [4, 20]);\n const pillFade = fadeUpAt(frame * speed, [10, 26]);\n const chipsFade = fadeUpAt(frame * speed, [16, 32]);\n\n\n const pillWidth = 820;\n const pillLeft = (refW - pillWidth) / 2;\n const pillTop = 300;\n const pillHeight = 64;\n const morphSize = 44;\n\n const chipsOpacity = chipsFade.opacity * (1 - morph);\n const chipsShift = chipsFade.translateY + 8 * morph;\n\n return (\n <AbsoluteFill style={{ background: \"transparent\" }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n transform: `translate(-50%, -50%) scale(${stageScale})`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 196,\n width: refW,\n textAlign: \"center\",\n fontFamily: SANS_FAMILY,\n fontSize: 40,\n fontWeight: 700,\n color: t.fg,\n opacity: headingFade.opacity,\n transform: `translateY(${headingFade.translateY + intro.translateY * 0.4}px)`,\n }}\n >\n {greeting}\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: pillLeft,\n top: pillTop,\n width: pillWidth,\n height: pillHeight,\n background: t.inputBg,\n border: `1px solid ${t.inputBorder}`,\n borderRadius: 32,\n boxShadow: \"0 8px 30px -14px rgba(13,13,13,0.14)\",\n opacity: pillFade.opacity,\n transform: `translateY(${pillFade.translateY + intro.translateY * 0.6}px) scale(${intro.scale})`,\n transformOrigin: \"center top\",\n display: \"flex\",\n alignItems: \"center\",\n paddingLeft: 20,\n paddingRight: 12,\n boxSizing: \"border-box\",\n }}\n >\n <PlusIcon size={24} color={t.fg} />\n\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n marginLeft: 14,\n fontFamily: SANS_FAMILY,\n fontSize: 19,\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n }}\n >\n {showText ? (\n <span\n style={{\n color: t.fg,\n display: \"inline-flex\",\n alignItems: \"center\",\n }}\n >\n {visibleText}\n <Caret\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n height={22}\n marginLeft={2}\n />\n </span>\n ) : (\n <span\n style={{\n color: t.fgMuted,\n display: \"inline-flex\",\n alignItems: \"center\",\n }}\n >\n <Caret color={t.fg} blink={!tw.typing} speed={speed} height={22} />\n <span style={{ marginLeft: 6 }}>{placeholder}</span>\n </span>\n )}\n </div>\n\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n flexShrink: 0,\n }}\n >\n <div\n style={{\n width: 40,\n height: 40,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <MicIcon size={22} color={t.iconColor} />\n </div>\n\n <div\n style={{\n position: \"relative\",\n width: morphSize,\n height: morphSize,\n flexShrink: 0,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: \"100%\",\n background: accentColor,\n opacity: 1 - morph,\n transform: `scale(${1 - 0.1 * morph})`,\n }}\n >\n <WaveformIcon size={22} color=\"#FFFFFF\" />\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: \"100%\",\n background: t.sendBg,\n opacity: morph,\n transform: `scale(${0.8 + 0.2 * morph})`,\n }}\n >\n <ArrowUpIcon size={22} color={t.sendArrow} />\n </div>\n </div>\n </div>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: pillTop + pillHeight + 24,\n width: refW,\n display: \"flex\",\n justifyContent: \"center\",\n gap: 12,\n opacity: chipsOpacity,\n transform: `translateY(${chipsShift}px)`,\n }}\n >\n <SuggestionChip\n label=\"Create an image\"\n border={t.chipBorder}\n color={t.chipFg}\n icon={<ImageIcon size={18} color={t.chipFg} />}\n />\n <SuggestionChip\n label=\"Write or edit\"\n border={t.chipBorder}\n color={t.chipFg}\n icon={<PencilIcon size={18} color={t.chipFg} />}\n />\n <SuggestionChip\n label=\"Look something up\"\n border={t.chipBorder}\n color={t.chipFg}\n icon={<GlobeIcon size={18} color={t.chipFg} />}\n />\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n",+ "content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/Inter\";\nimport {\n AbsoluteFill,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Caret } from \"@/components/remocn/caret\";\nimport { useTypewriter } from \"@/lib/remocn-ui\";\n\nconst { fontFamily: SANS_FAMILY } = loadFont();\n\nexport interface ChatGptProps {\n greeting?: string;\n placeholder?: string;\n prompt?: string;\n accentColor?: string;\n speed?: number;\n}\n\ninterface Theme {\n page: string;\n inputBg: string;\n inputBorder: string;\n fg: string;\n fgMuted: string;\n chipBorder: string;\n chipFg: string;\n sendBg: string;\n sendArrow: string;\n iconColor: string;\n}\n\nexport const THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n page: \"#FFFFFF\",\n inputBg: \"#FFFFFF\",\n inputBorder: \"#E3E3E3\",\n fg: \"#0D0D0D\",\n fgMuted: \"#9B9B9B\",\n chipBorder: \"#E3E3E3\",\n chipFg: \"#5D5D5D\",\n sendBg: \"#0D0D0D\",\n sendArrow: \"#FFFFFF\",\n iconColor: \"#5D5D5D\",\n },\n dark: {\n page: \"#212121\",\n inputBg: \"#303030\",\n inputBorder: \"#454545\",\n fg: \"#ECECEC\",\n fgMuted: \"#9B9B9B\",\n chipBorder: \"#454545\",\n chipFg: \"#C5C5C5\",\n sendBg: \"#FFFFFF\",\n sendArrow: \"#0D0D0D\",\n iconColor: \"#C5C5C5\",\n },\n};\n\nexport const TYPING_START_FRAME = 42;\n\nexport const TYPING_CPS = 22;\n\nexport function morphProgressAt(\n frame: number,\n opts: { startFrame?: number; fps: number; speed: number },\n): number {\n const startFrame = opts.startFrame ?? TYPING_START_FRAME;\n const value = spring({\n fps: opts.fps,\n frame: frame * opts.speed - startFrame,\n config: { damping: 14, stiffness: 200, mass: 0.6 },\n });\n return Math.max(0, Math.min(value, 1));\n}\n\nfunction introBounceIn(\n frame: number,\n fps: number,\n): { translateY: number; scale: number } {\n const s = spring({\n fps,\n frame,\n config: { damping: 14, stiffness: 110, mass: 0.7 },\n });\n const translateY = interpolate(s, [0, 1], [28, 0]);\n const scale = interpolate(s, [0, 1], [0.97, 1]);\n return { translateY, scale };\n}\n\nfunction fadeUpAt(\n frame: number,\n range: [number, number],\n): { opacity: number; translateY: number } {\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n return {\n opacity: interpolate(frame, range, [0, 1], opts),\n translateY: interpolate(frame, range, [12, 0], opts),\n };\n}\n\nfunction PlusIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Add</title>\n <path\n d=\"M12 5v14M5 12h14\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n />\n </svg>\n );\n}\n\nfunction MicIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Voice input</title>\n <rect\n x={9}\n y={3}\n width={6}\n height={11}\n rx={3}\n stroke={color}\n strokeWidth={1.8}\n />\n <path\n d=\"M5.5 11a6.5 6.5 0 0013 0M12 17.5V21M9 21h6\"\n stroke={color}\n strokeWidth={1.8}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction WaveformIcon({ size, color }: { size: number; color: string }) {\n const bars = [\n { x: 4, h: 8 },\n { x: 9, h: 16 },\n { x: 14, h: 12 },\n { x: 19, h: 20 },\n ];\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Voice</title>\n {bars.map((bar) => (\n <rect\n key={bar.x}\n x={bar.x - 1}\n y={(24 - bar.h) / 2}\n width={2.4}\n height={bar.h}\n rx={1.2}\n fill={color}\n />\n ))}\n </svg>\n );\n}\n\nfunction ArrowUpIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Send</title>\n <path\n d=\"M12 19V6M12 6l-6 6M12 6l6 6\"\n stroke={color}\n strokeWidth={2.2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction ImageIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Create an image</title>\n <rect\n x={3}\n y={4}\n width={18}\n height={16}\n rx={3}\n stroke={color}\n strokeWidth={1.7}\n />\n <circle cx={8.5} cy={9} r={1.6} stroke={color} strokeWidth={1.7} />\n <path\n d=\"M5 18l5-5 4 4 2-2 3 3\"\n stroke={color}\n strokeWidth={1.7}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction PencilIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Write or edit</title>\n <path\n d=\"M4 20h4L19 9a2.1 2.1 0 00-3-3L5 17v3z\"\n stroke={color}\n strokeWidth={1.7}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M14 7l3 3\"\n stroke={color}\n strokeWidth={1.7}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction GlobeIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Look something up</title>\n <circle cx={12} cy={12} r={9} stroke={color} strokeWidth={1.7} />\n <path\n d=\"M3 12h18M12 3c2.5 2.5 2.5 15 0 18M12 3c-2.5 2.5-2.5 15 0 18\"\n stroke={color}\n strokeWidth={1.7}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction SuggestionChip({\n label,\n border,\n color,\n icon,\n}: {\n label: string;\n border: string;\n color: string;\n icon: React.ReactNode;\n}) {\n return (\n <div\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 8,\n padding: \"10px 16px\",\n borderRadius: 20,\n border: `1px solid ${border}`,\n color,\n fontFamily: SANS_FAMILY,\n fontSize: 15,\n }}\n >\n {icon}\n <span>{label}</span>\n </div>\n );\n}\n\nexport function ChatGpt({\n greeting = \"What's on your mind today?\",\n placeholder = \"Ask anything\",\n prompt = \"Make a sunset over a calm ocean\",\n accentColor = \"#2F6FED\",\n speed = 1,\n}: ChatGptProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = THEMES.light;\n\n const refW = 1280;\n const refH = 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const tw = useTypewriter(prompt, {\n cps: TYPING_CPS,\n speed,\n startFrame: TYPING_START_FRAME,\n });\n const visibleText = tw.text;\n const showText = tw.count > 0;\n const morph = morphProgressAt(frame, { fps, speed });\n\n const intro = introBounceIn(frame * speed, fps);\n const headingFade = fadeUpAt(frame * speed, [4, 20]);\n const pillFade = fadeUpAt(frame * speed, [10, 26]);\n const chipsFade = fadeUpAt(frame * speed, [16, 32]);\n\n const pillWidth = 820;\n const pillLeft = (refW - pillWidth) / 2;\n const pillTop = 300;\n const pillHeight = 64;\n const morphSize = 44;\n\n const chipsOpacity = chipsFade.opacity * (1 - morph);\n const chipsShift = chipsFade.translateY + 8 * morph;\n\n return (\n <AbsoluteFill style={{ background: \"transparent\" }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n transform: `translate(-50%, -50%) scale(${stageScale})`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 196,\n width: refW,\n textAlign: \"center\",\n fontFamily: SANS_FAMILY,\n fontSize: 40,\n fontWeight: 700,\n color: t.fg,\n opacity: headingFade.opacity,\n transform: `translateY(${headingFade.translateY + intro.translateY * 0.4}px)`,\n }}\n >\n {greeting}\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: pillLeft,\n top: pillTop,\n width: pillWidth,\n height: pillHeight,\n background: t.inputBg,\n border: `1px solid ${t.inputBorder}`,\n borderRadius: 32,\n boxShadow: \"0 8px 30px -14px rgba(13,13,13,0.14)\",\n opacity: pillFade.opacity,\n transform: `translateY(${pillFade.translateY + intro.translateY * 0.6}px) scale(${intro.scale})`,\n transformOrigin: \"center top\",\n display: \"flex\",\n alignItems: \"center\",\n paddingLeft: 20,\n paddingRight: 12,\n boxSizing: \"border-box\",\n }}\n >\n <PlusIcon size={24} color={t.fg} />\n\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n marginLeft: 14,\n fontFamily: SANS_FAMILY,\n fontSize: 19,\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n }}\n >\n {showText ? (\n <span\n style={{\n color: t.fg,\n display: \"inline-flex\",\n alignItems: \"center\",\n }}\n >\n {visibleText}\n <Caret\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n height={22}\n marginLeft={2}\n />\n </span>\n ) : (\n <span\n style={{\n color: t.fgMuted,\n display: \"inline-flex\",\n alignItems: \"center\",\n }}\n >\n <Caret\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n height={22}\n />\n <span style={{ marginLeft: 6 }}>{placeholder}</span>\n </span>\n )}\n </div>\n\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n flexShrink: 0,\n }}\n >\n <div\n style={{\n width: 40,\n height: 40,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <MicIcon size={22} color={t.iconColor} />\n </div>\n\n <div\n style={{\n position: \"relative\",\n width: morphSize,\n height: morphSize,\n flexShrink: 0,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: \"100%\",\n background: accentColor,\n opacity: 1 - morph,\n transform: `scale(${1 - 0.1 * morph})`,\n }}\n >\n <WaveformIcon size={22} color=\"#FFFFFF\" />\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: \"100%\",\n background: t.sendBg,\n opacity: morph,\n transform: `scale(${0.8 + 0.2 * morph})`,\n }}\n >\n <ArrowUpIcon size={22} color={t.sendArrow} />\n </div>\n </div>\n </div>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: pillTop + pillHeight + 24,\n width: refW,\n display: \"flex\",\n justifyContent: \"center\",\n gap: 12,\n opacity: chipsOpacity,\n transform: `translateY(${chipsShift}px)`,\n }}\n >\n <SuggestionChip\n label=\"Create an image\"\n border={t.chipBorder}\n color={t.chipFg}\n icon={<ImageIcon size={18} color={t.chipFg} />}\n />\n <SuggestionChip\n label=\"Write or edit\"\n border={t.chipBorder}\n color={t.chipFg}\n icon={<PencilIcon size={18} color={t.chipFg} />}\n />\n <SuggestionChip\n label=\"Look something up\"\n border={t.chipBorder}\n color={t.chipFg}\n icon={<GlobeIcon size={18} color={t.chipFg} />}\n />\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n","type": "registry:component","target": "components/remocn/chat-gpt.tsx"}diff --git a/public/r/checkbox.json b/public/r/checkbox.jsonindex 17030893..378791d8 100644--- a/public/r/checkbox.json+++ b/public/r/checkbox.json@@ -14,7 +14,7 @@},{"path": "registry/remocn-ui/checkbox/use-checkbox-transition.ts",- "content": "\"use client\";\n\nimport {\n easings,\n mixOklch,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\nimport {\n checkboxStyle,\n checkboxStyleContext,\n type CheckboxState,\n type CheckboxStyle,\n} from \"@/components/remocn/checkbox\";\n\nexport const DEFAULT_DURATION = 10;\n\nexport function tweenCheckboxStyle(\n a: CheckboxStyle,\n b: CheckboxStyle,\n t: number,\n): CheckboxStyle {\n return {\n boxBackground: mixOklch(a.boxBackground, b.boxBackground, t),\n boxBorderColor: mixOklch(a.boxBorderColor, b.boxBorderColor, t),\n checkOpacity: a.checkOpacity + (b.checkOpacity - a.checkOpacity) * t,\n checkScale: a.checkScale + (b.checkScale - a.checkScale) * t,\n checkDraw: a.checkDraw + (b.checkDraw - a.checkDraw) * t,\n };\n}\n\nexport interface CheckboxTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n primary?: string;\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useCheckboxTransition(\n steps: Step<CheckboxState>[],\n opts: CheckboxTransitionOptions = {},\n): CheckboxStyle {\n const {\n theme: themeOverride,\n mode,\n primary,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(\n { ...themeOverride, ...(primary ? { primary } : {}) },\n mode,\n );\n const ctx = checkboxStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"unchecked\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenCheckboxStyle(checkboxStyle(from, ctx), checkboxStyle(to, ctx), t);\n}\n",+ "content": "\"use client\";\n\nimport {\n type CheckboxState,\n type CheckboxStyle,\n checkboxStyle,\n checkboxStyleContext,\n} from \"@/components/remocn/checkbox\";\nimport {\n easings,\n mixOklch,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\n\nexport const DEFAULT_DURATION = 10;\n\nexport function tweenCheckboxStyle(\n a: CheckboxStyle,\n b: CheckboxStyle,\n t: number,\n): CheckboxStyle {\n return {\n boxBackground: mixOklch(a.boxBackground, b.boxBackground, t),\n boxBorderColor: mixOklch(a.boxBorderColor, b.boxBorderColor, t),\n checkOpacity: a.checkOpacity + (b.checkOpacity - a.checkOpacity) * t,\n checkScale: a.checkScale + (b.checkScale - a.checkScale) * t,\n checkDraw: a.checkDraw + (b.checkDraw - a.checkDraw) * t,\n };\n}\n\nexport interface CheckboxTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n primary?: string;\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useCheckboxTransition(\n steps: Step<CheckboxState>[],\n opts: CheckboxTransitionOptions = {},\n): CheckboxStyle {\n const {\n theme: themeOverride,\n mode,\n primary,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(\n { ...themeOverride, ...(primary ? { primary } : {}) },\n mode,\n );\n const ctx = checkboxStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"unchecked\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenCheckboxStyle(\n checkboxStyle(from, ctx),\n checkboxStyle(to, ctx),\n t,\n );\n}\n","type": "registry:component","target": "components/remocn/use-checkbox-transition.ts"}diff --git a/public/r/checkout-flow.json b/public/r/checkout-flow.jsonindex f6a5c1a3..b6622c36 100644--- a/public/r/checkout-flow.json+++ b/public/r/checkout-flow.json@@ -18,7 +18,7 @@"files": [{"path": "registry/remocn-ui/checkout-flow/index.tsx",- "content": "\"use client\";\n\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\nimport { Cursor } from \"@/components/remocn/cursor\";\nimport { useCursorPath } from \"@/components/remocn/use-cursor-path\";\nimport { Input } from \"@/components/remocn/input\";\nimport { useInputTransition } from \"@/components/remocn/use-input-transition\";\nimport { Button } from \"@/components/remocn/button\";\nimport { useButtonTransition } from \"@/components/remocn/use-button-transition\";\nimport { Checkbox } from \"@/components/remocn/checkbox\";\nimport { useCheckboxTransition } from \"@/components/remocn/use-checkbox-transition\";\nimport {\n ToggleGroup,\n type ToggleGroupItem,\n} from \"@/components/remocn/toggle-group\";\nimport { useToggleGroupTransition } from \"@/components/remocn/use-toggle-group-transition\";\nimport { Toast } from \"@/components/remocn/toast\";\nimport { useToastTransition } from \"@/components/remocn/use-toast-transition\";\nimport { BlurIn } from \"@/components/remocn/blur-in\";\nimport { useBlurInTransition } from \"@/components/remocn/use-blur-in-transition\";\nimport {\n Field,\n FieldControl,\n FieldGroup,\n FieldLabel,\n} from \"@/components/remocn/field\";\n\nconst DEFAULT_PLANS: ToggleGroupItem[] = [\n { value: \"monthly\", label: \"Monthly\" },\n { value: \"yearly\", label: \"Yearly\" },\n];\n\nconst STAGE_W = 1280;\nconst CARD_W = 420;\nconst CARD_PAD = 28;\nconst CARD_TOP = 96;\nconst CARD_LEFT = (STAGE_W - CARD_W) / 2;\nconst CENTER_X = STAGE_W / 2;\nconst CONTENT_LEFT = CARD_LEFT + CARD_PAD;\nconst CONTENT_RIGHT = CARD_LEFT + CARD_W - CARD_PAD;\n\nconst TOGGLE_Y = 222;\nconst YEARLY_X = CONTENT_LEFT + 4 + 88 + 44;\nconst CARD_X = CENTER_X;\nconst CARD_Y = 312;\nconst TERMS_X = CONTENT_LEFT + 12;\nconst TERMS_Y = 376;\nconst PAY_X = CONTENT_RIGHT - 48;\nconst PAY_Y = 442;\n\nexport interface CheckoutFlowProps {\n title?: string;\n description?: string;\n plans?: ToggleGroupItem[];\n cardLabel?: string;\n cardPlaceholder?: string;\n termsLabel?: string;\n payLabel?: string;\n toastTitle?: string;\n theme?: Partial<RemocnTheme>;\n}\n\nexport function CheckoutFlow({\n title = \"Upgrade your plan\",\n description = \"Complete your purchase to unlock every feature.\",\n plans = DEFAULT_PLANS,\n cardLabel = \"Card number\",\n cardPlaceholder = \"4242 4242 4242 4242\",\n termsLabel = \"I accept the terms and conditions\",\n payLabel = \"Pay $49\",\n toastTitle = \"Payment successful\",\n theme,\n}: CheckoutFlowProps) {\n const resolved = useRemocnTheme(theme);\n const opts = { theme };\n\n const cardEnter = useBlurInTransition(\n [{ at: 0, state: \"revealed\", duration: 18 }],\n { distance: 0 },\n );\n const enterHeader = useBlurInTransition([\n { at: 18, state: \"revealed\", duration: 16 },\n ]);\n const enterToggle = useBlurInTransition([\n { at: 24, state: \"revealed\", duration: 16 },\n ]);\n const enterCard = useBlurInTransition([\n { at: 30, state: \"revealed\", duration: 16 },\n ]);\n const enterTerms = useBlurInTransition([\n { at: 36, state: \"revealed\", duration: 16 },\n ]);\n const enterButton = useBlurInTransition([\n { at: 42, state: \"revealed\", duration: 16 },\n ]);\n\n const cursorStyle = useCursorPath([\n { at: 0, x: 140, y: 90 },\n { at: 64, x: YEARLY_X, y: TOGGLE_Y, duration: 22, click: true },\n { at: 96, x: CARD_X, y: CARD_Y, duration: 24, click: true },\n { at: 150, x: TERMS_X, y: TERMS_Y, duration: 30, click: true },\n { at: 180, x: PAY_X, y: PAY_Y, duration: 26, click: true },\n ]);\n\n const toggleStyle = useToggleGroupTransition(\n [{ at: 64, state: plans[1]?.value ?? \"yearly\", duration: 16 }],\n { items: plans, ...opts },\n );\n\n const cardStyle = useInputTransition(\n [\n { at: 96, state: \"active\", duration: 6 },\n { at: 100, state: \"typing\", duration: 40 },\n { at: 150, state: \"blur\", duration: 8 },\n ],\n opts,\n );\n\n const checkboxStyle = useCheckboxTransition(\n [{ at: 150, state: \"checked\", duration: 14 }],\n opts,\n );\n\n const payStyle = useButtonTransition(\n [\n { at: 172, state: \"hover\", duration: 8 },\n { at: 180, state: \"press\", duration: 6 },\n { at: 186, state: \"loading\", duration: 6 },\n { at: 224, state: \"success\", duration: 16 },\n ],\n opts,\n );\n\n const toastStyle = useToastTransition(\n [\n { at: 224, state: \"visible\", duration: 14 },\n { at: 286, state: \"hidden\", duration: 14 },\n ],\n {},\n );\n\n return (\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: CARD_LEFT,\n top: CARD_TOP,\n width: CARD_W,\n height: 420,\n boxSizing: \"border-box\",\n padding: 28,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 24,\n background: resolved.background,\n border: `1px solid ${resolved.border}`,\n borderRadius: 14,\n boxShadow:\n \"0 10px 30px -12px rgba(0,0,0,0.22), 0 2px 8px -3px rgba(0,0,0,0.10)\",\n opacity: cardEnter.opacity,\n filter: cardEnter.blur > 0 ? `blur(${cardEnter.blur}px)` : \"none\",\n }}\n >\n <BlurIn display=\"block\" style={enterHeader}>\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 4 }}>\n <div\n style={{\n fontSize: 22,\n lineHeight: \"28px\",\n fontWeight: 600,\n letterSpacing: \"-0.02em\",\n color: resolved.cardForeground,\n }}\n >\n {title}\n </div>\n <div\n style={{\n fontSize: 14,\n lineHeight: \"20px\",\n color: resolved.mutedForeground,\n }}\n >\n {description}\n </div>\n </div>\n </BlurIn>\n\n <BlurIn display=\"block\" style={enterToggle}>\n <FieldControl height={44}>\n <ToggleGroup\n style={toggleStyle}\n items={plans}\n align=\"start\"\n theme={theme}\n />\n </FieldControl>\n </BlurIn>\n\n <FieldGroup gap={24}>\n <BlurIn display=\"block\" style={enterCard}>\n <Field>\n <FieldLabel theme={theme}>\n {cardLabel}\n </FieldLabel>\n <FieldControl>\n <Input\n placeholder={cardPlaceholder}\n value={cardPlaceholder}\n style={cardStyle}\n fullWidth\n theme={theme}\n />\n </FieldControl>\n </Field>\n </BlurIn>\n\n <BlurIn display=\"block\" style={enterTerms}>\n <FieldControl>\n <Checkbox\n label={termsLabel}\n style={checkboxStyle}\n align=\"start\"\n theme={theme}\n />\n </FieldControl>\n </BlurIn>\n </FieldGroup>\n\n <BlurIn display=\"block\" style={enterButton}>\n <Field gap={10}>\n <FieldControl height={44}>\n <Button\n label={payLabel}\n style={payStyle}\n align=\"end\"\n theme={theme}\n />\n </FieldControl>\n </Field>\n </BlurIn>\n </div>\n\n <div style={{ position: \"absolute\", right: 32, bottom: 32 }}>\n <Toast\n title={toastTitle}\n variant=\"success\"\n style={toastStyle}\n theme={theme}\n />\n </div>\n\n <Cursor style={cursorStyle} variant=\"pointer\" theme={theme} />\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport { BlurIn } from \"@/components/remocn/blur-in\";\nimport { Button } from \"@/components/remocn/button\";\nimport { Checkbox } from \"@/components/remocn/checkbox\";\nimport { Cursor } from \"@/components/remocn/cursor\";\nimport {\n Field,\n FieldControl,\n FieldGroup,\n FieldLabel,\n} from \"@/components/remocn/field\";\nimport { Input } from \"@/components/remocn/input\";\nimport { Toast } from \"@/components/remocn/toast\";\nimport {\n ToggleGroup,\n type ToggleGroupItem,\n} from \"@/components/remocn/toggle-group\";\nimport { useBlurInTransition } from \"@/components/remocn/use-blur-in-transition\";\nimport { useButtonTransition } from \"@/components/remocn/use-button-transition\";\nimport { useCheckboxTransition } from \"@/components/remocn/use-checkbox-transition\";\nimport { useCursorPath } from \"@/components/remocn/use-cursor-path\";\nimport { useInputTransition } from \"@/components/remocn/use-input-transition\";\nimport { useToastTransition } from \"@/components/remocn/use-toast-transition\";\nimport { useToggleGroupTransition } from \"@/components/remocn/use-toggle-group-transition\";\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nconst DEFAULT_PLANS: ToggleGroupItem[] = [\n { value: \"monthly\", label: \"Monthly\" },\n { value: \"yearly\", label: \"Yearly\" },\n];\n\nconst STAGE_W = 1280;\nconst CARD_W = 420;\nconst CARD_PAD = 28;\nconst CARD_TOP = 96;\nconst CARD_LEFT = (STAGE_W - CARD_W) / 2;\nconst CENTER_X = STAGE_W / 2;\nconst CONTENT_LEFT = CARD_LEFT + CARD_PAD;\nconst CONTENT_RIGHT = CARD_LEFT + CARD_W - CARD_PAD;\n\nconst TOGGLE_Y = 222;\nconst YEARLY_X = CONTENT_LEFT + 4 + 88 + 44;\nconst CARD_X = CENTER_X;\nconst CARD_Y = 312;\nconst TERMS_X = CONTENT_LEFT + 12;\nconst TERMS_Y = 376;\nconst PAY_X = CONTENT_RIGHT - 48;\nconst PAY_Y = 442;\n\nexport interface CheckoutFlowProps {\n title?: string;\n description?: string;\n plans?: ToggleGroupItem[];\n cardLabel?: string;\n cardPlaceholder?: string;\n termsLabel?: string;\n payLabel?: string;\n toastTitle?: string;\n theme?: Partial<RemocnTheme>;\n}\n\nexport function CheckoutFlow({\n title = \"Upgrade your plan\",\n description = \"Complete your purchase to unlock every feature.\",\n plans = DEFAULT_PLANS,\n cardLabel = \"Card number\",\n cardPlaceholder = \"4242 4242 4242 4242\",\n termsLabel = \"I accept the terms and conditions\",\n payLabel = \"Pay $49\",\n toastTitle = \"Payment successful\",\n theme,\n}: CheckoutFlowProps) {\n const resolved = useRemocnTheme(theme);\n const opts = { theme };\n\n const cardEnter = useBlurInTransition(\n [{ at: 0, state: \"revealed\", duration: 18 }],\n { distance: 0 },\n );\n const enterHeader = useBlurInTransition([\n { at: 18, state: \"revealed\", duration: 16 },\n ]);\n const enterToggle = useBlurInTransition([\n { at: 24, state: \"revealed\", duration: 16 },\n ]);\n const enterCard = useBlurInTransition([\n { at: 30, state: \"revealed\", duration: 16 },\n ]);\n const enterTerms = useBlurInTransition([\n { at: 36, state: \"revealed\", duration: 16 },\n ]);\n const enterButton = useBlurInTransition([\n { at: 42, state: \"revealed\", duration: 16 },\n ]);\n\n const cursorStyle = useCursorPath([\n { at: 0, x: 140, y: 90 },\n { at: 64, x: YEARLY_X, y: TOGGLE_Y, duration: 22, click: true },\n { at: 96, x: CARD_X, y: CARD_Y, duration: 24, click: true },\n { at: 150, x: TERMS_X, y: TERMS_Y, duration: 30, click: true },\n { at: 180, x: PAY_X, y: PAY_Y, duration: 26, click: true },\n ]);\n\n const toggleStyle = useToggleGroupTransition(\n [{ at: 64, state: plans[1]?.value ?? \"yearly\", duration: 16 }],\n { items: plans, ...opts },\n );\n\n const cardStyle = useInputTransition(\n [\n { at: 96, state: \"active\", duration: 6 },\n { at: 100, state: \"typing\", duration: 40 },\n { at: 150, state: \"blur\", duration: 8 },\n ],\n opts,\n );\n\n const checkboxStyle = useCheckboxTransition(\n [{ at: 150, state: \"checked\", duration: 14 }],\n opts,\n );\n\n const payStyle = useButtonTransition(\n [\n { at: 172, state: \"hover\", duration: 8 },\n { at: 180, state: \"press\", duration: 6 },\n { at: 186, state: \"loading\", duration: 6 },\n { at: 224, state: \"success\", duration: 16 },\n ],\n opts,\n );\n\n const toastStyle = useToastTransition(\n [\n { at: 224, state: \"visible\", duration: 14 },\n { at: 286, state: \"hidden\", duration: 14 },\n ],\n {},\n );\n\n return (\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: CARD_LEFT,\n top: CARD_TOP,\n width: CARD_W,\n height: 420,\n boxSizing: \"border-box\",\n padding: 28,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 24,\n background: resolved.background,\n border: `1px solid ${resolved.border}`,\n borderRadius: 14,\n boxShadow:\n \"0 10px 30px -12px rgba(0,0,0,0.22), 0 2px 8px -3px rgba(0,0,0,0.10)\",\n opacity: cardEnter.opacity,\n filter: cardEnter.blur > 0 ? `blur(${cardEnter.blur}px)` : \"none\",\n }}\n >\n <BlurIn display=\"block\" style={enterHeader}>\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 4 }}>\n <div\n style={{\n fontSize: 22,\n lineHeight: \"28px\",\n fontWeight: 600,\n letterSpacing: \"-0.02em\",\n color: resolved.cardForeground,\n }}\n >\n {title}\n </div>\n <div\n style={{\n fontSize: 14,\n lineHeight: \"20px\",\n color: resolved.mutedForeground,\n }}\n >\n {description}\n </div>\n </div>\n </BlurIn>\n\n <BlurIn display=\"block\" style={enterToggle}>\n <FieldControl height={44}>\n <ToggleGroup\n style={toggleStyle}\n items={plans}\n align=\"start\"\n theme={theme}\n />\n </FieldControl>\n </BlurIn>\n\n <FieldGroup gap={24}>\n <BlurIn display=\"block\" style={enterCard}>\n <Field>\n <FieldLabel theme={theme}>{cardLabel}</FieldLabel>\n <FieldControl>\n <Input\n placeholder={cardPlaceholder}\n value={cardPlaceholder}\n style={cardStyle}\n fullWidth\n theme={theme}\n />\n </FieldControl>\n </Field>\n </BlurIn>\n\n <BlurIn display=\"block\" style={enterTerms}>\n <FieldControl>\n <Checkbox\n label={termsLabel}\n style={checkboxStyle}\n align=\"start\"\n theme={theme}\n />\n </FieldControl>\n </BlurIn>\n </FieldGroup>\n\n <BlurIn display=\"block\" style={enterButton}>\n <Field gap={10}>\n <FieldControl height={44}>\n <Button\n label={payLabel}\n style={payStyle}\n align=\"end\"\n theme={theme}\n />\n </FieldControl>\n </Field>\n </BlurIn>\n </div>\n\n <div style={{ position: \"absolute\", right: 32, bottom: 32 }}>\n <Toast\n title={toastTitle}\n variant=\"success\"\n style={toastStyle}\n theme={theme}\n />\n </div>\n\n <Cursor style={cursorStyle} variant=\"pointer\" theme={theme} />\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/checkout-flow.tsx"}diff --git a/public/r/claude-chat.json b/public/r/claude-chat.jsonindex db5703ba..ab1113de 100644--- a/public/r/claude-chat.json+++ b/public/r/claude-chat.json@@ -8,7 +8,7 @@"files": [{"path": "registry/remocn/claude-chat/index.tsx",- "content": "\"use client\";\n\nimport { loadFont as loadHeadingFont } from \"@remotion/google-fonts/Fraunces\";\nimport { loadFont as loadBodyFont } from \"@remotion/google-fonts/Inter\";\nimport {\n AbsoluteFill,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Caret } from \"@/components/remocn/caret\";\nimport { useTypewriter } from \"@/lib/remocn-ui\";\n\nconst { fontFamily: SANS_FAMILY } = loadBodyFont();\n\nexport interface ClaudeChatProps {\n greeting?: string;\n placeholder?: string;\n prompt?: string;\n modelName?: string;\n modelTier?: string;\n accentColor?: string;\n speed?: number;\n}\n\ninterface Theme {\n page: string;\n cardBg: string;\n cardBorder: string;\n fg: string;\n fgMuted: string;\n placeholder: string;\n iconBtnBorder: string;\n}\n\nexport const THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n page: \"#F5F4EF\",\n cardBg: \"#FFFFFF\",\n cardBorder: \"#E8E5DD\",\n fg: \"#1F1E1D\",\n fgMuted: \"#73726C\",\n placeholder: \"#A3A097\",\n iconBtnBorder: \"#E0DDD4\",\n },\n dark: {\n page: \"#262624\",\n cardBg: \"#1F1E1D\",\n cardBorder: \"#3A3936\",\n fg: \"#F0EEE6\",\n fgMuted: \"#9B9892\",\n placeholder: \"#73726C\",\n iconBtnBorder: \"#3A3936\",\n },\n};\n\nexport const TYPING_START_FRAME = 42;\n\nexport const TYPING_CPS = 22;\n\nexport function morphProgressAt(\n frame: number,\n opts: { startFrame?: number; fps: number; speed: number },\n): number {\n const startFrame = opts.startFrame ?? TYPING_START_FRAME;\n const value = spring({\n fps: opts.fps,\n frame: frame * opts.speed - startFrame,\n config: { damping: 14, stiffness: 200, mass: 0.6 },\n });\n return Math.max(0, Math.min(value, 1));\n}\n\nexport function introBounceIn(\n frame: number,\n fps: number,\n): { translateY: number; scale: number } {\n const s = spring({\n fps,\n frame,\n config: { damping: 14, stiffness: 110, mass: 0.7 },\n });\n const translateY = interpolate(s, [0, 1], [28, 0]);\n const scale = interpolate(s, [0, 1], [0.97, 1]);\n return { translateY, scale };\n}\n\nexport function fadeUpAt(\n frame: number,\n range: [number, number],\n): { opacity: number; translateY: number } {\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n return {\n opacity: interpolate(frame, range, [0, 1], opts),\n translateY: interpolate(frame, range, [12, 0], opts),\n };\n}\n\nfunction ChevronDown({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Expand</title>\n <path\n d=\"M6 9l6 6 6-6\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction PlusIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Add</title>\n <path\n d=\"M12 5v14M5 12h14\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n />\n </svg>\n );\n}\n\nfunction MicIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Voice input</title>\n <rect\n x={9}\n y={3}\n width={6}\n height={11}\n rx={3}\n stroke={color}\n strokeWidth={1.8}\n />\n <path\n d=\"M5.5 11a6.5 6.5 0 0013 0M12 17.5V21M9 21h6\"\n stroke={color}\n strokeWidth={1.8}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction WaveformIcon({ size, color }: { size: number; color: string }) {\n const bars = [\n { x: 4, h: 8 },\n { x: 9, h: 16 },\n { x: 14, h: 12 },\n { x: 19, h: 20 },\n ];\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Voice</title>\n {bars.map((bar) => (\n <rect\n key={bar.x}\n x={bar.x - 1}\n y={(24 - bar.h) / 2}\n width={2.4}\n height={bar.h}\n rx={1.2}\n fill={color}\n />\n ))}\n </svg>\n );\n}\n\nfunction SendIcon({ size }: { size: number }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Send</title>\n <path\n d=\"M12 19V5M12 5l-6 6M12 5l6 6\"\n stroke=\"#FFFFFF\"\n strokeWidth={2.2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction IconButton({\n size,\n border,\n children,\n}: {\n size: number;\n border: string;\n children: React.ReactNode;\n}) {\n return (\n <div\n style={{\n width: size,\n height: size,\n borderRadius: \"100%\",\n border: `1px solid ${border}`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n flexShrink: 0,\n }}\n >\n {children}\n </div>\n );\n}\n\nexport function ClaudeChat({\n placeholder = \"Try: draft an email · summarize a doc · plan your week\",\n prompt = \"Draft a launch tweet for our new release\",\n modelName = \"Opus 4.8\",\n modelTier = \"Max\",\n accentColor = \"#D97757\",\n speed = 1,\n}: ClaudeChatProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = THEMES.light;\n\n const refW = 1280;\n const refH = 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const tw = useTypewriter(prompt, {\n cps: TYPING_CPS,\n speed,\n startFrame: TYPING_START_FRAME,\n });\n const visibleText = tw.text;\n const showText = tw.count > 0;\n const morph = morphProgressAt(frame, { fps, speed });\n\n const intro = introBounceIn(frame * speed, fps);\n const cardFade = fadeUpAt(frame * speed, [6, 22]);\n\n const cardWidth = 860;\n const cardLeft = (refW - cardWidth) / 2;\n const iconBtnSize = 36;\n const morphSize = 40;\n\n return (\n <AbsoluteFill style={{ background: \"transparent\" }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n transform: `translate(-50%, -50%) scale(${stageScale})`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: cardLeft,\n top: 300,\n width: cardWidth,\n background: t.cardBg,\n border: `1px solid ${t.cardBorder}`,\n borderRadius: 24,\n boxShadow: \"0 8px 30px -12px rgba(31,30,29,0.12)\",\n opacity: cardFade.opacity,\n transform: `translateY(${cardFade.translateY + intro.translateY}px) scale(${intro.scale})`,\n transformOrigin: \"center top\",\n }}\n >\n <div\n style={{\n padding: \"26px 28px\",\n minHeight: 58,\n fontFamily: SANS_FAMILY,\n fontSize: 21,\n lineHeight: 1.3,\n display: \"flex\",\n alignItems: \"center\",\n }}\n >\n {showText ? (\n <span style={{ color: t.fg }}>\n {visibleText}\n <Caret\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n height={24}\n radius={0}\n marginLeft={1}\n style={{\n verticalAlign: \"text-bottom\",\n transform: \"translateY(3px)\",\n }}\n />\n </span>\n ) : (\n <span\n style={{\n color: t.placeholder,\n display: \"inline-flex\",\n alignItems: \"center\",\n }}\n >\n <Caret\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n height={24}\n radius={0}\n marginLeft={1}\n style={{\n verticalAlign: \"text-bottom\",\n transform: \"translateY(3px)\",\n }}\n />\n <span style={{ marginLeft: 2 }}>{placeholder}</span>\n </span>\n )}\n </div>\n\n <div\n style={{\n padding: \"14px 18px\",\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n }}\n >\n <IconButton size={iconBtnSize} border={t.iconBtnBorder}>\n <PlusIcon size={20} color={t.fg} />\n </IconButton>\n\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 14,\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 7,\n }}\n >\n <span\n style={{\n fontFamily: SANS_FAMILY,\n fontSize: 18,\n fontWeight: 500,\n color: t.fg,\n }}\n >\n {modelName}\n </span>\n <span\n style={{\n fontFamily: SANS_FAMILY,\n fontSize: 18,\n fontWeight: 400,\n color: t.fgMuted,\n }}\n >\n {modelTier}\n </span>\n <ChevronDown size={16} color={t.fgMuted} />\n </div>\n\n <IconButton size={iconBtnSize} border={t.iconBtnBorder}>\n <MicIcon size={20} color={t.fg} />\n </IconButton>\n\n <div\n style={{\n position: \"relative\",\n width: morphSize,\n height: morphSize,\n flexShrink: 0,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: \"100%\",\n border: `1px solid ${t.iconBtnBorder}`,\n opacity: 1 - morph,\n transform: `scale(${1 - 0.1 * morph})`,\n }}\n >\n <WaveformIcon size={22} color={t.fg} />\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: 10,\n background: accentColor,\n opacity: morph,\n transform: `scale(${0.8 + 0.2 * morph})`,\n }}\n >\n <SendIcon size={22} />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n",+ "content": "\"use client\";\n\nimport { loadFont as loadBodyFont } from \"@remotion/google-fonts/Inter\";\nimport {\n AbsoluteFill,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Caret } from \"@/components/remocn/caret\";\nimport { useTypewriter } from \"@/lib/remocn-ui\";\n\nconst { fontFamily: SANS_FAMILY } = loadBodyFont();\n\nexport interface ClaudeChatProps {\n greeting?: string;\n placeholder?: string;\n prompt?: string;\n modelName?: string;\n modelTier?: string;\n accentColor?: string;\n speed?: number;\n}\n\ninterface Theme {\n page: string;\n cardBg: string;\n cardBorder: string;\n fg: string;\n fgMuted: string;\n placeholder: string;\n iconBtnBorder: string;\n}\n\nexport const THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n page: \"#F5F4EF\",\n cardBg: \"#FFFFFF\",\n cardBorder: \"#E8E5DD\",\n fg: \"#1F1E1D\",\n fgMuted: \"#73726C\",\n placeholder: \"#A3A097\",\n iconBtnBorder: \"#E0DDD4\",\n },\n dark: {\n page: \"#262624\",\n cardBg: \"#1F1E1D\",\n cardBorder: \"#3A3936\",\n fg: \"#F0EEE6\",\n fgMuted: \"#9B9892\",\n placeholder: \"#73726C\",\n iconBtnBorder: \"#3A3936\",\n },\n};\n\nexport const TYPING_START_FRAME = 42;\n\nexport const TYPING_CPS = 22;\n\nexport function morphProgressAt(\n frame: number,\n opts: { startFrame?: number; fps: number; speed: number },\n): number {\n const startFrame = opts.startFrame ?? TYPING_START_FRAME;\n const value = spring({\n fps: opts.fps,\n frame: frame * opts.speed - startFrame,\n config: { damping: 14, stiffness: 200, mass: 0.6 },\n });\n return Math.max(0, Math.min(value, 1));\n}\n\nexport function introBounceIn(\n frame: number,\n fps: number,\n): { translateY: number; scale: number } {\n const s = spring({\n fps,\n frame,\n config: { damping: 14, stiffness: 110, mass: 0.7 },\n });\n const translateY = interpolate(s, [0, 1], [28, 0]);\n const scale = interpolate(s, [0, 1], [0.97, 1]);\n return { translateY, scale };\n}\n\nexport function fadeUpAt(\n frame: number,\n range: [number, number],\n): { opacity: number; translateY: number } {\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n return {\n opacity: interpolate(frame, range, [0, 1], opts),\n translateY: interpolate(frame, range, [12, 0], opts),\n };\n}\n\nfunction ChevronDown({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Expand</title>\n <path\n d=\"M6 9l6 6 6-6\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction PlusIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Add</title>\n <path\n d=\"M12 5v14M5 12h14\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n />\n </svg>\n );\n}\n\nfunction MicIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Voice input</title>\n <rect\n x={9}\n y={3}\n width={6}\n height={11}\n rx={3}\n stroke={color}\n strokeWidth={1.8}\n />\n <path\n d=\"M5.5 11a6.5 6.5 0 0013 0M12 17.5V21M9 21h6\"\n stroke={color}\n strokeWidth={1.8}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction WaveformIcon({ size, color }: { size: number; color: string }) {\n const bars = [\n { x: 4, h: 8 },\n { x: 9, h: 16 },\n { x: 14, h: 12 },\n { x: 19, h: 20 },\n ];\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Voice</title>\n {bars.map((bar) => (\n <rect\n key={bar.x}\n x={bar.x - 1}\n y={(24 - bar.h) / 2}\n width={2.4}\n height={bar.h}\n rx={1.2}\n fill={color}\n />\n ))}\n </svg>\n );\n}\n\nfunction SendIcon({ size }: { size: number }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Send</title>\n <path\n d=\"M12 19V5M12 5l-6 6M12 5l6 6\"\n stroke=\"#FFFFFF\"\n strokeWidth={2.2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction IconButton({\n size,\n border,\n children,\n}: {\n size: number;\n border: string;\n children: React.ReactNode;\n}) {\n return (\n <div\n style={{\n width: size,\n height: size,\n borderRadius: \"100%\",\n border: `1px solid ${border}`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n flexShrink: 0,\n }}\n >\n {children}\n </div>\n );\n}\n\nexport function ClaudeChat({\n placeholder = \"Try: draft an email · summarize a doc · plan your week\",\n prompt = \"Draft a launch tweet for our new release\",\n modelName = \"Opus 4.8\",\n modelTier = \"Max\",\n accentColor = \"#D97757\",\n speed = 1,\n}: ClaudeChatProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = THEMES.light;\n\n const refW = 1280;\n const refH = 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const tw = useTypewriter(prompt, {\n cps: TYPING_CPS,\n speed,\n startFrame: TYPING_START_FRAME,\n });\n const visibleText = tw.text;\n const showText = tw.count > 0;\n const morph = morphProgressAt(frame, { fps, speed });\n\n const intro = introBounceIn(frame * speed, fps);\n const cardFade = fadeUpAt(frame * speed, [6, 22]);\n\n const cardWidth = 860;\n const cardLeft = (refW - cardWidth) / 2;\n const iconBtnSize = 36;\n const morphSize = 40;\n\n return (\n <AbsoluteFill style={{ background: \"transparent\" }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n transform: `translate(-50%, -50%) scale(${stageScale})`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: cardLeft,\n top: 300,\n width: cardWidth,\n background: t.cardBg,\n border: `1px solid ${t.cardBorder}`,\n borderRadius: 24,\n boxShadow: \"0 8px 30px -12px rgba(31,30,29,0.12)\",\n opacity: cardFade.opacity,\n transform: `translateY(${cardFade.translateY + intro.translateY}px) scale(${intro.scale})`,\n transformOrigin: \"center top\",\n }}\n >\n <div\n style={{\n padding: \"26px 28px\",\n minHeight: 58,\n fontFamily: SANS_FAMILY,\n fontSize: 21,\n lineHeight: 1.3,\n display: \"flex\",\n alignItems: \"center\",\n }}\n >\n {showText ? (\n <span style={{ color: t.fg }}>\n {visibleText}\n <Caret\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n height={24}\n radius={0}\n marginLeft={1}\n style={{\n verticalAlign: \"text-bottom\",\n transform: \"translateY(3px)\",\n }}\n />\n </span>\n ) : (\n <span\n style={{\n color: t.placeholder,\n display: \"inline-flex\",\n alignItems: \"center\",\n }}\n >\n <Caret\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n height={24}\n radius={0}\n marginLeft={1}\n style={{\n verticalAlign: \"text-bottom\",\n transform: \"translateY(3px)\",\n }}\n />\n <span style={{ marginLeft: 2 }}>{placeholder}</span>\n </span>\n )}\n </div>\n\n <div\n style={{\n padding: \"14px 18px\",\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n }}\n >\n <IconButton size={iconBtnSize} border={t.iconBtnBorder}>\n <PlusIcon size={20} color={t.fg} />\n </IconButton>\n\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 14,\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 7,\n }}\n >\n <span\n style={{\n fontFamily: SANS_FAMILY,\n fontSize: 18,\n fontWeight: 500,\n color: t.fg,\n }}\n >\n {modelName}\n </span>\n <span\n style={{\n fontFamily: SANS_FAMILY,\n fontSize: 18,\n fontWeight: 400,\n color: t.fgMuted,\n }}\n >\n {modelTier}\n </span>\n <ChevronDown size={16} color={t.fgMuted} />\n </div>\n\n <IconButton size={iconBtnSize} border={t.iconBtnBorder}>\n <MicIcon size={20} color={t.fg} />\n </IconButton>\n\n <div\n style={{\n position: \"relative\",\n width: morphSize,\n height: morphSize,\n flexShrink: 0,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: \"100%\",\n border: `1px solid ${t.iconBtnBorder}`,\n opacity: 1 - morph,\n transform: `scale(${1 - 0.1 * morph})`,\n }}\n >\n <WaveformIcon size={22} color={t.fg} />\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: 10,\n background: accentColor,\n opacity: morph,\n transform: `scale(${0.8 + 0.2 * morph})`,\n }}\n >\n <SendIcon size={22} />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n","type": "registry:component","target": "components/remocn/claude-chat.tsx"}diff --git a/public/r/combobox.json b/public/r/combobox.jsonindex be5a7563..0421113a 100644--- a/public/r/combobox.json+++ b/public/r/combobox.json@@ -12,13 +12,13 @@"files": [{"path": "registry/remocn-ui/combobox/index.tsx",- "content": "\"use client\";\n\nimport { type RemocnTheme, revealedText, useRemocnTheme } from \"@/lib/remocn-ui\";\nimport {\n inputStyle,\n inputStyleContext,\n type InputStyle,\n type InputStyleContext,\n} from \"@/components/remocn/input\";\nimport {\n SelectItemRow,\n selectItemStyle,\n selectItemStyleContext,\n type SelectItemState,\n type SelectItemStyle,\n type SelectItemStyleContext,\n} from \"@/components/remocn/select-item\";\n\nexport type ComboboxState = \"opened\" | \"closed\";\n\nexport interface ComboboxProps {\n state?: ComboboxState;\n style?: ComboboxStyle;\n query?: string;\n revealCount?: number;\n placeholder?: string;\n items?: string[];\n selectedIndex?: number;\n highlightedIndex?: number;\n pressedIndex?: number;\n itemStyles?: (SelectItemStyle | undefined)[];\n inputStyle?: InputStyle;\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nconst WIDTH = 280;\n\nexport function filterComboboxItems(\n items: string[],\n query: string,\n revealCount?: number,\n): string[] {\n const visible = (\n revealCount === undefined ? query : revealedText(query, revealCount)\n )\n .trim()\n .toLowerCase();\n if (visible === \"\") return items;\n return items.filter((item) => item.toLowerCase().includes(visible));\n}\n\nexport interface ComboboxStyle {\n panelOpacity: number;\n panelScale: number;\n panelTranslateY: number;\n}\n\nexport interface ComboboxStyleContext {\n triggerCtx: InputStyleContext;\n panelBg: string;\n panelBorder: string;\n mutedFg: string;\n radius: number;\n itemCtx: SelectItemStyleContext;\n}\n\nexport function comboboxStyleContext(theme: RemocnTheme): ComboboxStyleContext {\n return {\n triggerCtx: inputStyleContext(theme),\n panelBg: theme.popover,\n panelBorder: theme.border,\n mutedFg: theme.mutedForeground,\n radius: theme.radius,\n itemCtx: selectItemStyleContext(theme),\n };\n}\n\nexport function comboboxStyle(\n state: ComboboxState,\n _ctx: ComboboxStyleContext,\n): ComboboxStyle {\n switch (state) {\n case \"opened\":\n return { panelOpacity: 1, panelScale: 1, panelTranslateY: 0 };\n default:\n return { panelOpacity: 0, panelScale: 0.96, panelTranslateY: -4 };\n }\n}\n\nfunction rowState(\n i: number,\n selectedIndex: number,\n highlightedIndex: number,\n pressedIndex: number,\n): SelectItemState {\n if (i === pressedIndex) return \"press\";\n if (i === selectedIndex) return \"selected\";\n if (i === highlightedIndex) return \"hover\";\n return \"idle\";\n}\n\nexport function Combobox({\n state = \"closed\",\n style,\n query = \"\",\n revealCount,\n placeholder = \"Select a fruit…\",\n items = [\"Apple\", \"Banana\", \"Orange\", \"Grape\"],\n selectedIndex = -1,\n highlightedIndex = -1,\n pressedIndex = -1,\n itemStyles,\n inputStyle: inputStyleOverride,\n theme: themeOverride,\n className,\n}: ComboboxProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const ctx = comboboxStyleContext(theme);\n const v = style ?? comboboxStyle(state, ctx);\n\n const visibleQuery =\n revealCount === undefined ? query : revealedText(query, revealCount);\n const filtered = filterComboboxItems(items, query, revealCount);\n\n const trigger: InputStyle =\n inputStyleOverride ??\n inputStyle(visibleQuery ? \"typing\" : \"idle\", ctx.triggerCtx);\n\n const valueWidth = visibleQuery.length * 8;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div style={{ position: \"relative\", width: WIDTH }}>\n {}\n <div\n style={{\n position: \"relative\",\n display: \"flex\",\n alignItems: \"center\",\n width: WIDTH,\n boxSizing: \"border-box\",\n height: 40,\n padding: \"0 14px\",\n fontSize: 15,\n letterSpacing: \"-0.01em\",\n background: trigger.background,\n border: `1px solid ${trigger.borderColor}`,\n borderRadius: theme.radius,\n boxShadow: `0 0 0 ${trigger.ringWidth}px ${trigger.ringColor}`,\n }}\n >\n {}\n <span\n style={{\n position: \"absolute\",\n left: 14,\n color: ctx.triggerCtx.mutedForeground,\n opacity: trigger.valueReveal > 0 ? 0 : trigger.placeholderOpacity,\n pointerEvents: \"none\",\n whiteSpace: \"nowrap\",\n }}\n >\n {placeholder}\n </span>\n {}\n <div style={{ display: \"flex\", alignItems: \"center\", minWidth: 0 }}>\n <span\n style={{\n display: \"inline-block\",\n width: valueWidth * trigger.valueReveal,\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n color: ctx.triggerCtx.foreground,\n }}\n >\n {visibleQuery}\n </span>\n <span\n style={{\n flexShrink: 0,\n width: 2,\n height: 17,\n borderRadius: 1,\n background: ctx.triggerCtx.foreground,\n opacity: trigger.caretOpacity,\n }}\n />\n </div>\n </div>\n {}\n <div\n style={{\n position: \"absolute\",\n top: \"calc(100% + 6px)\",\n left: 0,\n width: WIDTH,\n boxSizing: \"border-box\",\n transformOrigin: \"top\",\n transform: `translateY(${v.panelTranslateY}px) scale(${v.panelScale})`,\n opacity: v.panelOpacity,\n background: ctx.panelBg,\n border: `1px solid ${ctx.panelBorder}`,\n borderRadius: ctx.radius,\n padding: 4,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 2,\n boxShadow: \"0 16px 32px -12px rgba(0,0,0,0.25)\",\n }}\n >\n {filtered.length === 0 ? (\n <div\n style={{\n padding: \"12px\",\n textAlign: \"center\",\n fontSize: 14,\n color: ctx.mutedFg,\n }}\n >\n No results found.\n </div>\n ) : (\n filtered.map((item, i) => {\n const override = itemStyles?.[i];\n return (\n <SelectItemRow\n key={item}\n style={\n override ??\n selectItemStyle(\n rowState(i, selectedIndex, highlightedIndex, pressedIndex),\n ctx.itemCtx,\n )\n }\n ctx={ctx.itemCtx}\n label={item}\n width={WIDTH - 8}\n radius={theme.radius}\n check={ctx.itemCtx.check}\n />\n );\n })\n )}\n </div>\n </div>\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport {\n type InputStyle,\n type InputStyleContext,\n inputStyle,\n inputStyleContext,\n} from \"@/components/remocn/input\";\nimport {\n SelectItemRow,\n type SelectItemState,\n type SelectItemStyle,\n type SelectItemStyleContext,\n selectItemStyle,\n selectItemStyleContext,\n} from \"@/components/remocn/select-item\";\nimport {\n type RemocnTheme,\n revealedText,\n useRemocnTheme,\n} from \"@/lib/remocn-ui\";\n\nexport type ComboboxState = \"opened\" | \"closed\";\n\nexport interface ComboboxProps {\n state?: ComboboxState;\n style?: ComboboxStyle;\n query?: string;\n revealCount?: number;\n placeholder?: string;\n items?: string[];\n selectedIndex?: number;\n highlightedIndex?: number;\n pressedIndex?: number;\n itemStyles?: (SelectItemStyle | undefined)[];\n inputStyle?: InputStyle;\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nconst WIDTH = 280;\n\nexport function filterComboboxItems(\n items: string[],\n query: string,\n revealCount?: number,\n): string[] {\n const visible = (\n revealCount === undefined ? query : revealedText(query, revealCount)\n )\n .trim()\n .toLowerCase();\n if (visible === \"\") return items;\n return items.filter((item) => item.toLowerCase().includes(visible));\n}\n\nexport interface ComboboxStyle {\n panelOpacity: number;\n panelScale: number;\n panelTranslateY: number;\n}\n\nexport interface ComboboxStyleContext {\n triggerCtx: InputStyleContext;\n panelBg: string;\n panelBorder: string;\n mutedFg: string;\n radius: number;\n itemCtx: SelectItemStyleContext;\n}\n\nexport function comboboxStyleContext(theme: RemocnTheme): ComboboxStyleContext {\n return {\n triggerCtx: inputStyleContext(theme),\n panelBg: theme.popover,\n panelBorder: theme.border,\n mutedFg: theme.mutedForeground,\n radius: theme.radius,\n itemCtx: selectItemStyleContext(theme),\n };\n}\n\nexport function comboboxStyle(\n state: ComboboxState,\n _ctx: ComboboxStyleContext,\n): ComboboxStyle {\n switch (state) {\n case \"opened\":\n return { panelOpacity: 1, panelScale: 1, panelTranslateY: 0 };\n default:\n return { panelOpacity: 0, panelScale: 0.96, panelTranslateY: -4 };\n }\n}\n\nfunction rowState(\n i: number,\n selectedIndex: number,\n highlightedIndex: number,\n pressedIndex: number,\n): SelectItemState {\n if (i === pressedIndex) return \"press\";\n if (i === selectedIndex) return \"selected\";\n if (i === highlightedIndex) return \"hover\";\n return \"idle\";\n}\n\nexport function Combobox({\n state = \"closed\",\n style,\n query = \"\",\n revealCount,\n placeholder = \"Select a fruit…\",\n items = [\"Apple\", \"Banana\", \"Orange\", \"Grape\"],\n selectedIndex = -1,\n highlightedIndex = -1,\n pressedIndex = -1,\n itemStyles,\n inputStyle: inputStyleOverride,\n theme: themeOverride,\n className,\n}: ComboboxProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const ctx = comboboxStyleContext(theme);\n const v = style ?? comboboxStyle(state, ctx);\n\n const visibleQuery =\n revealCount === undefined ? query : revealedText(query, revealCount);\n const filtered = filterComboboxItems(items, query, revealCount);\n\n const trigger: InputStyle =\n inputStyleOverride ??\n inputStyle(visibleQuery ? \"typing\" : \"idle\", ctx.triggerCtx);\n\n const valueWidth = visibleQuery.length * 8;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div style={{ position: \"relative\", width: WIDTH }}>\n {}\n <div\n style={{\n position: \"relative\",\n display: \"flex\",\n alignItems: \"center\",\n width: WIDTH,\n boxSizing: \"border-box\",\n height: 40,\n padding: \"0 14px\",\n fontSize: 15,\n letterSpacing: \"-0.01em\",\n background: trigger.background,\n border: `1px solid ${trigger.borderColor}`,\n borderRadius: theme.radius,\n boxShadow: `0 0 0 ${trigger.ringWidth}px ${trigger.ringColor}`,\n }}\n >\n {}\n <span\n style={{\n position: \"absolute\",\n left: 14,\n color: ctx.triggerCtx.mutedForeground,\n opacity: trigger.valueReveal > 0 ? 0 : trigger.placeholderOpacity,\n pointerEvents: \"none\",\n whiteSpace: \"nowrap\",\n }}\n >\n {placeholder}\n </span>\n {}\n <div style={{ display: \"flex\", alignItems: \"center\", minWidth: 0 }}>\n <span\n style={{\n display: \"inline-block\",\n width: valueWidth * trigger.valueReveal,\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n color: ctx.triggerCtx.foreground,\n }}\n >\n {visibleQuery}\n </span>\n <span\n style={{\n flexShrink: 0,\n width: 2,\n height: 17,\n borderRadius: 1,\n background: ctx.triggerCtx.foreground,\n opacity: trigger.caretOpacity,\n }}\n />\n </div>\n </div>\n {}\n <div\n style={{\n position: \"absolute\",\n top: \"calc(100% + 6px)\",\n left: 0,\n width: WIDTH,\n boxSizing: \"border-box\",\n transformOrigin: \"top\",\n transform: `translateY(${v.panelTranslateY}px) scale(${v.panelScale})`,\n opacity: v.panelOpacity,\n background: ctx.panelBg,\n border: `1px solid ${ctx.panelBorder}`,\n borderRadius: ctx.radius,\n padding: 4,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 2,\n boxShadow: \"0 16px 32px -12px rgba(0,0,0,0.25)\",\n }}\n >\n {filtered.length === 0 ? (\n <div\n style={{\n padding: \"12px\",\n textAlign: \"center\",\n fontSize: 14,\n color: ctx.mutedFg,\n }}\n >\n No results found.\n </div>\n ) : (\n filtered.map((item, i) => {\n const override = itemStyles?.[i];\n return (\n <SelectItemRow\n key={item}\n style={\n override ??\n selectItemStyle(\n rowState(\n i,\n selectedIndex,\n highlightedIndex,\n pressedIndex,\n ),\n ctx.itemCtx,\n )\n }\n ctx={ctx.itemCtx}\n label={item}\n width={WIDTH - 8}\n radius={theme.radius}\n check={ctx.itemCtx.check}\n />\n );\n })\n )}\n </div>\n </div>\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/combobox.tsx"},{"path": "registry/remocn-ui/combobox/use-combobox-transition.ts",- "content": "\"use client\";\n\nimport {\n easings,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\nimport {\n comboboxStyle,\n comboboxStyleContext,\n type ComboboxState,\n type ComboboxStyle,\n} from \"@/components/remocn/combobox\";\n\nexport const DEFAULT_DURATION = 12;\n\nexport function tweenComboboxStyle(\n a: ComboboxStyle,\n b: ComboboxStyle,\n t: number,\n): ComboboxStyle {\n return {\n panelOpacity: a.panelOpacity + (b.panelOpacity - a.panelOpacity) * t,\n panelScale: a.panelScale + (b.panelScale - a.panelScale) * t,\n panelTranslateY:\n a.panelTranslateY + (b.panelTranslateY - a.panelTranslateY) * t,\n };\n}\n\nexport interface ComboboxTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useComboboxTransition(\n steps: Step<ComboboxState>[],\n opts: ComboboxTransitionOptions = {},\n): ComboboxStyle {\n const {\n theme: themeOverride,\n mode,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = comboboxStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"closed\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenComboboxStyle(\n comboboxStyle(from, ctx),\n comboboxStyle(to, ctx),\n t,\n );\n}\n",+ "content": "\"use client\";\n\nimport {\n type ComboboxState,\n type ComboboxStyle,\n comboboxStyle,\n comboboxStyleContext,\n} from \"@/components/remocn/combobox\";\nimport {\n easings,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\n\nexport const DEFAULT_DURATION = 12;\n\nexport function tweenComboboxStyle(\n a: ComboboxStyle,\n b: ComboboxStyle,\n t: number,\n): ComboboxStyle {\n return {\n panelOpacity: a.panelOpacity + (b.panelOpacity - a.panelOpacity) * t,\n panelScale: a.panelScale + (b.panelScale - a.panelScale) * t,\n panelTranslateY:\n a.panelTranslateY + (b.panelTranslateY - a.panelTranslateY) * t,\n };\n}\n\nexport interface ComboboxTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useComboboxTransition(\n steps: Step<ComboboxState>[],\n opts: ComboboxTransitionOptions = {},\n): ComboboxStyle {\n const {\n theme: themeOverride,\n mode,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = comboboxStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"closed\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenComboboxStyle(\n comboboxStyle(from, ctx),\n comboboxStyle(to, ctx),\n t,\n );\n}\n","type": "registry:component","target": "components/remocn/use-combobox-transition.ts"}diff --git a/public/r/command-menu-item.json b/public/r/command-menu-item.jsonindex 1f7a647b..9155d6ed 100644--- a/public/r/command-menu-item.json+++ b/public/r/command-menu-item.json@@ -14,7 +14,7 @@},{"path": "registry/remocn-ui/command-menu-item/use-command-menu-item-transition.ts",- "content": "\"use client\";\n\nimport {\n easings,\n mixOklch,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\nimport {\n commandMenuItemStyle,\n commandMenuItemStyleContext,\n type CommandMenuItemState,\n type CommandMenuItemStyle,\n} from \"@/components/remocn/command-menu-item\";\n\nexport const DEFAULT_DURATION = 8;\n\nexport function tweenCommandMenuItemStyle(\n a: CommandMenuItemStyle,\n b: CommandMenuItemStyle,\n t: number,\n): CommandMenuItemStyle {\n return {\n background: mixOklch(a.background, b.background, t),\n labelColor: mixOklch(a.labelColor, b.labelColor, t),\n iconColor: mixOklch(a.iconColor, b.iconColor, t),\n scale: a.scale + (b.scale - a.scale) * t,\n };\n}\n\nexport interface CommandMenuItemTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useCommandMenuItemTransition(\n steps: Step<CommandMenuItemState>[],\n opts: CommandMenuItemTransitionOptions = {},\n): CommandMenuItemStyle {\n const {\n theme: themeOverride,\n mode,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = commandMenuItemStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"idle\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenCommandMenuItemStyle(\n commandMenuItemStyle(from, ctx),\n commandMenuItemStyle(to, ctx),\n t,\n );\n}\n",+ "content": "\"use client\";\n\nimport {\n type CommandMenuItemState,\n type CommandMenuItemStyle,\n commandMenuItemStyle,\n commandMenuItemStyleContext,\n} from \"@/components/remocn/command-menu-item\";\nimport {\n easings,\n mixOklch,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\n\nexport const DEFAULT_DURATION = 8;\n\nexport function tweenCommandMenuItemStyle(\n a: CommandMenuItemStyle,\n b: CommandMenuItemStyle,\n t: number,\n): CommandMenuItemStyle {\n return {\n background: mixOklch(a.background, b.background, t),\n labelColor: mixOklch(a.labelColor, b.labelColor, t),\n iconColor: mixOklch(a.iconColor, b.iconColor, t),\n scale: a.scale + (b.scale - a.scale) * t,\n };\n}\n\nexport interface CommandMenuItemTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useCommandMenuItemTransition(\n steps: Step<CommandMenuItemState>[],\n opts: CommandMenuItemTransitionOptions = {},\n): CommandMenuItemStyle {\n const {\n theme: themeOverride,\n mode,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = commandMenuItemStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"idle\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenCommandMenuItemStyle(\n commandMenuItemStyle(from, ctx),\n commandMenuItemStyle(to, ctx),\n t,\n );\n}\n","type": "registry:component","target": "components/remocn/use-command-menu-item-transition.ts"}diff --git a/public/r/command-menu.json b/public/r/command-menu.jsonindex 68c4ad16..8b173137 100644--- a/public/r/command-menu.json+++ b/public/r/command-menu.json@@ -8,13 +8,13 @@"files": [{"path": "registry/remocn-ui/command-menu/index.tsx",- "content": "\"use client\";\n\nimport { type RemocnTheme, revealedText, useRemocnTheme } from \"@/lib/remocn-ui\";\nimport {\n CommandMenuItemRow,\n commandMenuItemStyle,\n commandMenuItemStyleContext,\n type CommandMenuIcon,\n type CommandMenuItemState,\n type CommandMenuItemStyle,\n type CommandMenuItemStyleContext,\n} from \"@/components/remocn/command-menu-item\";\n\nexport type CommandMenuState = \"opened\" | \"closed\";\n\nexport interface CommandMenuEntry {\n icon?: CommandMenuIcon;\n label: string;\n shortcut?: string;\n}\n\nexport interface CommandMenuProps {\n state?: CommandMenuState;\n style?: CommandMenuStyle;\n query?: string;\n revealCount?: number;\n items?: CommandMenuEntry[];\n selectedIndex?: number;\n highlightedIndex?: number;\n pressedIndex?: number;\n itemStyles?: (CommandMenuItemStyle | undefined)[];\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nconst PANEL_WIDTH = 440;\nconst CONTENT_WIDTH = PANEL_WIDTH - 16;\nconst MAX_OVERLAY_ALPHA = 0.5;\n\nexport function filterCommandItems(\n items: CommandMenuEntry[],\n query: string,\n revealCount?: number,\n): CommandMenuEntry[] {\n const visible = (\n revealCount === undefined ? query : revealedText(query, revealCount)\n )\n .trim()\n .toLowerCase();\n if (visible === \"\") return items;\n return items.filter((item) => item.label.toLowerCase().includes(visible));\n}\n\nexport interface CommandMenuStyle {\n backdropOpacity: number;\n panelOpacity: number;\n panelScale: number;\n panelTranslateY: number;\n}\n\nexport interface CommandMenuStyleContext {\n panelBg: string;\n panelBorder: string;\n inputFg: string;\n placeholderFg: string;\n mutedFg: string;\n divider: string;\n caret: string;\n radius: number;\n itemCtx: CommandMenuItemStyleContext;\n}\n\nexport function commandMenuStyleContext(\n theme: RemocnTheme,\n): CommandMenuStyleContext {\n return {\n panelBg: theme.popover,\n panelBorder: theme.border,\n inputFg: theme.popoverForeground,\n placeholderFg: theme.mutedForeground,\n mutedFg: theme.mutedForeground,\n divider: theme.border,\n caret: theme.foreground,\n radius: theme.radius,\n itemCtx: commandMenuItemStyleContext(theme),\n };\n}\n\nexport function commandMenuStyle(\n state: CommandMenuState,\n _ctx: CommandMenuStyleContext,\n): CommandMenuStyle {\n switch (state) {\n case \"opened\":\n return {\n backdropOpacity: 1,\n panelOpacity: 1,\n panelScale: 1,\n panelTranslateY: 0,\n };\n default:\n return {\n backdropOpacity: 0,\n panelOpacity: 0,\n panelScale: 0.96,\n panelTranslateY: 8,\n };\n }\n}\n\nfunction rowState(\n i: number,\n selectedIndex: number,\n highlightedIndex: number,\n pressedIndex: number,\n): CommandMenuItemState {\n if (i === pressedIndex) return \"press\";\n if (i === selectedIndex) return \"selected\";\n if (i === highlightedIndex) return \"hover\";\n return \"idle\";\n}\n\nexport function CommandMenu({\n state = \"closed\",\n style,\n query = \"\",\n revealCount,\n items = [\n { icon: \"user\", label: \"Profile\", shortcut: \"⌘ P\" },\n { icon: \"settings\", label: \"Settings\", shortcut: \"⌘ S\" },\n { icon: \"file\", label: \"New File\", shortcut: \"⌘ N\" },\n { icon: \"search\", label: \"Search docs\" },\n ],\n selectedIndex = -1,\n highlightedIndex = -1,\n pressedIndex = -1,\n itemStyles,\n theme: themeOverride,\n className,\n}: CommandMenuProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const ctx = commandMenuStyleContext(theme);\n const v = style ?? commandMenuStyle(state, ctx);\n\n const visibleQuery =\n revealCount === undefined ? query : revealedText(query, revealCount);\n const filtered = filterCommandItems(items, query, revealCount);\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"flex-start\",\n justifyContent: \"center\",\n paddingTop: \"18%\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: `rgba(0, 0, 0, ${MAX_OVERLAY_ALPHA * v.backdropOpacity})`,\n }}\n />\n <div\n className={className}\n style={{\n position: \"relative\",\n width: PANEL_WIDTH,\n boxSizing: \"border-box\",\n transformOrigin: \"top\",\n transform: `translateY(${v.panelTranslateY}px) scale(${v.panelScale})`,\n opacity: v.panelOpacity,\n background: ctx.panelBg,\n border: `1px solid ${ctx.panelBorder}`,\n borderRadius: ctx.radius + 6,\n padding: 8,\n display: \"flex\",\n flexDirection: \"column\",\n boxShadow: \"0 24px 48px -12px rgba(0,0,0,0.25)\",\n }}\n >\n {}\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n padding: \"8px 10px\",\n }}\n >\n <svg width={18} height={18} viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d=\"M11 4a7 7 0 1 0 0 14 7 7 0 0 0 0-14ZM20 20l-3.5-3.5\"\n stroke={ctx.mutedFg}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n <span\n style={{\n display: \"flex\",\n alignItems: \"center\",\n fontSize: 15,\n letterSpacing: \"-0.01em\",\n color: visibleQuery ? ctx.inputFg : ctx.placeholderFg,\n }}\n >\n {visibleQuery || \"Type a command or search…\"}\n {}\n <span\n style={{\n display: \"inline-block\",\n width: 1.5,\n height: 18,\n marginLeft: 1,\n background: ctx.caret,\n }}\n />\n </span>\n </div>\n {}\n <div\n style={{\n height: 1,\n background: ctx.divider,\n margin: \"4px 0\",\n }}\n />\n {}\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 2,\n padding: \"4px 0\",\n }}\n >\n {filtered.length === 0 ? (\n <div\n style={{\n padding: \"20px 12px\",\n textAlign: \"center\",\n fontSize: 14,\n color: ctx.mutedFg,\n }}\n >\n No results found.\n </div>\n ) : (\n filtered.map((item, i) => {\n const override = itemStyles?.[i];\n return (\n <CommandMenuItemRow\n key={item.label}\n style={\n override ??\n commandMenuItemStyle(\n rowState(\n i,\n selectedIndex,\n highlightedIndex,\n pressedIndex,\n ),\n ctx.itemCtx,\n )\n }\n ctx={ctx.itemCtx}\n label={item.label}\n icon={item.icon}\n shortcut={item.shortcut}\n width={CONTENT_WIDTH}\n radius={theme.radius}\n />\n );\n })\n )}\n </div>\n </div>\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport {\n type CommandMenuIcon,\n CommandMenuItemRow,\n type CommandMenuItemState,\n type CommandMenuItemStyle,\n type CommandMenuItemStyleContext,\n commandMenuItemStyle,\n commandMenuItemStyleContext,\n} from \"@/components/remocn/command-menu-item\";\nimport {\n type RemocnTheme,\n revealedText,\n useRemocnTheme,\n} from \"@/lib/remocn-ui\";\n\nexport type CommandMenuState = \"opened\" | \"closed\";\n\nexport interface CommandMenuEntry {\n icon?: CommandMenuIcon;\n label: string;\n shortcut?: string;\n}\n\nexport interface CommandMenuProps {\n state?: CommandMenuState;\n style?: CommandMenuStyle;\n query?: string;\n revealCount?: number;\n items?: CommandMenuEntry[];\n selectedIndex?: number;\n highlightedIndex?: number;\n pressedIndex?: number;\n itemStyles?: (CommandMenuItemStyle | undefined)[];\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nconst PANEL_WIDTH = 440;\nconst CONTENT_WIDTH = PANEL_WIDTH - 16;\nconst MAX_OVERLAY_ALPHA = 0.5;\n\nexport function filterCommandItems(\n items: CommandMenuEntry[],\n query: string,\n revealCount?: number,\n): CommandMenuEntry[] {\n const visible = (\n revealCount === undefined ? query : revealedText(query, revealCount)\n )\n .trim()\n .toLowerCase();\n if (visible === \"\") return items;\n return items.filter((item) => item.label.toLowerCase().includes(visible));\n}\n\nexport interface CommandMenuStyle {\n backdropOpacity: number;\n panelOpacity: number;\n panelScale: number;\n panelTranslateY: number;\n}\n\nexport interface CommandMenuStyleContext {\n panelBg: string;\n panelBorder: string;\n inputFg: string;\n placeholderFg: string;\n mutedFg: string;\n divider: string;\n caret: string;\n radius: number;\n itemCtx: CommandMenuItemStyleContext;\n}\n\nexport function commandMenuStyleContext(\n theme: RemocnTheme,\n): CommandMenuStyleContext {\n return {\n panelBg: theme.popover,\n panelBorder: theme.border,\n inputFg: theme.popoverForeground,\n placeholderFg: theme.mutedForeground,\n mutedFg: theme.mutedForeground,\n divider: theme.border,\n caret: theme.foreground,\n radius: theme.radius,\n itemCtx: commandMenuItemStyleContext(theme),\n };\n}\n\nexport function commandMenuStyle(\n state: CommandMenuState,\n _ctx: CommandMenuStyleContext,\n): CommandMenuStyle {\n switch (state) {\n case \"opened\":\n return {\n backdropOpacity: 1,\n panelOpacity: 1,\n panelScale: 1,\n panelTranslateY: 0,\n };\n default:\n return {\n backdropOpacity: 0,\n panelOpacity: 0,\n panelScale: 0.96,\n panelTranslateY: 8,\n };\n }\n}\n\nfunction rowState(\n i: number,\n selectedIndex: number,\n highlightedIndex: number,\n pressedIndex: number,\n): CommandMenuItemState {\n if (i === pressedIndex) return \"press\";\n if (i === selectedIndex) return \"selected\";\n if (i === highlightedIndex) return \"hover\";\n return \"idle\";\n}\n\nexport function CommandMenu({\n state = \"closed\",\n style,\n query = \"\",\n revealCount,\n items = [\n { icon: \"user\", label: \"Profile\", shortcut: \"⌘ P\" },\n { icon: \"settings\", label: \"Settings\", shortcut: \"⌘ S\" },\n { icon: \"file\", label: \"New File\", shortcut: \"⌘ N\" },\n { icon: \"search\", label: \"Search docs\" },\n ],\n selectedIndex = -1,\n highlightedIndex = -1,\n pressedIndex = -1,\n itemStyles,\n theme: themeOverride,\n className,\n}: CommandMenuProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const ctx = commandMenuStyleContext(theme);\n const v = style ?? commandMenuStyle(state, ctx);\n\n const visibleQuery =\n revealCount === undefined ? query : revealedText(query, revealCount);\n const filtered = filterCommandItems(items, query, revealCount);\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"flex-start\",\n justifyContent: \"center\",\n paddingTop: \"18%\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: `rgba(0, 0, 0, ${MAX_OVERLAY_ALPHA * v.backdropOpacity})`,\n }}\n />\n <div\n className={className}\n style={{\n position: \"relative\",\n width: PANEL_WIDTH,\n boxSizing: \"border-box\",\n transformOrigin: \"top\",\n transform: `translateY(${v.panelTranslateY}px) scale(${v.panelScale})`,\n opacity: v.panelOpacity,\n background: ctx.panelBg,\n border: `1px solid ${ctx.panelBorder}`,\n borderRadius: ctx.radius + 6,\n padding: 8,\n display: \"flex\",\n flexDirection: \"column\",\n boxShadow: \"0 24px 48px -12px rgba(0,0,0,0.25)\",\n }}\n >\n {}\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n padding: \"8px 10px\",\n }}\n >\n <svg width={18} height={18} viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d=\"M11 4a7 7 0 1 0 0 14 7 7 0 0 0 0-14ZM20 20l-3.5-3.5\"\n stroke={ctx.mutedFg}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n <span\n style={{\n display: \"flex\",\n alignItems: \"center\",\n fontSize: 15,\n letterSpacing: \"-0.01em\",\n color: visibleQuery ? ctx.inputFg : ctx.placeholderFg,\n }}\n >\n {visibleQuery || \"Type a command or search…\"}\n {}\n <span\n style={{\n display: \"inline-block\",\n width: 1.5,\n height: 18,\n marginLeft: 1,\n background: ctx.caret,\n }}\n />\n </span>\n </div>\n {}\n <div\n style={{\n height: 1,\n background: ctx.divider,\n margin: \"4px 0\",\n }}\n />\n {}\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 2,\n padding: \"4px 0\",\n }}\n >\n {filtered.length === 0 ? (\n <div\n style={{\n padding: \"20px 12px\",\n textAlign: \"center\",\n fontSize: 14,\n color: ctx.mutedFg,\n }}\n >\n No results found.\n </div>\n ) : (\n filtered.map((item, i) => {\n const override = itemStyles?.[i];\n return (\n <CommandMenuItemRow\n key={item.label}\n style={\n override ??\n commandMenuItemStyle(\n rowState(\n i,\n selectedIndex,\n highlightedIndex,\n pressedIndex,\n ),\n ctx.itemCtx,\n )\n }\n ctx={ctx.itemCtx}\n label={item.label}\n icon={item.icon}\n shortcut={item.shortcut}\n width={CONTENT_WIDTH}\n radius={theme.radius}\n />\n );\n })\n )}\n </div>\n </div>\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/command-menu.tsx"},{"path": "registry/remocn-ui/command-menu/use-command-menu-transition.ts",- "content": "\"use client\";\n\nimport {\n easings,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\nimport {\n commandMenuStyle,\n commandMenuStyleContext,\n type CommandMenuState,\n type CommandMenuStyle,\n} from \"@/components/remocn/command-menu\";\n\nexport const DEFAULT_DURATION = 12;\n\nexport function tweenCommandMenuStyle(\n a: CommandMenuStyle,\n b: CommandMenuStyle,\n t: number,\n): CommandMenuStyle {\n return {\n backdropOpacity:\n a.backdropOpacity + (b.backdropOpacity - a.backdropOpacity) * t,\n panelOpacity: a.panelOpacity + (b.panelOpacity - a.panelOpacity) * t,\n panelScale: a.panelScale + (b.panelScale - a.panelScale) * t,\n panelTranslateY:\n a.panelTranslateY + (b.panelTranslateY - a.panelTranslateY) * t,\n };\n}\n\nexport interface CommandMenuTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useCommandMenuTransition(\n steps: Step<CommandMenuState>[],\n opts: CommandMenuTransitionOptions = {},\n): CommandMenuStyle {\n const {\n theme: themeOverride,\n mode,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = commandMenuStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"closed\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenCommandMenuStyle(\n commandMenuStyle(from, ctx),\n commandMenuStyle(to, ctx),\n t,\n );\n}\n",+ "content": "\"use client\";\n\nimport {\n type CommandMenuState,\n type CommandMenuStyle,\n commandMenuStyle,\n commandMenuStyleContext,\n} from \"@/components/remocn/command-menu\";\nimport {\n easings,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\n\nexport const DEFAULT_DURATION = 12;\n\nexport function tweenCommandMenuStyle(\n a: CommandMenuStyle,\n b: CommandMenuStyle,\n t: number,\n): CommandMenuStyle {\n return {\n backdropOpacity:\n a.backdropOpacity + (b.backdropOpacity - a.backdropOpacity) * t,\n panelOpacity: a.panelOpacity + (b.panelOpacity - a.panelOpacity) * t,\n panelScale: a.panelScale + (b.panelScale - a.panelScale) * t,\n panelTranslateY:\n a.panelTranslateY + (b.panelTranslateY - a.panelTranslateY) * t,\n };\n}\n\nexport interface CommandMenuTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useCommandMenuTransition(\n steps: Step<CommandMenuState>[],\n opts: CommandMenuTransitionOptions = {},\n): CommandMenuStyle {\n const {\n theme: themeOverride,\n mode,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = commandMenuStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"closed\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenCommandMenuStyle(\n commandMenuStyle(from, ctx),\n commandMenuStyle(to, ctx),\n t,\n );\n}\n","type": "registry:component","target": "components/remocn/use-command-menu-transition.ts"}diff --git a/public/r/confetti.json b/public/r/confetti.jsonindex 9508421c..ca74a6f0 100644--- a/public/r/confetti.json+++ b/public/r/confetti.json@@ -7,7 +7,7 @@"files": [{"path": "registry/remocn/confetti/index.tsx",- "content": "\"use client\";\n\nimport { AbsoluteFill, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface ConfettiProps {\n /** Number of confetti pieces. */\n particleCount?: number;\n colors?: string[];\n /** Burst origin as a 0..1 fraction of the canvas. */\n originX?: number;\n originY?: number;\n /** Frame the burst fires on. */\n startFrame?: number;\n /** Lifetime of the burst, in frames. */\n lifetime?: number;\n /** Initial launch speed (px/frame at the 720px reference height). */\n power?: number;\n /** Downward acceleration (px/frame² at the 720px reference height). */\n gravity?: number;\n /** Base piece size in reference px. */\n size?: number;\n /** PRNG seed — same seed renders an identical burst every time. */\n seed?: number;\n}\n\nexport interface Particle {\n angle: number;\n speed: number;\n color: string;\n size: number;\n rot0: number;\n spin: number;\n drift: number;\n}\n\nconst DEFAULT_COLORS = [\n \"#1d9bf0\",\n \"#ff5da2\",\n \"#ffd23f\",\n \"#22c55e\",\n \"#a855f7\",\n \"#ff7a45\",\n];\n\n// --- Pure helpers (unit-tested) -------------------------------------------\n\n/** Deterministic PRNG (mulberry32) — returns a function yielding [0, 1). */\nexport function mulberry32(seed: number): () => number {\n let a = seed >>> 0;\n return () => {\n a = (a + 0x6d2b79f5) | 0;\n let t = Math.imul(a ^ (a >>> 15), 1 | a);\n t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296;\n };\n}\n\n/** Build a deterministic particle set for a seed (stable across renders). */\nexport function makeParticles({\n count,\n seed,\n colors,\n}: {\n count: number;\n seed: number;\n colors: string[];\n}): Particle[] {\n const rand = mulberry32(seed);\n const palette = colors.length > 0 ? colors : DEFAULT_COLORS;\n const out: Particle[] = [];\n for (let i = 0; i < count; i++) {\n const angle = rand() * Math.PI * 2;\n const speed = 0.35 + 0.65 * rand();\n out.push({\n angle,\n speed,\n color: palette[Math.floor(rand() * palette.length)],\n size: 0.7 + 0.6 * rand(),\n rot0: rand() * Math.PI * 2,\n spin: (rand() - 0.5) * 0.6,\n drift: (rand() - 0.5) * 2,\n });\n }\n return out;\n}\n\n/** Opacity envelope over a particle's lifetime: quick fade-in, slow fade-out. */\nexport function particleOpacity(tt: number, lifetime: number): number {\n if (tt < 0 || tt > lifetime) return 0;\n const fadeIn = interpolate(tt, [0, 4], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const fadeOut = interpolate(tt, [lifetime * 0.7, lifetime], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n return Math.min(fadeIn, fadeOut);\n}\n\n// --- Component -------------------------------------------------------------\n\nexport function Confetti({\n particleCount = 140,\n colors = DEFAULT_COLORS,\n originX = 0.5,\n originY = 0.5,\n startFrame = 0,\n lifetime = 90,\n power = 17,\n gravity = 0.45,\n size = 13,\n seed = 1,\n}: ConfettiProps) {\n const frame = useCurrentFrame();\n const { width, height } = useVideoConfig();\n\n const tt = frame - startFrame;\n if (tt < 0 || tt > lifetime) return null;\n\n const sc = height / 720;\n const ox = width * originX;\n const oy = height * originY;\n const particles = makeParticles({ count: particleCount, seed, colors });\n\n return (\n <AbsoluteFill style={{ pointerEvents: \"none\" }}>\n {particles.map((p, i) => {\n const opacity = particleOpacity(tt, lifetime);\n if (opacity <= 0) return null;\n\n const vx = Math.cos(p.angle) * p.speed * power + p.drift;\n const vy = Math.sin(p.angle) * p.speed * power;\n const x = ox + vx * tt * sc;\n const y = oy + (vy * tt + 0.5 * gravity * tt * tt) * sc;\n const rot = p.rot0 + p.spin * tt;\n const flutter = Math.cos(p.rot0 + p.spin * tt * 1.6);\n const w = size * p.size * sc;\n\n return (\n <div\n key={i}\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n width: w,\n height: w * 0.62,\n borderRadius: 2,\n background: p.color,\n opacity,\n transform: `translate(-50%, -50%) rotate(${rot}rad) scaleX(${flutter})`,\n }}\n />\n );\n })}\n </AbsoluteFill>\n );\n}\n",+ "content": "\"use client\";\n\nimport {\n AbsoluteFill,\n interpolate,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport interface ConfettiProps {\n /** Number of confetti pieces. */\n particleCount?: number;\n colors?: string[];\n /** Burst origin as a 0..1 fraction of the canvas. */\n originX?: number;\n originY?: number;\n /** Frame the burst fires on. */\n startFrame?: number;\n /** Lifetime of the burst, in frames. */\n lifetime?: number;\n /** Initial launch speed (px/frame at the 720px reference height). */\n power?: number;\n /** Downward acceleration (px/frame² at the 720px reference height). */\n gravity?: number;\n /** Base piece size in reference px. */\n size?: number;\n /** PRNG seed — same seed renders an identical burst every time. */\n seed?: number;\n}\n\nexport interface Particle {\n angle: number;\n speed: number;\n color: string;\n size: number;\n rot0: number;\n spin: number;\n drift: number;\n}\n\nconst DEFAULT_COLORS = [\n \"#1d9bf0\",\n \"#ff5da2\",\n \"#ffd23f\",\n \"#22c55e\",\n \"#a855f7\",\n \"#ff7a45\",\n];\n\n// --- Pure helpers (unit-tested) -------------------------------------------\n\n/** Deterministic PRNG (mulberry32) — returns a function yielding [0, 1). */\nexport function mulberry32(seed: number): () => number {\n let a = seed >>> 0;\n return () => {\n a = (a + 0x6d2b79f5) | 0;\n let t = Math.imul(a ^ (a >>> 15), 1 | a);\n t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;\n return ((t ^ (t >>> 14)) >>> 0) / 4294967296;\n };\n}\n\n/** Build a deterministic particle set for a seed (stable across renders). */\nexport function makeParticles({\n count,\n seed,\n colors,\n}: {\n count: number;\n seed: number;\n colors: string[];\n}): Particle[] {\n const rand = mulberry32(seed);\n const palette = colors.length > 0 ? colors : DEFAULT_COLORS;\n const out: Particle[] = [];\n for (let i = 0; i < count; i++) {\n const angle = rand() * Math.PI * 2;\n const speed = 0.35 + 0.65 * rand();\n out.push({\n angle,\n speed,\n color: palette[Math.floor(rand() * palette.length)],\n size: 0.7 + 0.6 * rand(),\n rot0: rand() * Math.PI * 2,\n spin: (rand() - 0.5) * 0.6,\n drift: (rand() - 0.5) * 2,\n });\n }\n return out;\n}\n\n/** Opacity envelope over a particle's lifetime: quick fade-in, slow fade-out. */\nexport function particleOpacity(tt: number, lifetime: number): number {\n if (tt < 0 || tt > lifetime) return 0;\n const fadeIn = interpolate(tt, [0, 4], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const fadeOut = interpolate(tt, [lifetime * 0.7, lifetime], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n return Math.min(fadeIn, fadeOut);\n}\n\n// --- Component -------------------------------------------------------------\n\nexport function Confetti({\n particleCount = 140,\n colors = DEFAULT_COLORS,\n originX = 0.5,\n originY = 0.5,\n startFrame = 0,\n lifetime = 90,\n power = 17,\n gravity = 0.45,\n size = 13,\n seed = 1,\n}: ConfettiProps) {\n const frame = useCurrentFrame();\n const { width, height } = useVideoConfig();\n\n const tt = frame - startFrame;\n if (tt < 0 || tt > lifetime) return null;\n\n const sc = height / 720;\n const ox = width * originX;\n const oy = height * originY;\n const particles = makeParticles({ count: particleCount, seed, colors });\n\n return (\n <AbsoluteFill style={{ pointerEvents: \"none\" }}>\n {particles.map((p, i) => {\n const opacity = particleOpacity(tt, lifetime);\n if (opacity <= 0) return null;\n\n const vx = Math.cos(p.angle) * p.speed * power + p.drift;\n const vy = Math.sin(p.angle) * p.speed * power;\n const x = ox + vx * tt * sc;\n const y = oy + (vy * tt + 0.5 * gravity * tt * tt) * sc;\n const rot = p.rot0 + p.spin * tt;\n const flutter = Math.cos(p.rot0 + p.spin * tt * 1.6);\n const w = size * p.size * sc;\n\n return (\n <div\n key={i}\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n width: w,\n height: w * 0.62,\n borderRadius: 2,\n background: p.color,\n opacity,\n transform: `translate(-50%, -50%) rotate(${rot}rad) scaleX(${flutter})`,\n }}\n />\n );\n })}\n </AbsoluteFill>\n );\n}\n","type": "registry:component","target": "components/remocn/confetti.tsx"}diff --git a/public/r/context-menu.json b/public/r/context-menu.jsonindex 9547d5c1..f634836b 100644--- a/public/r/context-menu.json+++ b/public/r/context-menu.json@@ -8,13 +8,13 @@"files": [{"path": "registry/remocn-ui/context-menu/index.tsx",- "content": "\"use client\";\n\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\nimport {\n DropdownMenuItemRow,\n dropdownMenuItemStyle,\n dropdownMenuItemStyleContext,\n type DropdownMenuItemState,\n type DropdownMenuItemStyle,\n type DropdownMenuItemStyleContext,\n} from \"@/components/remocn/dropdown-menu-item\";\n\nexport type ContextMenuState = \"opened\" | \"closed\";\n\nexport interface ContextMenuProps {\n state?: ContextMenuState;\n style?: ContextMenuStyle;\n items?: string[];\n highlightedIndex?: number;\n pressedIndex?: number;\n itemStyles?: (DropdownMenuItemStyle | undefined)[];\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nconst WIDTH = 200;\n\nexport interface ContextMenuStyle {\n opacity: number;\n scale: number;\n translateY: number;\n}\n\nexport interface ContextMenuStyleContext {\n panelBg: string;\n panelBorder: string;\n radius: number;\n itemCtx: DropdownMenuItemStyleContext;\n}\n\nexport function contextMenuStyleContext(\n theme: RemocnTheme,\n): ContextMenuStyleContext {\n return {\n panelBg: theme.popover,\n panelBorder: theme.border,\n radius: theme.radius,\n itemCtx: dropdownMenuItemStyleContext(theme),\n };\n}\n\nexport function contextMenuStyle(\n state: ContextMenuState,\n _ctx: ContextMenuStyleContext,\n): ContextMenuStyle {\n switch (state) {\n case \"opened\":\n return { opacity: 1, scale: 1, translateY: 0 };\n default:\n return { opacity: 0, scale: 0.95, translateY: -4 };\n }\n}\n\nfunction rowState(\n i: number,\n highlightedIndex: number,\n pressedIndex: number,\n): DropdownMenuItemState {\n if (i === pressedIndex) return \"press\";\n if (i === highlightedIndex) return \"hover\";\n return \"idle\";\n}\n\nexport function ContextMenu({\n state = \"closed\",\n style,\n items = [\"Back\", \"Reload\", \"Save As…\", \"Inspect\"],\n highlightedIndex = -1,\n pressedIndex = -1,\n itemStyles,\n theme: themeOverride,\n className,\n}: ContextMenuProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const ctx = contextMenuStyleContext(theme);\n const v = style ?? contextMenuStyle(state, ctx);\n\n return (\n <div\n className={className}\n style={{\n width: WIDTH,\n opacity: v.opacity,\n transformOrigin: \"top left\",\n transform: `translateY(${v.translateY}px) scale(${v.scale})`,\n background: ctx.panelBg,\n border: `1px solid ${ctx.panelBorder}`,\n borderRadius: ctx.radius + 2,\n padding: 4,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 2,\n boxShadow: \"0 12px 32px -8px rgba(0,0,0,0.18)\",\n boxSizing: \"border-box\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {items.map((item, i) => {\n const override = itemStyles?.[i];\n const rowStyle =\n override ??\n dropdownMenuItemStyle(\n rowState(i, highlightedIndex, pressedIndex),\n ctx.itemCtx,\n );\n return (\n <DropdownMenuItemRow\n key={item}\n style={rowStyle}\n label={item}\n width={WIDTH - 8}\n theme={themeOverride}\n />\n );\n })}\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport {\n DropdownMenuItemRow,\n type DropdownMenuItemState,\n type DropdownMenuItemStyle,\n type DropdownMenuItemStyleContext,\n dropdownMenuItemStyle,\n dropdownMenuItemStyleContext,\n} from \"@/components/remocn/dropdown-menu-item\";\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type ContextMenuState = \"opened\" | \"closed\";\n\nexport interface ContextMenuProps {\n state?: ContextMenuState;\n style?: ContextMenuStyle;\n items?: string[];\n highlightedIndex?: number;\n pressedIndex?: number;\n itemStyles?: (DropdownMenuItemStyle | undefined)[];\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nconst WIDTH = 200;\n\nexport interface ContextMenuStyle {\n opacity: number;\n scale: number;\n translateY: number;\n}\n\nexport interface ContextMenuStyleContext {\n panelBg: string;\n panelBorder: string;\n radius: number;\n itemCtx: DropdownMenuItemStyleContext;\n}\n\nexport function contextMenuStyleContext(\n theme: RemocnTheme,\n): ContextMenuStyleContext {\n return {\n panelBg: theme.popover,\n panelBorder: theme.border,\n radius: theme.radius,\n itemCtx: dropdownMenuItemStyleContext(theme),\n };\n}\n\nexport function contextMenuStyle(\n state: ContextMenuState,\n _ctx: ContextMenuStyleContext,\n): ContextMenuStyle {\n switch (state) {\n case \"opened\":\n return { opacity: 1, scale: 1, translateY: 0 };\n default:\n return { opacity: 0, scale: 0.95, translateY: -4 };\n }\n}\n\nfunction rowState(\n i: number,\n highlightedIndex: number,\n pressedIndex: number,\n): DropdownMenuItemState {\n if (i === pressedIndex) return \"press\";\n if (i === highlightedIndex) return \"hover\";\n return \"idle\";\n}\n\nexport function ContextMenu({\n state = \"closed\",\n style,\n items = [\"Back\", \"Reload\", \"Save As…\", \"Inspect\"],\n highlightedIndex = -1,\n pressedIndex = -1,\n itemStyles,\n theme: themeOverride,\n className,\n}: ContextMenuProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const ctx = contextMenuStyleContext(theme);\n const v = style ?? contextMenuStyle(state, ctx);\n\n return (\n <div\n className={className}\n style={{\n width: WIDTH,\n opacity: v.opacity,\n transformOrigin: \"top left\",\n transform: `translateY(${v.translateY}px) scale(${v.scale})`,\n background: ctx.panelBg,\n border: `1px solid ${ctx.panelBorder}`,\n borderRadius: ctx.radius + 2,\n padding: 4,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 2,\n boxShadow: \"0 12px 32px -8px rgba(0,0,0,0.18)\",\n boxSizing: \"border-box\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {items.map((item, i) => {\n const override = itemStyles?.[i];\n const rowStyle =\n override ??\n dropdownMenuItemStyle(\n rowState(i, highlightedIndex, pressedIndex),\n ctx.itemCtx,\n );\n return (\n <DropdownMenuItemRow\n key={item}\n style={rowStyle}\n label={item}\n width={WIDTH - 8}\n theme={themeOverride}\n />\n );\n })}\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/context-menu.tsx"},{"path": "registry/remocn-ui/context-menu/use-context-menu-transition.ts",- "content": "\"use client\";\n\nimport {\n easings,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\nimport {\n contextMenuStyle,\n contextMenuStyleContext,\n type ContextMenuState,\n type ContextMenuStyle,\n} from \"@/components/remocn/context-menu\";\n\nexport const DEFAULT_DURATION = 10;\n\nexport function tweenContextMenuStyle(\n a: ContextMenuStyle,\n b: ContextMenuStyle,\n t: number,\n): ContextMenuStyle {\n return {\n opacity: a.opacity + (b.opacity - a.opacity) * t,\n scale: a.scale + (b.scale - a.scale) * t,\n translateY: a.translateY + (b.translateY - a.translateY) * t,\n };\n}\n\nexport interface ContextMenuTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useContextMenuTransition(\n steps: Step<ContextMenuState>[],\n opts: ContextMenuTransitionOptions = {},\n): ContextMenuStyle {\n const {\n theme: themeOverride,\n mode,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = contextMenuStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"closed\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenContextMenuStyle(\n contextMenuStyle(from, ctx),\n contextMenuStyle(to, ctx),\n t,\n );\n}\n",+ "content": "\"use client\";\n\nimport {\n type ContextMenuState,\n type ContextMenuStyle,\n contextMenuStyle,\n contextMenuStyleContext,\n} from \"@/components/remocn/context-menu\";\nimport {\n easings,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\n\nexport const DEFAULT_DURATION = 10;\n\nexport function tweenContextMenuStyle(\n a: ContextMenuStyle,\n b: ContextMenuStyle,\n t: number,\n): ContextMenuStyle {\n return {\n opacity: a.opacity + (b.opacity - a.opacity) * t,\n scale: a.scale + (b.scale - a.scale) * t,\n translateY: a.translateY + (b.translateY - a.translateY) * t,\n };\n}\n\nexport interface ContextMenuTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useContextMenuTransition(\n steps: Step<ContextMenuState>[],\n opts: ContextMenuTransitionOptions = {},\n): ContextMenuStyle {\n const {\n theme: themeOverride,\n mode,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = contextMenuStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"closed\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenContextMenuStyle(\n contextMenuStyle(from, ctx),\n contextMenuStyle(to, ctx),\n t,\n );\n}\n","type": "registry:component","target": "components/remocn/use-context-menu-transition.ts"}diff --git a/public/r/cursor.json b/public/r/cursor.jsonindex f5985b06..9c91ef22 100644--- a/public/r/cursor.json+++ b/public/r/cursor.json@@ -14,7 +14,7 @@},{"path": "registry/remocn-ui/cursor/use-cursor-path.ts",- "content": "\"use client\";\n\nimport { useCurrentFrame } from \"remotion\";\nimport {\n clamp01,\n type EasingName,\n easings,\n} from \"@/lib/remocn-ui\";\nimport type { CursorStyle } from \"@/components/remocn/cursor\";\n\nexport interface CursorWaypoint {\n at: number;\n x: number;\n y: number;\n duration?: number;\n click?: boolean;\n press?: boolean;\n easing?: EasingName;\n}\n\nexport const DEFAULT_DURATION = 24;\n\nexport const CLICK_FRAMES = 16;\n\nexport const PRESS_FRAMES = 8;\n\nexport interface CursorPathOptions {\n speed?: number;\n defaultDuration?: number;\n}\n\nfunction lerp(a: number, b: number, t: number): number {\n return a + (b - a) * t;\n}\n\nexport function ripplePhase(framesSinceClick: number): {\n rippleOpacity: number;\n rippleScale: number;\n} {\n if (framesSinceClick < 0 || framesSinceClick >= CLICK_FRAMES) {\n return { rippleOpacity: 0, rippleScale: 0 };\n }\n const p = clamp01(framesSinceClick / CLICK_FRAMES);\n return {\n rippleOpacity: 0.5 * (1 - p),\n rippleScale: 2.5 * easings.out(p),\n };\n}\n\nexport function clickPress(framesSinceClick: number): number {\n if (framesSinceClick < 0 || framesSinceClick >= PRESS_FRAMES) return 1;\n const half = PRESS_FRAMES / 2;\n const p =\n framesSinceClick < half\n ? framesSinceClick / half\n : 1 - (framesSinceClick - half) / half;\n return 1 - clamp01(p);\n}\n\nexport function useCursorPath(\n waypoints: CursorWaypoint[],\n opts: CursorPathOptions = {},\n): CursorStyle {\n const { speed = 1 } = opts;\n const raw = useCurrentFrame() * speed;\n return cursorPathAt(waypoints, raw, opts);\n}\n\nexport function cursorPathAt(\n waypoints: CursorWaypoint[],\n raw: number,\n opts: CursorPathOptions = {},\n): CursorStyle {\n const { defaultDuration = DEFAULT_DURATION } = opts;\n\n if (waypoints.length === 0) {\n return { x: 0, y: 0, scale: 1, rippleOpacity: 0, rippleScale: 0 };\n }\n\n const first = waypoints[0];\n\n if (raw <= first.at) {\n return {\n x: first.x,\n y: first.y,\n scale: 1,\n rippleOpacity: 0,\n rippleScale: 0,\n pressScale: 1,\n };\n }\n\n let toIndex = waypoints.length - 1;\n for (let i = 1; i < waypoints.length; i++) {\n if (waypoints[i].at > raw) {\n toIndex = i;\n break;\n }\n }\n const pastLast = raw >= waypoints[waypoints.length - 1].at;\n const to = pastLast ? waypoints[waypoints.length - 1] : waypoints[toIndex];\n const from = pastLast\n ? waypoints[waypoints.length - 1]\n : waypoints[toIndex - 1];\n\n const dur = to.duration ?? defaultDuration;\n const ease = easings[to.easing ?? \"inOut\"];\n const start = to.at - dur;\n const t = pastLast || dur <= 0 ? 1 : ease(clamp01((raw - start) / dur));\n const x = lerp(from.x, to.x, t);\n const y = lerp(from.y, to.y, t);\n\n let lastClickAt = -Infinity;\n for (const wp of waypoints) {\n if (wp.click && wp.at <= raw && wp.at > lastClickAt) lastClickAt = wp.at;\n }\n const sinceClick = lastClickAt === -Infinity ? -1 : raw - lastClickAt;\n const ripple = ripplePhase(sinceClick);\n const clickDip = clickPress(sinceClick);\n\n const holdWp = pastLast ? waypoints[waypoints.length - 1] : from;\n const heldPress = holdWp.press ? 0 : 1;\n\n const pressScale = Math.min(clickDip, heldPress);\n\n return {\n x,\n y,\n scale: 1,\n rippleOpacity: ripple.rippleOpacity,\n rippleScale: ripple.rippleScale,\n pressScale,\n };\n}\n",+ "content": "\"use client\";\n\nimport { useCurrentFrame } from \"remotion\";\nimport type { CursorStyle } from \"@/components/remocn/cursor\";\nimport { clamp01, type EasingName, easings } from \"@/lib/remocn-ui\";\n\nexport interface CursorWaypoint {\n at: number;\n x: number;\n y: number;\n duration?: number;\n click?: boolean;\n press?: boolean;\n easing?: EasingName;\n}\n\nexport const DEFAULT_DURATION = 24;\n\nexport const CLICK_FRAMES = 16;\n\nexport const PRESS_FRAMES = 8;\n\nexport interface CursorPathOptions {\n speed?: number;\n defaultDuration?: number;\n}\n\nfunction lerp(a: number, b: number, t: number): number {\n return a + (b - a) * t;\n}\n\nexport function ripplePhase(framesSinceClick: number): {\n rippleOpacity: number;\n rippleScale: number;\n} {\n if (framesSinceClick < 0 || framesSinceClick >= CLICK_FRAMES) {\n return { rippleOpacity: 0, rippleScale: 0 };\n }\n const p = clamp01(framesSinceClick / CLICK_FRAMES);\n return {\n rippleOpacity: 0.5 * (1 - p),\n rippleScale: 2.5 * easings.out(p),\n };\n}\n\nexport function clickPress(framesSinceClick: number): number {\n if (framesSinceClick < 0 || framesSinceClick >= PRESS_FRAMES) return 1;\n const half = PRESS_FRAMES / 2;\n const p =\n framesSinceClick < half\n ? framesSinceClick / half\n : 1 - (framesSinceClick - half) / half;\n return 1 - clamp01(p);\n}\n\nexport function useCursorPath(\n waypoints: CursorWaypoint[],\n opts: CursorPathOptions = {},\n): CursorStyle {\n const { speed = 1 } = opts;\n const raw = useCurrentFrame() * speed;\n return cursorPathAt(waypoints, raw, opts);\n}\n\nexport function cursorPathAt(\n waypoints: CursorWaypoint[],\n raw: number,\n opts: CursorPathOptions = {},\n): CursorStyle {\n const { defaultDuration = DEFAULT_DURATION } = opts;\n\n if (waypoints.length === 0) {\n return { x: 0, y: 0, scale: 1, rippleOpacity: 0, rippleScale: 0 };\n }\n\n const first = waypoints[0];\n\n if (raw <= first.at) {\n return {\n x: first.x,\n y: first.y,\n scale: 1,\n rippleOpacity: 0,\n rippleScale: 0,\n pressScale: 1,\n };\n }\n\n let toIndex = waypoints.length - 1;\n for (let i = 1; i < waypoints.length; i++) {\n if (waypoints[i].at > raw) {\n toIndex = i;\n break;\n }\n }\n const pastLast = raw >= waypoints[waypoints.length - 1].at;\n const to = pastLast ? waypoints[waypoints.length - 1] : waypoints[toIndex];\n const from = pastLast\n ? waypoints[waypoints.length - 1]\n : waypoints[toIndex - 1];\n\n const dur = to.duration ?? defaultDuration;\n const ease = easings[to.easing ?? \"inOut\"];\n const start = to.at - dur;\n const t = pastLast || dur <= 0 ? 1 : ease(clamp01((raw - start) / dur));\n const x = lerp(from.x, to.x, t);\n const y = lerp(from.y, to.y, t);\n\n let lastClickAt = -Infinity;\n for (const wp of waypoints) {\n if (wp.click && wp.at <= raw && wp.at > lastClickAt) lastClickAt = wp.at;\n }\n const sinceClick = lastClickAt === -Infinity ? -1 : raw - lastClickAt;\n const ripple = ripplePhase(sinceClick);\n const clickDip = clickPress(sinceClick);\n\n const holdWp = pastLast ? waypoints[waypoints.length - 1] : from;\n const heldPress = holdWp.press ? 0 : 1;\n\n const pressScale = Math.min(clickDip, heldPress);\n\n return {\n x,\n y,\n scale: 1,\n rippleOpacity: ripple.rippleOpacity,\n rippleScale: ripple.rippleScale,\n pressScale,\n };\n}\n","type": "registry:component","target": "components/remocn/use-cursor-path.ts"}diff --git a/public/r/data-flow-pipes.json b/public/r/data-flow-pipes.jsonindex 28318d38..e25a1b58 100644--- a/public/r/data-flow-pipes.json+++ b/public/r/data-flow-pipes.json@@ -7,7 +7,7 @@"files": [{"path": "registry/remocn/data-flow-pipes/index.tsx",- "content": "\"use client\";\n\nimport { interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface DataFlowNode {\n id: string;\n x: number;\n y: number;\n label?: string;\n}\n\nexport interface DataFlowEdge {\n from: string;\n to: string;\n /** Frame when the pulse on this edge starts. */\n startFrame?: number;\n}\n\nexport interface DataFlowPipesProps {\n nodes?: DataFlowNode[];\n edges?: DataFlowEdge[];\n pipeColor?: string;\n pulseColor?: string;\n pulseLength?: number;\n pulseDuration?: number;\n nodeColor?: string;\n textColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nconst DEFAULT_NODES: DataFlowNode[] = [\n { id: \"client\", x: 140, y: 360, label: \"Client\" },\n { id: \"api\", x: 460, y: 200, label: \"API\" },\n { id: \"queue\", x: 460, y: 520, label: \"Queue\" },\n { id: \"db\", x: 820, y: 360, label: \"Database\" },\n { id: \"cdn\", x: 1140, y: 200, label: \"CDN\" },\n { id: \"log\", x: 1140, y: 520, label: \"Logs\" },\n];\n\nconst DEFAULT_EDGES: DataFlowEdge[] = [\n { from: \"client\", to: \"api\", startFrame: 0 },\n { from: \"client\", to: \"queue\", startFrame: 12 },\n { from: \"api\", to: \"db\", startFrame: 24 },\n { from: \"queue\", to: \"db\", startFrame: 36 },\n { from: \"db\", to: \"cdn\", startFrame: 48 },\n { from: \"db\", to: \"log\", startFrame: 56 },\n];\n\n/**\n * Build a smooth cubic bezier path string between two points. The control\n * points are pulled toward the midpoint and offset perpendicular for natural\n * routing — straight lines look like circuit traces, curves look like data.\n */\nfunction bezierPath(a: { x: number; y: number }, b: { x: number; y: number }) {\n const dx = b.x - a.x;\n const dy = b.y - a.y;\n // Stronger horizontal handles → routes look like API/DB diagrams.\n const handle = Math.max(60, Math.abs(dx) * 0.5);\n const c1x = a.x + handle;\n const c1y = a.y;\n const c2x = b.x - handle;\n const c2y = b.y;\n return `M ${a.x} ${a.y} C ${c1x} ${c1y}, ${c2x} ${c2y}, ${b.x} ${b.y}`;\n}\n\n/**\n * Approximate arc length of a cubic bezier by sampling. Gives a stable number\n * to drive `strokeDashoffset` against — purely numeric, no DOM `getTotalLength`.\n */\nfunction bezierLength(\n a: { x: number; y: number },\n b: { x: number; y: number },\n) {\n const handle = Math.max(60, Math.abs(b.x - a.x) * 0.5);\n const c1 = { x: a.x + handle, y: a.y };\n const c2 = { x: b.x - handle, y: b.y };\n let len = 0;\n let prev = a;\n const steps = 32;\n for (let i = 1; i <= steps; i++) {\n const t = i / steps;\n const u = 1 - t;\n const p = {\n x:\n u * u * u * a.x +\n 3 * u * u * t * c1.x +\n 3 * u * t * t * c2.x +\n t * t * t * b.x,\n y:\n u * u * u * a.y +\n 3 * u * u * t * c1.y +\n 3 * u * t * t * c2.y +\n t * t * t * b.y,\n };\n len += Math.hypot(p.x - prev.x, p.y - prev.y);\n prev = p;\n }\n return len;\n}\n\nexport function DataFlowPipes({\n nodes = DEFAULT_NODES,\n edges = DEFAULT_EDGES,\n pipeColor = \"#1f1f23\",\n pulseColor = \"#22d3ee\",\n pulseLength = 60,\n pulseDuration = 36,\n nodeColor = \"#0a0a0a\",\n textColor = \"#fafafa\",\n speed = 1,\n className,\n}: DataFlowPipesProps) {\n const frame = useCurrentFrame() * speed;\n const nodeMap = new Map(nodes.map((n) => [n.id, n]));\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n fontFamily: FONT_FAMILY,\n }}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 1280 720\"\n style={{ position: \"absolute\", inset: 0 }}\n >\n {/* Static pipes */}\n {edges.map((edge, i) => {\n const a = nodeMap.get(edge.from);\n const b = nodeMap.get(edge.to);\n if (!a || !b) return null;\n const path = bezierPath(a, b);\n return (\n <path\n key={`pipe-${i}`}\n d={path}\n fill=\"none\"\n stroke={pipeColor}\n strokeWidth={3}\n strokeLinecap=\"round\"\n />\n );\n })}\n\n {/* Pulses with trailing ghosts */}\n {edges.map((edge, i) => {\n const a = nodeMap.get(edge.from);\n const b = nodeMap.get(edge.to);\n if (!a || !b) return null;\n const path = bezierPath(a, b);\n const len = bezierLength(a, b);\n const startFrame = edge.startFrame ?? 0;\n const localFrame = frame - startFrame;\n\n // Pulse offset: starts above the path (out of view), travels down\n // until the dash sits past the end. We use a wide gap (9999) so the\n // dash pattern shows exactly one bright segment.\n const offset = interpolate(\n localFrame,\n [0, pulseDuration],\n [len + pulseLength, -pulseLength],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n // Hide pulse before its start window.\n if (localFrame < 0 || localFrame > pulseDuration + 6) {\n return null;\n }\n\n return (\n <g key={`pulse-${i}`}>\n {/* Trail copies — fading and offset back along the path. */}\n {[0.15, 0.3, 0.55].map((alpha, idx) => (\n <path\n key={`trail-${idx}`}\n d={path}\n fill=\"none\"\n stroke={pulseColor}\n strokeWidth={3}\n strokeLinecap=\"round\"\n strokeDasharray={`${pulseLength} 9999`}\n strokeDashoffset={offset + (idx + 1) * 8}\n opacity={alpha}\n />\n ))}\n {/* Bright head */}\n <path\n d={path}\n fill=\"none\"\n stroke={pulseColor}\n strokeWidth={3.5}\n strokeLinecap=\"round\"\n strokeDasharray={`${pulseLength} 9999`}\n strokeDashoffset={offset}\n style={{\n filter: `drop-shadow(0 0 8px ${pulseColor})`,\n }}\n />\n </g>\n );\n })}\n </svg>\n\n {/* Nodes */}\n {nodes.map((node) => (\n <div\n key={node.id}\n style={{\n position: \"absolute\",\n left: node.x - 60,\n top: node.y - 24,\n width: 120,\n height: 48,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: nodeColor,\n color: textColor,\n border: \"1px solid rgba(255,255,255,0.08)\",\n borderRadius: 10,\n fontSize: 14,\n fontWeight: 600,\n letterSpacing: \"-0.01em\",\n boxShadow: \"0 12px 30px rgba(0,0,0,0.4)\",\n }}\n >\n {node.label ?? node.id}\n </div>\n ))}\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport { interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface DataFlowNode {\n id: string;\n x: number;\n y: number;\n label?: string;\n}\n\nexport interface DataFlowEdge {\n from: string;\n to: string;\n /** Frame when the pulse on this edge starts. */\n startFrame?: number;\n}\n\nexport interface DataFlowPipesProps {\n nodes?: DataFlowNode[];\n edges?: DataFlowEdge[];\n pipeColor?: string;\n pulseColor?: string;\n pulseLength?: number;\n pulseDuration?: number;\n nodeColor?: string;\n textColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nconst DEFAULT_NODES: DataFlowNode[] = [\n { id: \"client\", x: 140, y: 360, label: \"Client\" },\n { id: \"api\", x: 460, y: 200, label: \"API\" },\n { id: \"queue\", x: 460, y: 520, label: \"Queue\" },\n { id: \"db\", x: 820, y: 360, label: \"Database\" },\n { id: \"cdn\", x: 1140, y: 200, label: \"CDN\" },\n { id: \"log\", x: 1140, y: 520, label: \"Logs\" },\n];\n\nconst DEFAULT_EDGES: DataFlowEdge[] = [\n { from: \"client\", to: \"api\", startFrame: 0 },\n { from: \"client\", to: \"queue\", startFrame: 12 },\n { from: \"api\", to: \"db\", startFrame: 24 },\n { from: \"queue\", to: \"db\", startFrame: 36 },\n { from: \"db\", to: \"cdn\", startFrame: 48 },\n { from: \"db\", to: \"log\", startFrame: 56 },\n];\n\n/**\n * Build a smooth cubic bezier path string between two points. The control\n * points are pulled toward the midpoint and offset perpendicular for natural\n * routing — straight lines look like circuit traces, curves look like data.\n */\nfunction bezierPath(a: { x: number; y: number }, b: { x: number; y: number }) {\n const dx = b.x - a.x;\n const _dy = b.y - a.y;\n // Stronger horizontal handles → routes look like API/DB diagrams.\n const handle = Math.max(60, Math.abs(dx) * 0.5);\n const c1x = a.x + handle;\n const c1y = a.y;\n const c2x = b.x - handle;\n const c2y = b.y;\n return `M ${a.x} ${a.y} C ${c1x} ${c1y}, ${c2x} ${c2y}, ${b.x} ${b.y}`;\n}\n\n/**\n * Approximate arc length of a cubic bezier by sampling. Gives a stable number\n * to drive `strokeDashoffset` against — purely numeric, no DOM `getTotalLength`.\n */\nfunction bezierLength(\n a: { x: number; y: number },\n b: { x: number; y: number },\n) {\n const handle = Math.max(60, Math.abs(b.x - a.x) * 0.5);\n const c1 = { x: a.x + handle, y: a.y };\n const c2 = { x: b.x - handle, y: b.y };\n let len = 0;\n let prev = a;\n const steps = 32;\n for (let i = 1; i <= steps; i++) {\n const t = i / steps;\n const u = 1 - t;\n const p = {\n x:\n u * u * u * a.x +\n 3 * u * u * t * c1.x +\n 3 * u * t * t * c2.x +\n t * t * t * b.x,\n y:\n u * u * u * a.y +\n 3 * u * u * t * c1.y +\n 3 * u * t * t * c2.y +\n t * t * t * b.y,\n };\n len += Math.hypot(p.x - prev.x, p.y - prev.y);\n prev = p;\n }\n return len;\n}\n\nexport function DataFlowPipes({\n nodes = DEFAULT_NODES,\n edges = DEFAULT_EDGES,\n pipeColor = \"#1f1f23\",\n pulseColor = \"#22d3ee\",\n pulseLength = 60,\n pulseDuration = 36,\n nodeColor = \"#0a0a0a\",\n textColor = \"#fafafa\",\n speed = 1,\n className,\n}: DataFlowPipesProps) {\n const frame = useCurrentFrame() * speed;\n const nodeMap = new Map(nodes.map((n) => [n.id, n]));\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n fontFamily: FONT_FAMILY,\n }}\n >\n <svg\n width=\"100%\"\n height=\"100%\"\n viewBox=\"0 0 1280 720\"\n style={{ position: \"absolute\", inset: 0 }}\n >\n {/* Static pipes */}\n {edges.map((edge, i) => {\n const a = nodeMap.get(edge.from);\n const b = nodeMap.get(edge.to);\n if (!a || !b) return null;\n const path = bezierPath(a, b);\n return (\n <path\n key={`pipe-${i}`}\n d={path}\n fill=\"none\"\n stroke={pipeColor}\n strokeWidth={3}\n strokeLinecap=\"round\"\n />\n );\n })}\n\n {/* Pulses with trailing ghosts */}\n {edges.map((edge, i) => {\n const a = nodeMap.get(edge.from);\n const b = nodeMap.get(edge.to);\n if (!a || !b) return null;\n const path = bezierPath(a, b);\n const len = bezierLength(a, b);\n const startFrame = edge.startFrame ?? 0;\n const localFrame = frame - startFrame;\n\n // Pulse offset: starts above the path (out of view), travels down\n // until the dash sits past the end. We use a wide gap (9999) so the\n // dash pattern shows exactly one bright segment.\n const offset = interpolate(\n localFrame,\n [0, pulseDuration],\n [len + pulseLength, -pulseLength],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n // Hide pulse before its start window.\n if (localFrame < 0 || localFrame > pulseDuration + 6) {\n return null;\n }\n\n return (\n <g key={`pulse-${i}`}>\n {/* Trail copies — fading and offset back along the path. */}\n {[0.15, 0.3, 0.55].map((alpha, idx) => (\n <path\n key={`trail-${idx}`}\n d={path}\n fill=\"none\"\n stroke={pulseColor}\n strokeWidth={3}\n strokeLinecap=\"round\"\n strokeDasharray={`${pulseLength} 9999`}\n strokeDashoffset={offset + (idx + 1) * 8}\n opacity={alpha}\n />\n ))}\n {/* Bright head */}\n <path\n d={path}\n fill=\"none\"\n stroke={pulseColor}\n strokeWidth={3.5}\n strokeLinecap=\"round\"\n strokeDasharray={`${pulseLength} 9999`}\n strokeDashoffset={offset}\n style={{\n filter: `drop-shadow(0 0 8px ${pulseColor})`,\n }}\n />\n </g>\n );\n })}\n </svg>\n\n {/* Nodes */}\n {nodes.map((node) => (\n <div\n key={node.id}\n style={{\n position: \"absolute\",\n left: node.x - 60,\n top: node.y - 24,\n width: 120,\n height: 48,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: nodeColor,\n color: textColor,\n border: \"1px solid rgba(255,255,255,0.08)\",\n borderRadius: 10,\n fontSize: 14,\n fontWeight: 600,\n letterSpacing: \"-0.01em\",\n boxShadow: \"0 12px 30px rgba(0,0,0,0.4)\",\n }}\n >\n {node.label ?? node.id}\n </div>\n ))}\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/data-flow-pipes.tsx"}diff --git a/public/r/dialog.json b/public/r/dialog.jsonindex 1128ad50..482f05b3 100644--- a/public/r/dialog.json+++ b/public/r/dialog.json@@ -14,7 +14,7 @@},{"path": "registry/remocn-ui/dialog/use-dialog-transition.ts",- "content": "\"use client\";\n\nimport {\n easings,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\nimport {\n dialogStyle,\n dialogStyleContext,\n type DialogState,\n type DialogStyle,\n} from \"@/components/remocn/dialog\";\n\nexport const DEFAULT_DURATION = 12;\n\nexport function tweenDialogStyle(\n a: DialogStyle,\n b: DialogStyle,\n t: number,\n): DialogStyle {\n return {\n overlayOpacity: a.overlayOpacity + (b.overlayOpacity - a.overlayOpacity) * t,\n popupOpacity: a.popupOpacity + (b.popupOpacity - a.popupOpacity) * t,\n popupScale: a.popupScale + (b.popupScale - a.popupScale) * t,\n popupTranslateY:\n a.popupTranslateY + (b.popupTranslateY - a.popupTranslateY) * t,\n };\n}\n\nexport interface DialogTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useDialogTransition(\n steps: Step<DialogState>[],\n opts: DialogTransitionOptions = {},\n): DialogStyle {\n const {\n theme: themeOverride,\n mode,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = dialogStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"closed\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenDialogStyle(dialogStyle(from, ctx), dialogStyle(to, ctx), t);\n}\n",+ "content": "\"use client\";\n\nimport {\n type DialogState,\n type DialogStyle,\n dialogStyle,\n dialogStyleContext,\n} from \"@/components/remocn/dialog\";\nimport {\n easings,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\n\nexport const DEFAULT_DURATION = 12;\n\nexport function tweenDialogStyle(\n a: DialogStyle,\n b: DialogStyle,\n t: number,\n): DialogStyle {\n return {\n overlayOpacity:\n a.overlayOpacity + (b.overlayOpacity - a.overlayOpacity) * t,\n popupOpacity: a.popupOpacity + (b.popupOpacity - a.popupOpacity) * t,\n popupScale: a.popupScale + (b.popupScale - a.popupScale) * t,\n popupTranslateY:\n a.popupTranslateY + (b.popupTranslateY - a.popupTranslateY) * t,\n };\n}\n\nexport interface DialogTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useDialogTransition(\n steps: Step<DialogState>[],\n opts: DialogTransitionOptions = {},\n): DialogStyle {\n const {\n theme: themeOverride,\n mode,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = dialogStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"closed\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenDialogStyle(dialogStyle(from, ctx), dialogStyle(to, ctx), t);\n}\n","type": "registry:component","target": "components/remocn/use-dialog-transition.ts"}diff --git a/public/r/dither-dissolve.json b/public/r/dither-dissolve.jsonindex c5a65e46..c34dabed 100644--- a/public/r/dither-dissolve.json+++ b/public/r/dither-dissolve.json@@ -8,7 +8,7 @@"files": [{"path": "registry/remocn/dither-dissolve/index.tsx",- "content": "\"use client\";\n\nimport type React from \"react\";\nimport { AbsoluteFill, interpolate } from \"remotion\";\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport { ShaderDithering } from \"@/components/remocn/shader-dithering\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst coverEnvelope = (p: number) =>\n interpolate(p, [0, 0.3, 0.65, 1], [0, 1, 1, 0], clampOpts);\n\nconst coverChildOpacity = (p: number, entering: boolean) =>\n entering\n ? interpolate(p, [0.58, 0.66], [0, 1], clampOpts)\n : interpolate(p, [0.28, 0.36], [1, 0], clampOpts);\n\ntype DitherShape = NonNullable<\n React.ComponentProps<typeof ShaderDithering>[\"shape\"]\n>;\n\nexport type DitherDissolveProps = {\n colorBack?: string;\n colorFront?: string;\n shape?: DitherShape;\n speed?: number;\n};\n\nconst DitherDissolvePresentation: React.FC<\n TransitionPresentationComponentProps<DitherDissolveProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n colorBack = \"#141318\",\n colorFront = \"#8f88ae\",\n shape = \"simplex\",\n speed = 1.5,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n const size = interpolate(p, [0, 1], [1.6, 2.8], clampOpts);\n\n return (\n <AbsoluteFill>\n <AbsoluteFill style={{ opacity: coverChildOpacity(p, entering) }}>\n {children}\n </AbsoluteFill>\n {entering ? (\n <AbsoluteFill\n style={{ opacity: coverEnvelope(p), pointerEvents: \"none\" }}\n >\n <ShaderDithering\n speed={speed}\n colorBack={colorBack}\n colorFront={colorFront}\n shape={shape}\n size={size}\n />\n </AbsoluteFill>\n ) : null}\n </AbsoluteFill>\n );\n};\n\nexport function ditherDissolve(\n props: DitherDissolveProps = {},\n): TransitionPresentation<DitherDissolveProps> {\n return {\n component: DitherDissolvePresentation,\n props,\n };\n}\n",+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, interpolate } from \"remotion\";\nimport { ShaderDithering } from \"@/components/remocn/shader-dithering\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst coverEnvelope = (p: number) =>\n interpolate(p, [0, 0.3, 0.65, 1], [0, 1, 1, 0], clampOpts);\n\nconst coverChildOpacity = (p: number, entering: boolean) =>\n entering\n ? interpolate(p, [0.58, 0.66], [0, 1], clampOpts)\n : interpolate(p, [0.28, 0.36], [1, 0], clampOpts);\n\ntype DitherShape = NonNullable<\n React.ComponentProps<typeof ShaderDithering>[\"shape\"]\n>;\n\nexport type DitherDissolveProps = {\n colorBack?: string;\n colorFront?: string;\n shape?: DitherShape;\n speed?: number;\n};\n\nconst DitherDissolvePresentation: React.FC<\n TransitionPresentationComponentProps<DitherDissolveProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n colorBack = \"#141318\",\n colorFront = \"#8f88ae\",\n shape = \"simplex\",\n speed = 1.5,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n const size = interpolate(p, [0, 1], [1.6, 2.8], clampOpts);\n\n return (\n <AbsoluteFill>\n <AbsoluteFill style={{ opacity: coverChildOpacity(p, entering) }}>\n {children}\n </AbsoluteFill>\n {entering ? (\n <AbsoluteFill\n style={{ opacity: coverEnvelope(p), pointerEvents: \"none\" }}\n >\n <ShaderDithering\n speed={speed}\n colorBack={colorBack}\n colorFront={colorFront}\n shape={shape}\n size={size}\n />\n </AbsoluteFill>\n ) : null}\n </AbsoluteFill>\n );\n};\n\nexport function ditherDissolve(\n props: DitherDissolveProps = {},\n): TransitionPresentation<DitherDissolveProps> {\n return {\n component: DitherDissolvePresentation,\n props,\n };\n}\n","type": "registry:component","target": "components/remocn/dither-dissolve.tsx"}diff --git a/public/r/drawer.json b/public/r/drawer.jsonindex 5c0634a3..77097f27 100644--- a/public/r/drawer.json+++ b/public/r/drawer.json@@ -14,7 +14,7 @@},{"path": "registry/remocn-ui/drawer/use-drawer-transition.ts",- "content": "\"use client\";\n\nimport {\n easings,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\nimport {\n drawerStyle,\n drawerStyleContext,\n type DrawerState,\n type DrawerStyle,\n} from \"@/components/remocn/drawer\";\n\nexport const DEFAULT_DURATION = 12;\n\nexport function tweenDrawerStyle(\n a: DrawerStyle,\n b: DrawerStyle,\n t: number,\n): DrawerStyle {\n return {\n overlayOpacity: a.overlayOpacity + (b.overlayOpacity - a.overlayOpacity) * t,\n panelOpacity: a.panelOpacity + (b.panelOpacity - a.panelOpacity) * t,\n panelTranslateY:\n a.panelTranslateY + (b.panelTranslateY - a.panelTranslateY) * t,\n };\n}\n\nexport interface DrawerTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useDrawerTransition(\n steps: Step<DrawerState>[],\n opts: DrawerTransitionOptions = {},\n): DrawerStyle {\n const {\n theme: themeOverride,\n mode,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = drawerStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"closed\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenDrawerStyle(drawerStyle(from, ctx), drawerStyle(to, ctx), t);\n}\n",+ "content": "\"use client\";\n\nimport {\n type DrawerState,\n type DrawerStyle,\n drawerStyle,\n drawerStyleContext,\n} from \"@/components/remocn/drawer\";\nimport {\n easings,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\n\nexport const DEFAULT_DURATION = 12;\n\nexport function tweenDrawerStyle(\n a: DrawerStyle,\n b: DrawerStyle,\n t: number,\n): DrawerStyle {\n return {\n overlayOpacity:\n a.overlayOpacity + (b.overlayOpacity - a.overlayOpacity) * t,\n panelOpacity: a.panelOpacity + (b.panelOpacity - a.panelOpacity) * t,\n panelTranslateY:\n a.panelTranslateY + (b.panelTranslateY - a.panelTranslateY) * t,\n };\n}\n\nexport interface DrawerTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useDrawerTransition(\n steps: Step<DrawerState>[],\n opts: DrawerTransitionOptions = {},\n): DrawerStyle {\n const {\n theme: themeOverride,\n mode,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = drawerStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"closed\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenDrawerStyle(drawerStyle(from, ctx), drawerStyle(to, ctx), t);\n}\n","type": "registry:component","target": "components/remocn/use-drawer-transition.ts"}diff --git a/public/r/dropdown-menu-item.json b/public/r/dropdown-menu-item.jsonindex e4244463..9a3c5640 100644--- a/public/r/dropdown-menu-item.json+++ b/public/r/dropdown-menu-item.json@@ -14,7 +14,7 @@},{"path": "registry/remocn-ui/dropdown-menu-item/use-dropdown-menu-item-transition.ts",- "content": "\"use client\";\n\nimport {\n easings,\n mixOklch,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\nimport {\n dropdownMenuItemStyle,\n dropdownMenuItemStyleContext,\n type DropdownMenuItemState,\n type DropdownMenuItemStyle,\n} from \"@/components/remocn/dropdown-menu-item\";\n\nexport const DEFAULT_DURATION = 8;\n\nexport function tweenDropdownMenuItemStyle(\n a: DropdownMenuItemStyle,\n b: DropdownMenuItemStyle,\n t: number,\n): DropdownMenuItemStyle {\n return {\n scale: a.scale + (b.scale - a.scale) * t,\n background: mixOklch(a.background, b.background, t),\n labelColor: mixOklch(a.labelColor, b.labelColor, t),\n };\n}\n\nexport interface DropdownMenuItemTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n primary?: string;\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useDropdownMenuItemTransition(\n steps: Step<DropdownMenuItemState>[],\n opts: DropdownMenuItemTransitionOptions = {},\n): DropdownMenuItemStyle {\n const {\n theme: themeOverride,\n mode,\n primary,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(\n { ...themeOverride, ...(primary ? { primary } : {}) },\n mode,\n );\n const ctx = dropdownMenuItemStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"idle\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenDropdownMenuItemStyle(\n dropdownMenuItemStyle(from, ctx),\n dropdownMenuItemStyle(to, ctx),\n t,\n );\n}\n",+ "content": "\"use client\";\n\nimport {\n type DropdownMenuItemState,\n type DropdownMenuItemStyle,\n dropdownMenuItemStyle,\n dropdownMenuItemStyleContext,\n} from \"@/components/remocn/dropdown-menu-item\";\nimport {\n easings,\n mixOklch,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\n\nexport const DEFAULT_DURATION = 8;\n\nexport function tweenDropdownMenuItemStyle(\n a: DropdownMenuItemStyle,\n b: DropdownMenuItemStyle,\n t: number,\n): DropdownMenuItemStyle {\n return {\n scale: a.scale + (b.scale - a.scale) * t,\n background: mixOklch(a.background, b.background, t),\n labelColor: mixOklch(a.labelColor, b.labelColor, t),\n };\n}\n\nexport interface DropdownMenuItemTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n primary?: string;\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useDropdownMenuItemTransition(\n steps: Step<DropdownMenuItemState>[],\n opts: DropdownMenuItemTransitionOptions = {},\n): DropdownMenuItemStyle {\n const {\n theme: themeOverride,\n mode,\n primary,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(\n { ...themeOverride, ...(primary ? { primary } : {}) },\n mode,\n );\n const ctx = dropdownMenuItemStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"idle\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenDropdownMenuItemStyle(\n dropdownMenuItemStyle(from, ctx),\n dropdownMenuItemStyle(to, ctx),\n t,\n );\n}\n","type": "registry:component","target": "components/remocn/use-dropdown-menu-item-transition.ts"}diff --git a/public/r/dropdown-menu.json b/public/r/dropdown-menu.jsonindex fcf10e1d..826f6080 100644--- a/public/r/dropdown-menu.json+++ b/public/r/dropdown-menu.json@@ -12,13 +12,13 @@"files": [{"path": "registry/remocn-ui/dropdown-menu/index.tsx",- "content": "\"use client\";\n\nimport {\n buttonStyle,\n buttonStyleContext,\n type ButtonStyle,\n type ButtonStyleContext,\n} from \"@/components/remocn/button\";\nimport {\n DropdownMenuItemRow,\n dropdownMenuItemStyle,\n dropdownMenuItemStyleContext,\n type DropdownMenuItemStyle,\n type DropdownMenuItemStyleContext,\n} from \"@/components/remocn/dropdown-menu-item\";\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type DropdownMenuState = \"opened\" | \"closed\";\n\nexport interface DropdownMenuStyle {\n panelOpacity: number;\n panelScale: number;\n panelTranslateY: number;\n chevronRotation: number;\n}\n\nexport interface DropdownMenuStyleContext {\n triggerCtx: ButtonStyleContext;\n panelBg: string;\n panelBorder: string;\n triggerFg: string;\n mutedFg: string;\n radius: number;\n itemCtx: DropdownMenuItemStyleContext;\n}\n\nexport function dropdownMenuStyleContext(\n theme: RemocnTheme,\n): DropdownMenuStyleContext {\n return {\n triggerCtx: buttonStyleContext(\"outline\", theme),\n panelBg: theme.popover,\n panelBorder: theme.border,\n triggerFg: theme.foreground,\n mutedFg: theme.mutedForeground,\n radius: theme.radius,\n itemCtx: dropdownMenuItemStyleContext(theme),\n };\n}\n\nexport function dropdownMenuStyle(\n state: DropdownMenuState,\n _ctx: DropdownMenuStyleContext,\n): DropdownMenuStyle {\n switch (state) {\n case \"opened\":\n return {\n panelOpacity: 1,\n panelScale: 1,\n panelTranslateY: 0,\n chevronRotation: 180,\n };\n default:\n return {\n panelOpacity: 0,\n panelScale: 0.96,\n panelTranslateY: -4,\n chevronRotation: 0,\n };\n }\n}\n\nconst WIDTH = 240;\n\nexport interface DropdownMenuProps {\n state?: DropdownMenuState;\n style?: DropdownMenuStyle;\n label?: string;\n items?: string[];\n highlightedIndex?: number;\n pressedIndex?: number;\n itemStyles?: (DropdownMenuItemStyle | undefined)[];\n triggerStyle?: ButtonStyle;\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nexport function DropdownMenu({\n state = \"closed\",\n style,\n label = \"Options\",\n items = [\"Profile\", \"Billing\", \"Settings\", \"Log out\"],\n highlightedIndex = -1,\n pressedIndex = -1,\n itemStyles,\n triggerStyle,\n theme: themeOverride,\n className,\n}: DropdownMenuProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n\n const ctx = dropdownMenuStyleContext(theme);\n const v = style ?? dropdownMenuStyle(state, ctx);\n\n const trigger = triggerStyle ?? buttonStyle(\"idle\", ctx.triggerCtx);\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"flex-start\",\n justifyContent: \"center\",\n paddingTop: 220,\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div style={{ position: \"relative\", width: WIDTH }}>\n {}\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n gap: 12,\n width: WIDTH,\n height: 40,\n padding: \"0 16px\",\n fontSize: 15,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n color: ctx.triggerFg,\n background: trigger.background,\n border: `1px solid ${ctx.panelBorder}`,\n borderRadius: ctx.radius,\n transform: `translateY(${trigger.translateY}px) scale(${trigger.scale})`,\n boxSizing: \"border-box\",\n }}\n >\n <span>{label}</span>\n <svg\n width={16}\n height={16}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n style={{\n flexShrink: 0,\n transform: `rotate(${v.chevronRotation}deg)`,\n }}\n >\n <path\n d=\"M6 9l6 6 6-6\"\n stroke={ctx.mutedFg}\n strokeWidth=\"2.2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n {}\n <div\n style={{\n position: \"absolute\",\n top: 48,\n left: 0,\n width: WIDTH,\n opacity: v.panelOpacity,\n transform: `translateY(${v.panelTranslateY}px) scale(${v.panelScale})`,\n transformOrigin: \"top\",\n background: ctx.panelBg,\n border: `1px solid ${ctx.panelBorder}`,\n borderRadius: ctx.radius + 2,\n padding: 4,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 2,\n boxShadow: \"0 12px 32px -8px rgba(0,0,0,0.18)\",\n boxSizing: \"border-box\",\n }}\n >\n {items.map((item, i) => {\n const override = itemStyles?.[i];\n const rowState =\n i === pressedIndex\n ? \"press\"\n : i === highlightedIndex\n ? \"hover\"\n : \"idle\";\n const rowStyle =\n override ?? dropdownMenuItemStyle(rowState, ctx.itemCtx);\n return (\n <DropdownMenuItemRow\n key={item}\n style={rowStyle}\n label={item}\n width={WIDTH - 8}\n theme={themeOverride}\n />\n );\n })}\n </div>\n </div>\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport {\n type ButtonStyle,\n type ButtonStyleContext,\n buttonStyle,\n buttonStyleContext,\n} from \"@/components/remocn/button\";\nimport {\n DropdownMenuItemRow,\n type DropdownMenuItemStyle,\n type DropdownMenuItemStyleContext,\n dropdownMenuItemStyle,\n dropdownMenuItemStyleContext,\n} from \"@/components/remocn/dropdown-menu-item\";\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type DropdownMenuState = \"opened\" | \"closed\";\n\nexport interface DropdownMenuStyle {\n panelOpacity: number;\n panelScale: number;\n panelTranslateY: number;\n chevronRotation: number;\n}\n\nexport interface DropdownMenuStyleContext {\n triggerCtx: ButtonStyleContext;\n panelBg: string;\n panelBorder: string;\n triggerFg: string;\n mutedFg: string;\n radius: number;\n itemCtx: DropdownMenuItemStyleContext;\n}\n\nexport function dropdownMenuStyleContext(\n theme: RemocnTheme,\n): DropdownMenuStyleContext {\n return {\n triggerCtx: buttonStyleContext(\"outline\", theme),\n panelBg: theme.popover,\n panelBorder: theme.border,\n triggerFg: theme.foreground,\n mutedFg: theme.mutedForeground,\n radius: theme.radius,\n itemCtx: dropdownMenuItemStyleContext(theme),\n };\n}\n\nexport function dropdownMenuStyle(\n state: DropdownMenuState,\n _ctx: DropdownMenuStyleContext,\n): DropdownMenuStyle {\n switch (state) {\n case \"opened\":\n return {\n panelOpacity: 1,\n panelScale: 1,\n panelTranslateY: 0,\n chevronRotation: 180,\n };\n default:\n return {\n panelOpacity: 0,\n panelScale: 0.96,\n panelTranslateY: -4,\n chevronRotation: 0,\n };\n }\n}\n\nconst WIDTH = 240;\n\nexport interface DropdownMenuProps {\n state?: DropdownMenuState;\n style?: DropdownMenuStyle;\n label?: string;\n items?: string[];\n highlightedIndex?: number;\n pressedIndex?: number;\n itemStyles?: (DropdownMenuItemStyle | undefined)[];\n triggerStyle?: ButtonStyle;\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nexport function DropdownMenu({\n state = \"closed\",\n style,\n label = \"Options\",\n items = [\"Profile\", \"Billing\", \"Settings\", \"Log out\"],\n highlightedIndex = -1,\n pressedIndex = -1,\n itemStyles,\n triggerStyle,\n theme: themeOverride,\n className,\n}: DropdownMenuProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n\n const ctx = dropdownMenuStyleContext(theme);\n const v = style ?? dropdownMenuStyle(state, ctx);\n\n const trigger = triggerStyle ?? buttonStyle(\"idle\", ctx.triggerCtx);\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"flex-start\",\n justifyContent: \"center\",\n paddingTop: 220,\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div style={{ position: \"relative\", width: WIDTH }}>\n {}\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n gap: 12,\n width: WIDTH,\n height: 40,\n padding: \"0 16px\",\n fontSize: 15,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n color: ctx.triggerFg,\n background: trigger.background,\n border: `1px solid ${ctx.panelBorder}`,\n borderRadius: ctx.radius,\n transform: `translateY(${trigger.translateY}px) scale(${trigger.scale})`,\n boxSizing: \"border-box\",\n }}\n >\n <span>{label}</span>\n <svg\n width={16}\n height={16}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n style={{\n flexShrink: 0,\n transform: `rotate(${v.chevronRotation}deg)`,\n }}\n >\n <path\n d=\"M6 9l6 6 6-6\"\n stroke={ctx.mutedFg}\n strokeWidth=\"2.2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n {}\n <div\n style={{\n position: \"absolute\",\n top: 48,\n left: 0,\n width: WIDTH,\n opacity: v.panelOpacity,\n transform: `translateY(${v.panelTranslateY}px) scale(${v.panelScale})`,\n transformOrigin: \"top\",\n background: ctx.panelBg,\n border: `1px solid ${ctx.panelBorder}`,\n borderRadius: ctx.radius + 2,\n padding: 4,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 2,\n boxShadow: \"0 12px 32px -8px rgba(0,0,0,0.18)\",\n boxSizing: \"border-box\",\n }}\n >\n {items.map((item, i) => {\n const override = itemStyles?.[i];\n const rowState =\n i === pressedIndex\n ? \"press\"\n : i === highlightedIndex\n ? \"hover\"\n : \"idle\";\n const rowStyle =\n override ?? dropdownMenuItemStyle(rowState, ctx.itemCtx);\n return (\n <DropdownMenuItemRow\n key={item}\n style={rowStyle}\n label={item}\n width={WIDTH - 8}\n theme={themeOverride}\n />\n );\n })}\n </div>\n </div>\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/dropdown-menu.tsx"},{"path": "registry/remocn-ui/dropdown-menu/use-dropdown-menu-transition.ts",- "content": "\"use client\";\n\nimport {\n easings,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\nimport {\n dropdownMenuStyle,\n dropdownMenuStyleContext,\n type DropdownMenuState,\n type DropdownMenuStyle,\n} from \"@/components/remocn/dropdown-menu\";\n\nexport const DEFAULT_DURATION = 12;\n\nexport function tweenDropdownMenuStyle(\n a: DropdownMenuStyle,\n b: DropdownMenuStyle,\n t: number,\n): DropdownMenuStyle {\n return {\n panelOpacity: a.panelOpacity + (b.panelOpacity - a.panelOpacity) * t,\n panelScale: a.panelScale + (b.panelScale - a.panelScale) * t,\n panelTranslateY:\n a.panelTranslateY + (b.panelTranslateY - a.panelTranslateY) * t,\n chevronRotation:\n a.chevronRotation + (b.chevronRotation - a.chevronRotation) * t,\n };\n}\n\nexport interface DropdownMenuTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n primary?: string;\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useDropdownMenuTransition(\n steps: Step<DropdownMenuState>[],\n opts: DropdownMenuTransitionOptions = {},\n): DropdownMenuStyle {\n const {\n theme: themeOverride,\n mode,\n primary,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(\n { ...themeOverride, ...(primary ? { primary } : {}) },\n mode,\n );\n const ctx = dropdownMenuStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"closed\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenDropdownMenuStyle(\n dropdownMenuStyle(from, ctx),\n dropdownMenuStyle(to, ctx),\n t,\n );\n}\n",+ "content": "\"use client\";\n\nimport {\n type DropdownMenuState,\n type DropdownMenuStyle,\n dropdownMenuStyle,\n dropdownMenuStyleContext,\n} from \"@/components/remocn/dropdown-menu\";\nimport {\n easings,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\n\nexport const DEFAULT_DURATION = 12;\n\nexport function tweenDropdownMenuStyle(\n a: DropdownMenuStyle,\n b: DropdownMenuStyle,\n t: number,\n): DropdownMenuStyle {\n return {\n panelOpacity: a.panelOpacity + (b.panelOpacity - a.panelOpacity) * t,\n panelScale: a.panelScale + (b.panelScale - a.panelScale) * t,\n panelTranslateY:\n a.panelTranslateY + (b.panelTranslateY - a.panelTranslateY) * t,\n chevronRotation:\n a.chevronRotation + (b.chevronRotation - a.chevronRotation) * t,\n };\n}\n\nexport interface DropdownMenuTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n primary?: string;\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useDropdownMenuTransition(\n steps: Step<DropdownMenuState>[],\n opts: DropdownMenuTransitionOptions = {},\n): DropdownMenuStyle {\n const {\n theme: themeOverride,\n mode,\n primary,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(\n { ...themeOverride, ...(primary ? { primary } : {}) },\n mode,\n );\n const ctx = dropdownMenuStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"closed\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenDropdownMenuStyle(\n dropdownMenuStyle(from, ctx),\n dropdownMenuStyle(to, ctx),\n t,\n );\n}\n","type": "registry:component","target": "components/remocn/use-dropdown-menu-transition.ts"}diff --git a/public/r/field.json b/public/r/field.jsonindex 8d85c65b..2dc361b4 100644--- a/public/r/field.json+++ b/public/r/field.json@@ -8,7 +8,7 @@"files": [{"path": "registry/remocn-ui/field/index.tsx",- "content": "\"use client\";\n\nimport type { CSSProperties, ReactNode } from \"react\";\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport interface FieldGroupProps {\n children: ReactNode;\n gap?: number;\n style?: CSSProperties;\n}\n\nexport function FieldGroup({ children, gap = 16, style }: FieldGroupProps) {\n return (\n <div style={{ display: \"flex\", flexDirection: \"column\", gap, ...style }}>\n {children}\n </div>\n );\n}\n\nexport interface FieldProps {\n children: ReactNode;\n gap?: number;\n style?: CSSProperties;\n}\n\nexport function Field({ children, gap = 6, style }: FieldProps) {\n return (\n <div style={{ display: \"flex\", flexDirection: \"column\", gap, ...style }}>\n {children}\n </div>\n );\n}\n\nexport interface FieldLabelProps {\n children: ReactNode;\n theme?: Partial<RemocnTheme>;\n style?: CSSProperties;\n}\n\nexport function FieldLabel({ children, theme, style }: FieldLabelProps) {\n const t = useRemocnTheme(theme, \"light\");\n return (\n <div\n style={{\n fontSize: 13,\n lineHeight: \"18px\",\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n color: t.foreground,\n ...style,\n }}\n >\n {children}\n </div>\n );\n}\n\nexport interface FieldDescriptionProps {\n children: ReactNode;\n align?: \"start\" | \"center\";\n theme?: Partial<RemocnTheme>;\n style?: CSSProperties;\n}\n\nexport function FieldDescription({\n children,\n align = \"start\",\n theme,\n style,\n}: FieldDescriptionProps) {\n const t = useRemocnTheme(theme, \"light\");\n return (\n <div\n style={{\n fontSize: 12,\n lineHeight: \"16px\",\n color: t.mutedForeground,\n textAlign: align === \"center\" ? \"center\" : \"left\",\n ...style,\n }}\n >\n {children}\n </div>\n );\n}\n\nexport interface FieldControlProps {\n children: ReactNode;\n height?: number;\n style?: CSSProperties;\n}\n\nexport function FieldControl({ children, height = 40, style }: FieldControlProps) {\n return (\n <div style={{ position: \"relative\", height, ...style }}>{children}</div>\n );\n}\n",+ "content": "\"use client\";\n\nimport type { CSSProperties, ReactNode } from \"react\";\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport interface FieldGroupProps {\n children: ReactNode;\n gap?: number;\n style?: CSSProperties;\n}\n\nexport function FieldGroup({ children, gap = 16, style }: FieldGroupProps) {\n return (\n <div style={{ display: \"flex\", flexDirection: \"column\", gap, ...style }}>\n {children}\n </div>\n );\n}\n\nexport interface FieldProps {\n children: ReactNode;\n gap?: number;\n style?: CSSProperties;\n}\n\nexport function Field({ children, gap = 6, style }: FieldProps) {\n return (\n <div style={{ display: \"flex\", flexDirection: \"column\", gap, ...style }}>\n {children}\n </div>\n );\n}\n\nexport interface FieldLabelProps {\n children: ReactNode;\n theme?: Partial<RemocnTheme>;\n style?: CSSProperties;\n}\n\nexport function FieldLabel({ children, theme, style }: FieldLabelProps) {\n const t = useRemocnTheme(theme, \"light\");\n return (\n <div\n style={{\n fontSize: 13,\n lineHeight: \"18px\",\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n color: t.foreground,\n ...style,\n }}\n >\n {children}\n </div>\n );\n}\n\nexport interface FieldDescriptionProps {\n children: ReactNode;\n align?: \"start\" | \"center\";\n theme?: Partial<RemocnTheme>;\n style?: CSSProperties;\n}\n\nexport function FieldDescription({\n children,\n align = \"start\",\n theme,\n style,\n}: FieldDescriptionProps) {\n const t = useRemocnTheme(theme, \"light\");\n return (\n <div\n style={{\n fontSize: 12,\n lineHeight: \"16px\",\n color: t.mutedForeground,\n textAlign: align === \"center\" ? \"center\" : \"left\",\n ...style,\n }}\n >\n {children}\n </div>\n );\n}\n\nexport interface FieldControlProps {\n children: ReactNode;\n height?: number;\n style?: CSSProperties;\n}\n\nexport function FieldControl({\n children,\n height = 40,\n style,\n}: FieldControlProps) {\n return (\n <div style={{ position: \"relative\", height, ...style }}>{children}</div>\n );\n}\n","type": "registry:component","target": "components/remocn/field.tsx"}diff --git a/public/r/focus-pull.json b/public/r/focus-pull.jsonindex dd7c8b4b..edce11bf 100644--- a/public/r/focus-pull.json+++ b/public/r/focus-pull.json@@ -7,7 +7,7 @@"files": [{"path": "registry/remocn/focus-pull/index.tsx",- "content": "\"use client\";\n\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nexport type FocusPullProps = {\n blur?: number;\n};\n\nconst FocusPullPresentation: React.FC<\n TransitionPresentationComponentProps<FocusPullProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const { blur = 16 } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n if (!entering) {\n const exitStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.42, 0.68], [1, 0], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n }),\n transform: `scale(${interpolate(p, [0, 0.6], [1, 1.05], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n })})`,\n filter: `blur(${interpolate(p, [0.05, 0.55], [0, blur], {\n ...clampOpts,\n easing: Easing.in(Easing.quad),\n })}px) brightness(${interpolate(p, [0.1, 0.55], [1, 1.3], clampOpts)})`,\n };\n return <AbsoluteFill style={exitStyle}>{children}</AbsoluteFill>;\n }\n\n const childStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.32, 0.52], [0, 1], clampOpts),\n transform: `scale(${interpolate(p, [0.35, 1], [0.97, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.35, 0.9], [blur, 0], {\n ...clampOpts,\n easing: Easing.out(Easing.quad),\n })}px) brightness(${interpolate(p, [0.4, 0.85], [1.25, 1], clampOpts)})`,\n };\n\n return <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>;\n};\n\nexport function focusPull(\n props: FocusPullProps = {},\n): TransitionPresentation<FocusPullProps> {\n return {\n component: FocusPullPresentation,\n props,\n };\n}\n",+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nexport type FocusPullProps = {\n blur?: number;\n};\n\nconst FocusPullPresentation: React.FC<\n TransitionPresentationComponentProps<FocusPullProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const { blur = 16 } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n if (!entering) {\n const exitStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.42, 0.68], [1, 0], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n }),\n transform: `scale(${interpolate(p, [0, 0.6], [1, 1.05], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n })})`,\n filter: `blur(${interpolate(p, [0.05, 0.55], [0, blur], {\n ...clampOpts,\n easing: Easing.in(Easing.quad),\n })}px) brightness(${interpolate(p, [0.1, 0.55], [1, 1.3], clampOpts)})`,\n };\n return <AbsoluteFill style={exitStyle}>{children}</AbsoluteFill>;\n }\n\n const childStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.32, 0.52], [0, 1], clampOpts),\n transform: `scale(${interpolate(p, [0.35, 1], [0.97, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.35, 0.9], [blur, 0], {\n ...clampOpts,\n easing: Easing.out(Easing.quad),\n })}px) brightness(${interpolate(p, [0.4, 0.85], [1.25, 1], clampOpts)})`,\n };\n\n return <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>;\n};\n\nexport function focusPull(\n props: FocusPullProps = {},\n): TransitionPresentation<FocusPullProps> {\n return {\n component: FocusPullPresentation,\n props,\n };\n}\n","type": "registry:component","target": "components/remocn/focus-pull.tsx"}diff --git a/public/r/github-sponsors.json b/public/r/github-sponsors.jsonindex 8bb1343f..c0a04288 100644--- a/public/r/github-sponsors.json+++ b/public/r/github-sponsors.json@@ -8,7 +8,7 @@"files": [{"path": "registry/remocn/github-sponsors/index.tsx",- "content": "\"use client\";\n\nimport { memo, useMemo, useState } from \"react\";\nimport { loadFont as loadSans } from \"@remotion/google-fonts/Manrope\";\nimport {\n AbsoluteFill,\n Easing,\n Img,\n interpolate,\n Sequence,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nimport { SoftBlurIn } from \"@/components/remocn/soft-blur-in\";\nimport { BlurOutUp } from \"@/components/remocn/blur-out-up\";\n\nexport interface Sponsor {\n login: string;\n avatarUrl: string;\n}\n\nexport interface GitHubSponsorsProps {\n account?: string;\n sponsors?: Sponsor[];\n accentColor?: string;\n speed?: number;\n theme?: \"light\" | \"dark\";\n}\n\nexport const SAMPLE_SPONSORS: Sponsor[] = [\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n },\n {\n login: \"schacon\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/70?v=4\",\n },\n {\n login: \"rtomayko\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/5?v=4\",\n },\n {\n login: \"bmizerany\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/6?v=4\",\n },\n {\n login: \"atmos\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/38?v=4\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n },\n {\n login: \"macournoyer\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/15?v=4\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n },\n {\n login: \"uggedal\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/16?v=4\",\n },\n {\n login: \"anotherjesse\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/9?v=4\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n },\n {\n login: \"takeo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/22?v=4\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n },\n {\n login: \"kballard\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/7?v=4\",\n },\n {\n login: \"jnewland\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/12?v=4\",\n },\n {\n login: \"caged\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/13?v=4\",\n },\n { login: \"sr\", avatarUrl: \"https://avatars.githubusercontent.com/u/19?v=4\" },\n];\n\nconst { fontFamily: SANS_FAMILY } = loadSans();\nconst FONT_FAMILY = SANS_FAMILY;\n\nconst HEART_PATH =\n \"M12.0001 4.52853C14.2745 2.23823 17.9866 2.23823 20.2611 4.52853C22.5784 6.86156 22.5784 10.667 20.2611 13.0001L12.0001 21.3199L3.73907 13.0001C1.42175 10.667 1.42175 6.86156 3.73907 4.52853C6.01353 2.23823 9.72563 2.23823 12.0001 4.52853Z\";\n\nconst REF_W = 1280;\nconst REF_H = 720;\nconst GRID_CX = 640;\nconst GRID_CY = 304;\nconst GRID_BOX_W = 900;\nconst GRID_BOX_H = 236;\nconst HEART_START_Y = 286;\nconst HEART_HEADER_Y = 120;\n\nconst DRAW_END = 40;\nconst PULSE_END = 62;\nconst HEART_DOCK_START = 52;\nconst HEART_DOCK_END = 84;\nconst AVATAR_START = 70;\nconst AVATAR_STEP = 3;\nconst AVATAR_DUR = 22;\nconst AVATAR_WINDOW = 56;\nconst THANK_START = 150;\nconst SUB_START = 166;\nconst CTA_START = 182;\nconst CTA_DUR = 22;\n\ninterface Theme {\n bg: string;\n bgSubtle: string;\n fg: string;\n fgMuted: string;\n border: string;\n}\n\nconst THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n bg: \"#ffffff\",\n bgSubtle: \"#fafafa\",\n fg: \"#171717\",\n fgMuted: \"#737373\",\n border: \"#ededed\",\n },\n dark: {\n bg: \"#0a0a0a\",\n bgSubtle: \"#161618\",\n fg: \"#fafafa\",\n fgMuted: \"#a1a1aa\",\n border: \"#262626\",\n },\n};\n\nexport interface Point {\n x: number;\n y: number;\n}\n\nexport function gridColumns(\n count: number,\n boxW = GRID_BOX_W,\n boxH = GRID_BOX_H,\n): number {\n if (count <= 0) return 0;\n return Math.max(\n 1,\n Math.min(count, Math.round(Math.sqrt((count * boxW) / boxH))),\n );\n}\n\nexport function gridLayout(\n count: number,\n cols: number,\n cellW: number,\n cellH: number,\n cx = GRID_CX,\n cy = GRID_CY,\n): Point[] {\n if (count <= 0 || cols <= 0) return [];\n const rows = Math.ceil(count / cols);\n const out: Point[] = [];\n for (let i = 0; i < count; i++) {\n const r = Math.floor(i / cols);\n const c = i % cols;\n const rowCount = Math.min(cols, count - r * cols);\n const rowW = (rowCount - 1) * cellW;\n const x = cx - rowW / 2 + c * cellW;\n const totalH = (rows - 1) * cellH;\n const y = cy - totalH / 2 + r * cellH;\n out.push({ x, y });\n }\n return out;\n}\n\nexport function heartDrawProgress(frame: number, speed = 1): number {\n return interpolate(frame * speed, [0, DRAW_END], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.22, 1, 0.36, 1),\n });\n}\n\nexport function heartPulseScale(frame: number, speed = 1): number {\n return interpolate(\n frame * speed,\n [DRAW_END - 2, DRAW_END + 6, DRAW_END + 17, PULSE_END],\n [1, 0.9, 1.06, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.ease),\n },\n );\n}\n\nfunction ramp(\n frame: number,\n speed: number,\n start: number,\n end: number,\n easing = Easing.bezier(0.22, 1, 0.36, 1),\n): number {\n return interpolate(frame * speed, [start, end], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n}\n\nfunction Avatar({\n login,\n avatarUrl,\n size,\n theme,\n grayscale,\n}: {\n login: string;\n avatarUrl: string;\n size: number;\n theme: Theme;\n grayscale: number;\n}) {\n const [errored, setErrored] = useState(false);\n const base = {\n width: size,\n height: size,\n borderRadius: 9999,\n border: `1px solid ${theme.border}`,\n flexShrink: 0,\n filter: `grayscale(${grayscale})`,\n } as const;\n\n if (errored || !avatarUrl) {\n return (\n <div\n style={{\n ...base,\n background: theme.bgSubtle,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: theme.fgMuted,\n fontSize: size * 0.42,\n fontWeight: 600,\n fontFamily: FONT_FAMILY,\n }}\n >\n {login.charAt(0).toUpperCase()}\n </div>\n );\n }\n\n return (\n <Img\n src={avatarUrl}\n crossOrigin=\"anonymous\"\n onError={() => setErrored(true)}\n style={{ ...base, objectFit: \"cover\" }}\n />\n );\n}\n\nconst SponsorNode = memo(function SponsorNode({\n sponsor,\n cell,\n progress,\n size,\n theme,\n}: {\n sponsor: Sponsor;\n cell: Point;\n progress: number;\n size: number;\n theme: Theme;\n}) {\n const y = (1 - progress) * 14;\n const blur = (1 - progress) * 10;\n\n return (\n <div\n style={{\n position: \"absolute\",\n left: cell.x,\n top: cell.y,\n transform: `translate(-50%, -50%) translateY(${y}px)`,\n opacity: progress,\n filter: `blur(${blur}px)`,\n willChange: \"transform, opacity, filter\",\n }}\n >\n <Avatar\n login={sponsor.login}\n avatarUrl={sponsor.avatarUrl}\n size={size}\n theme={theme}\n grayscale={1 - progress}\n />\n </div>\n );\n});\n\nfunction HeartGlyph({\n size,\n accent,\n draw,\n fill,\n}: {\n size: number;\n accent: string;\n draw: number;\n fill: number;\n}) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n width={size}\n height={size}\n >\n <title>GitHub Sponsors</title>\n <path\n d={HEART_PATH}\n pathLength={1}\n fill={accent}\n fillOpacity={fill}\n stroke={accent}\n strokeWidth={1.4}\n strokeLinejoin=\"round\"\n strokeLinecap=\"round\"\n strokeDasharray={1}\n strokeDashoffset={1 - draw}\n />\n </svg>\n );\n}\n\nexport function GitHubSponsors({\n account = \"remocn\",\n sponsors = SAMPLE_SPONSORS,\n accentColor = \"#db61a2\",\n speed = 1,\n theme = \"light\",\n}: GitHubSponsorsProps) {\n const frame = useCurrentFrame();\n const { width, height } = useVideoConfig();\n const t = THEMES[theme] ?? THEMES.light;\n const stageScale = Math.min(width / REF_W, height / REF_H);\n\n const count = sponsors.length;\n const avatarStep =\n count > 1 ? Math.min(AVATAR_STEP, AVATAR_WINDOW / (count - 1)) : 0;\n const cols = gridColumns(count);\n const rows = Math.max(1, Math.ceil(count / Math.max(1, cols)));\n const cellW = GRID_BOX_W / Math.max(1, cols);\n const cellH = GRID_BOX_H / rows;\n const avatarSize = Math.min(84, Math.min(cellW, cellH) * 0.76);\n\n const cells = useMemo(\n () => gridLayout(count, cols, cellW, cellH),\n [count, cols, cellW, cellH],\n );\n\n const draw = heartDrawProgress(frame, speed);\n const fillO = ramp(frame, speed, DRAW_END - 8, PULSE_END, Easing.linear);\n const pulse = heartPulseScale(frame, speed);\n const dock = ramp(frame, speed, HEART_DOCK_START, HEART_DOCK_END);\n\n const heartBase = 168;\n const heartScale = (1 - 0.62 * dock) * pulse;\n const heartDy = (HEART_HEADER_Y - HEART_START_Y) * dock;\n\n const ctaProgress = ramp(frame, speed, CTA_START, CTA_START + CTA_DUR);\n const ctaBlur = (1 - ctaProgress) * 10;\n const ctaY = (1 - ctaProgress) * 12;\n const accountOpacity = ramp(\n frame,\n speed,\n CTA_START + 8,\n CTA_START + CTA_DUR + 8,\n );\n\n return (\n <AbsoluteFill style={{ background: t.bg }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: REF_W,\n height: REF_H,\n transform: `translate(-50%, -50%) scale(${stageScale})`,\n }}\n >\n {sponsors.map((sponsor, i) => (\n <SponsorNode\n key={`node-${sponsor.login}-${i}`}\n sponsor={sponsor}\n cell={cells[i]}\n progress={ramp(\n frame,\n speed,\n AVATAR_START + i * avatarStep,\n AVATAR_START + i * avatarStep + AVATAR_DUR,\n )}\n size={avatarSize}\n theme={t}\n />\n ))}\n\n <div\n style={{\n position: \"absolute\",\n left: GRID_CX,\n top: HEART_START_Y,\n transform: `translate(-50%, -50%) translate(0px, ${heartDy}px) scale(${heartScale})`,\n width: heartBase,\n height: heartBase,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n willChange: \"transform\",\n }}\n >\n <HeartGlyph\n size={heartBase}\n accent={accentColor}\n draw={draw}\n fill={fillO}\n />\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 444,\n width: REF_W,\n height: 84,\n }}\n >\n <Sequence from={Math.round(THANK_START / speed)} layout=\"none\">\n <SoftBlurIn\n text=\"Thank you\"\n fontSize={54}\n fontWeight={600}\n color={t.fg}\n speed={speed}\n />\n </Sequence>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 532,\n width: REF_W,\n height: 36,\n }}\n >\n <Sequence from={Math.round(SUB_START / speed)} layout=\"none\">\n <BlurOutUp\n text={`Powered by ${count} sponsors`}\n fontSize={24}\n fontWeight={500}\n color={t.fgMuted}\n speed={speed}\n />\n </Sequence>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 584,\n width: REF_W,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: 12,\n }}\n >\n <div\n style={{\n transform: `translateY(${ctaY}px)`,\n opacity: ctaProgress,\n filter: `blur(${ctaBlur}px)`,\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n padding: \"14px 26px\",\n borderRadius: 9999,\n background: accentColor,\n color: \"#ffffff\",\n fontSize: 24,\n fontWeight: 600,\n fontFamily: FONT_FAMILY,\n willChange: \"transform, opacity, filter\",\n }}\n >\n <HeartGlyph size={22} accent=\"#ffffff\" draw={1} fill={1} />\n Become a sponsor\n </div>\n <div\n style={{\n opacity: accountOpacity * 0.9,\n fontSize: 18,\n fontWeight: 400,\n color: t.fgMuted,\n fontFamily: FONT_FAMILY,\n }}\n >\n github.com/sponsors/{account}\n </div>\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n",+ "content": "\"use client\";\n\nimport { loadFont as loadSans } from \"@remotion/google-fonts/Manrope\";\nimport { memo, useMemo, useState } from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n Img,\n interpolate,\n Sequence,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { BlurOutUp } from \"@/components/remocn/blur-out-up\";\nimport { SoftBlurIn } from \"@/components/remocn/soft-blur-in\";\n\nexport interface Sponsor {\n login: string;\n avatarUrl: string;\n}\n\nexport interface GitHubSponsorsProps {\n account?: string;\n sponsors?: Sponsor[];\n accentColor?: string;\n speed?: number;\n theme?: \"light\" | \"dark\";\n}\n\nexport const SAMPLE_SPONSORS: Sponsor[] = [\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n },\n {\n login: \"schacon\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/70?v=4\",\n },\n {\n login: \"rtomayko\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/5?v=4\",\n },\n {\n login: \"bmizerany\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/6?v=4\",\n },\n {\n login: \"atmos\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/38?v=4\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n },\n {\n login: \"macournoyer\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/15?v=4\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n },\n {\n login: \"uggedal\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/16?v=4\",\n },\n {\n login: \"anotherjesse\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/9?v=4\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n },\n {\n login: \"takeo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/22?v=4\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n },\n {\n login: \"kballard\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/7?v=4\",\n },\n {\n login: \"jnewland\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/12?v=4\",\n },\n {\n login: \"caged\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/13?v=4\",\n },\n { login: \"sr\", avatarUrl: \"https://avatars.githubusercontent.com/u/19?v=4\" },\n];\n\nconst { fontFamily: SANS_FAMILY } = loadSans();\nconst FONT_FAMILY = SANS_FAMILY;\n\nconst HEART_PATH =\n \"M12.0001 4.52853C14.2745 2.23823 17.9866 2.23823 20.2611 4.52853C22.5784 6.86156 22.5784 10.667 20.2611 13.0001L12.0001 21.3199L3.73907 13.0001C1.42175 10.667 1.42175 6.86156 3.73907 4.52853C6.01353 2.23823 9.72563 2.23823 12.0001 4.52853Z\";\n\nconst REF_W = 1280;\nconst REF_H = 720;\nconst GRID_CX = 640;\nconst GRID_CY = 304;\nconst GRID_BOX_W = 900;\nconst GRID_BOX_H = 236;\nconst HEART_START_Y = 286;\nconst HEART_HEADER_Y = 120;\n\nconst DRAW_END = 40;\nconst PULSE_END = 62;\nconst HEART_DOCK_START = 52;\nconst HEART_DOCK_END = 84;\nconst AVATAR_START = 70;\nconst AVATAR_STEP = 3;\nconst AVATAR_DUR = 22;\nconst AVATAR_WINDOW = 56;\nconst THANK_START = 150;\nconst SUB_START = 166;\nconst CTA_START = 182;\nconst CTA_DUR = 22;\n\ninterface Theme {\n bg: string;\n bgSubtle: string;\n fg: string;\n fgMuted: string;\n border: string;\n}\n\nconst THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n bg: \"#ffffff\",\n bgSubtle: \"#fafafa\",\n fg: \"#171717\",\n fgMuted: \"#737373\",\n border: \"#ededed\",\n },\n dark: {\n bg: \"#0a0a0a\",\n bgSubtle: \"#161618\",\n fg: \"#fafafa\",\n fgMuted: \"#a1a1aa\",\n border: \"#262626\",\n },\n};\n\nexport interface Point {\n x: number;\n y: number;\n}\n\nexport function gridColumns(\n count: number,\n boxW = GRID_BOX_W,\n boxH = GRID_BOX_H,\n): number {\n if (count <= 0) return 0;\n return Math.max(\n 1,\n Math.min(count, Math.round(Math.sqrt((count * boxW) / boxH))),\n );\n}\n\nexport function gridLayout(\n count: number,\n cols: number,\n cellW: number,\n cellH: number,\n cx = GRID_CX,\n cy = GRID_CY,\n): Point[] {\n if (count <= 0 || cols <= 0) return [];\n const rows = Math.ceil(count / cols);\n const out: Point[] = [];\n for (let i = 0; i < count; i++) {\n const r = Math.floor(i / cols);\n const c = i % cols;\n const rowCount = Math.min(cols, count - r * cols);\n const rowW = (rowCount - 1) * cellW;\n const x = cx - rowW / 2 + c * cellW;\n const totalH = (rows - 1) * cellH;\n const y = cy - totalH / 2 + r * cellH;\n out.push({ x, y });\n }\n return out;\n}\n\nexport function heartDrawProgress(frame: number, speed = 1): number {\n return interpolate(frame * speed, [0, DRAW_END], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.22, 1, 0.36, 1),\n });\n}\n\nexport function heartPulseScale(frame: number, speed = 1): number {\n return interpolate(\n frame * speed,\n [DRAW_END - 2, DRAW_END + 6, DRAW_END + 17, PULSE_END],\n [1, 0.9, 1.06, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.inOut(Easing.ease),\n },\n );\n}\n\nfunction ramp(\n frame: number,\n speed: number,\n start: number,\n end: number,\n easing = Easing.bezier(0.22, 1, 0.36, 1),\n): number {\n return interpolate(frame * speed, [start, end], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n}\n\nfunction Avatar({\n login,\n avatarUrl,\n size,\n theme,\n grayscale,\n}: {\n login: string;\n avatarUrl: string;\n size: number;\n theme: Theme;\n grayscale: number;\n}) {\n const [errored, setErrored] = useState(false);\n const base = {\n width: size,\n height: size,\n borderRadius: 9999,\n border: `1px solid ${theme.border}`,\n flexShrink: 0,\n filter: `grayscale(${grayscale})`,\n } as const;\n\n if (errored || !avatarUrl) {\n return (\n <div\n style={{\n ...base,\n background: theme.bgSubtle,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: theme.fgMuted,\n fontSize: size * 0.42,\n fontWeight: 600,\n fontFamily: FONT_FAMILY,\n }}\n >\n {login.charAt(0).toUpperCase()}\n </div>\n );\n }\n\n return (\n <Img\n src={avatarUrl}\n crossOrigin=\"anonymous\"\n onError={() => setErrored(true)}\n style={{ ...base, objectFit: \"cover\" }}\n />\n );\n}\n\nconst SponsorNode = memo(function SponsorNode({\n sponsor,\n cell,\n progress,\n size,\n theme,\n}: {\n sponsor: Sponsor;\n cell: Point;\n progress: number;\n size: number;\n theme: Theme;\n}) {\n const y = (1 - progress) * 14;\n const blur = (1 - progress) * 10;\n\n return (\n <div\n style={{\n position: \"absolute\",\n left: cell.x,\n top: cell.y,\n transform: `translate(-50%, -50%) translateY(${y}px)`,\n opacity: progress,\n filter: `blur(${blur}px)`,\n willChange: \"transform, opacity, filter\",\n }}\n >\n <Avatar\n login={sponsor.login}\n avatarUrl={sponsor.avatarUrl}\n size={size}\n theme={theme}\n grayscale={1 - progress}\n />\n </div>\n );\n});\n\nfunction HeartGlyph({\n size,\n accent,\n draw,\n fill,\n}: {\n size: number;\n accent: string;\n draw: number;\n fill: number;\n}) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n width={size}\n height={size}\n >\n <title>GitHub Sponsors</title>\n <path\n d={HEART_PATH}\n pathLength={1}\n fill={accent}\n fillOpacity={fill}\n stroke={accent}\n strokeWidth={1.4}\n strokeLinejoin=\"round\"\n strokeLinecap=\"round\"\n strokeDasharray={1}\n strokeDashoffset={1 - draw}\n />\n </svg>\n );\n}\n\nexport function GitHubSponsors({\n account = \"remocn\",\n sponsors = SAMPLE_SPONSORS,\n accentColor = \"#db61a2\",\n speed = 1,\n theme = \"light\",\n}: GitHubSponsorsProps) {\n const frame = useCurrentFrame();\n const { width, height } = useVideoConfig();\n const t = THEMES[theme] ?? THEMES.light;\n const stageScale = Math.min(width / REF_W, height / REF_H);\n\n const count = sponsors.length;\n const avatarStep =\n count > 1 ? Math.min(AVATAR_STEP, AVATAR_WINDOW / (count - 1)) : 0;\n const cols = gridColumns(count);\n const rows = Math.max(1, Math.ceil(count / Math.max(1, cols)));\n const cellW = GRID_BOX_W / Math.max(1, cols);\n const cellH = GRID_BOX_H / rows;\n const avatarSize = Math.min(84, Math.min(cellW, cellH) * 0.76);\n\n const cells = useMemo(\n () => gridLayout(count, cols, cellW, cellH),\n [count, cols, cellW, cellH],\n );\n\n const draw = heartDrawProgress(frame, speed);\n const fillO = ramp(frame, speed, DRAW_END - 8, PULSE_END, Easing.linear);\n const pulse = heartPulseScale(frame, speed);\n const dock = ramp(frame, speed, HEART_DOCK_START, HEART_DOCK_END);\n\n const heartBase = 168;\n const heartScale = (1 - 0.62 * dock) * pulse;\n const heartDy = (HEART_HEADER_Y - HEART_START_Y) * dock;\n\n const ctaProgress = ramp(frame, speed, CTA_START, CTA_START + CTA_DUR);\n const ctaBlur = (1 - ctaProgress) * 10;\n const ctaY = (1 - ctaProgress) * 12;\n const accountOpacity = ramp(\n frame,\n speed,\n CTA_START + 8,\n CTA_START + CTA_DUR + 8,\n );\n\n return (\n <AbsoluteFill style={{ background: t.bg }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: REF_W,\n height: REF_H,\n transform: `translate(-50%, -50%) scale(${stageScale})`,\n }}\n >\n {sponsors.map((sponsor, i) => (\n <SponsorNode\n key={`node-${sponsor.login}-${i}`}\n sponsor={sponsor}\n cell={cells[i]}\n progress={ramp(\n frame,\n speed,\n AVATAR_START + i * avatarStep,\n AVATAR_START + i * avatarStep + AVATAR_DUR,\n )}\n size={avatarSize}\n theme={t}\n />\n ))}\n\n <div\n style={{\n position: \"absolute\",\n left: GRID_CX,\n top: HEART_START_Y,\n transform: `translate(-50%, -50%) translate(0px, ${heartDy}px) scale(${heartScale})`,\n width: heartBase,\n height: heartBase,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n willChange: \"transform\",\n }}\n >\n <HeartGlyph\n size={heartBase}\n accent={accentColor}\n draw={draw}\n fill={fillO}\n />\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 444,\n width: REF_W,\n height: 84,\n }}\n >\n <Sequence from={Math.round(THANK_START / speed)} layout=\"none\">\n <SoftBlurIn\n text=\"Thank you\"\n fontSize={54}\n fontWeight={600}\n color={t.fg}\n speed={speed}\n />\n </Sequence>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 532,\n width: REF_W,\n height: 36,\n }}\n >\n <Sequence from={Math.round(SUB_START / speed)} layout=\"none\">\n <BlurOutUp\n text={`Powered by ${count} sponsors`}\n fontSize={24}\n fontWeight={500}\n color={t.fgMuted}\n speed={speed}\n />\n </Sequence>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 584,\n width: REF_W,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: 12,\n }}\n >\n <div\n style={{\n transform: `translateY(${ctaY}px)`,\n opacity: ctaProgress,\n filter: `blur(${ctaBlur}px)`,\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n padding: \"14px 26px\",\n borderRadius: 9999,\n background: accentColor,\n color: \"#ffffff\",\n fontSize: 24,\n fontWeight: 600,\n fontFamily: FONT_FAMILY,\n willChange: \"transform, opacity, filter\",\n }}\n >\n <HeartGlyph size={22} accent=\"#ffffff\" draw={1} fill={1} />\n Become a sponsor\n </div>\n <div\n style={{\n opacity: accountOpacity * 0.9,\n fontSize: 18,\n fontWeight: 400,\n color: t.fgMuted,\n fontFamily: FONT_FAMILY,\n }}\n >\n github.com/sponsors/{account}\n </div>\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n","type": "registry:component","target": "components/remocn/github-sponsors.tsx"}diff --git a/public/r/github-stars.json b/public/r/github-stars.jsonindex 3771025c..9dbd11a5 100644--- a/public/r/github-stars.json+++ b/public/r/github-stars.json@@ -8,7 +8,7 @@"files": [{"path": "registry/remocn/github-stars/index.tsx",- "content": "\"use client\";\n\nimport { format, parseISO } from \"date-fns\";\nimport { memo, useMemo, useState } from \"react\";\nimport { loadFont as loadSans } from \"@remotion/google-fonts/Manrope\";\nimport { loadFont as loadMono } from \"@remotion/google-fonts/GeistMono\";\nimport {\n AbsoluteFill,\n Easing,\n Img,\n interpolate,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Odometer } from \"@/components/remocn/number-wheel\";\n\nexport interface Stargazer {\n login: string;\n avatarUrl: string;\n /** ISO date string, e.g. \"2021-03-04\" */\n starredAt: string;\n}\n\nexport interface GitHubStarsProps {\n repo?: string;\n totalStars?: number;\n stargazers?: Stargazer[];\n orientation?: \"horizontal\" | \"vertical\";\n accentColor?: string;\n speed?: number;\n theme?: \"light\" | \"dark\";\n repoAvatarUrl?: string;\n}\n\n/**\n * Built-in mock stargazers so the composition renders immediately from defaults\n * (own-your-code: no external data needed after `shadcn add`). Real low-id GitHub\n * avatar URLs are CORS-ok, so the docs preview shows round photos.\n */\nexport const SAMPLE_STARGAZERS: Stargazer[] = [\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n];\n\n// Load fonts INSIDE the composition (via @remotion/google-fonts, which waits for\n// the font with delayRender before rendering frames). Server renders run in a\n// bare headless Chromium with no app CSS / `--font-*` vars, so without this the\n// MP4 falls back to the default sans-serif. Manrope for UI text, JetBrains Mono\n// for the numeric star counter (odometer).\nconst { fontFamily: SANS_FAMILY } = loadSans();\nconst { fontFamily: MONO_FAMILY } = loadMono();\n\nconst FONT_FAMILY = SANS_FAMILY;\n\ninterface Theme {\n bg: string;\n bgSubtle: string;\n fg: string;\n fgMuted: string;\n border: string;\n}\n\nconst THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n bg: \"#ffffff\",\n bgSubtle: \"#fafafa\",\n fg: \"#171717\",\n fgMuted: \"#737373\",\n border: \"#ededed\",\n },\n dark: {\n bg: \"#0a0a0a\",\n bgSubtle: \"#111113\",\n fg: \"#fafafa\",\n fgMuted: \"#a1a1aa\",\n border: \"#262626\",\n },\n};\n\n// --- Pure helpers (unit-tested) -------------------------------------------\n\n/**\n * Clamp a stargazer list to at most `max` evenly-sampled keyframe rows while\n * always preserving the first and last entry. Safety net for callers that pass\n * a huge array straight into the composition.\n */\nexport function downsampleStargazers(\n stargazers: Stargazer[],\n max = 60,\n): Stargazer[] {\n const len = stargazers.length;\n if (len <= max) return stargazers;\n if (max <= 1) return len ? [stargazers[0]] : [];\n const out: Stargazer[] = [];\n for (let i = 0; i < max; i++) {\n out.push(stargazers[Math.round((i * (len - 1)) / (max - 1))]);\n }\n return out;\n}\n\nconst MAX_ELASTIC_OVERSHOOT = 0.0658; // Easing.elastic(1) peak−1 (true ≈0.0657267), rounded UP for use as a safety bound\nconst SCROLL_OVERSHOOT = 1 + MAX_ELASTIC_OVERSHOOT; // ≈1.0658\nconst MASK_SOLID_FRACTION = 0.88; // bottom fade mask is solid until 88% of viewport height\nconst COUNT_PORTION = 0.8;\n\n/** Monotonic counter ramp — mirrors the reference StarCount easing. Drives the\n * odometer, which must stay monotonic or the digit wheels roll backward. */\nexport function computeCounterProgress({\n frame,\n speed = 1,\n durationInFrames,\n}: {\n frame: number;\n speed?: number;\n durationInFrames: number;\n}): number {\n return interpolate(\n frame * speed,\n [0, durationInFrames * COUNT_PORTION],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.5, 1, 0.5, 1),\n },\n );\n}\n\n/** Elastic scroll ramp — mirrors the reference avatar slide. NON-monotonic:\n * overshoots to ~SCROLL_OVERSHOOT near t≈0.63 and settles to exactly 1 at t=1.\n * Drives only scrollY (never the odometer). */\nexport function computeScrollProgress({\n frame,\n speed = 1,\n durationInFrames,\n}: {\n frame: number;\n speed?: number;\n durationInFrames: number;\n}): number {\n return interpolate(frame * speed, [0, durationInFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.elastic(0.8),\n });\n}\n\n/** Empty rows appended below the last stargazer so the elastic recoil never\n * lifts real content off the mask-solid zone, revealing a void. Single source\n * of truth shared with isScrollContained so the two cannot drift. */\nexport function computeSpacerRows({\n N,\n rowH,\n viewportH,\n visibleRows,\n}: {\n N: number;\n rowH: number;\n viewportH: number;\n visibleRows: number;\n}): number {\n const D = Math.max(0, (N - visibleRows + 1) * rowH);\n const needPx =\n MASK_SOLID_FRACTION * viewportH - N * rowH + SCROLL_OVERSHOOT * D;\n return Math.max(0, Math.ceil(needPx / rowH));\n}\n\n/** True when, at the elastic overshoot peak, content still fills the mask-solid\n * zone (no void revealed). True by construction given computeSpacerRows. */\nexport function isScrollContained({\n N,\n rowH,\n viewportH,\n visibleRows,\n}: {\n N: number;\n rowH: number;\n viewportH: number;\n visibleRows: number;\n}): boolean {\n const D = Math.max(0, (N - visibleRows + 1) * rowH);\n const spacerPx =\n computeSpacerRows({ N, rowH, viewportH, visibleRows }) * rowH;\n return (\n N * rowH + spacerPx - SCROLL_OVERSHOOT * D >=\n MASK_SOLID_FRACTION * viewportH\n );\n}\n\n/** The running counter value for a given scroll progress. Locks at totalStars. */\nexport function getStarCount(\n scrollProgress: number,\n totalStars: number,\n): number {\n return Math.round(scrollProgress * totalStars);\n}\n\n// --- Sub-components --------------------------------------------------------\n\nfunction StarGlyph({ size, fill }: { size: number; fill: string }) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n width={size}\n height={size}\n color={fill}\n fill={fill}\n stroke={fill}\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <title>Stars</title>\n <path d=\"M13.7276 3.44418L15.4874 6.99288C15.7274 7.48687 16.3673 7.9607 16.9073 8.05143L20.0969 8.58575C22.1367 8.92853 22.6167 10.4206 21.1468 11.8925L18.6671 14.3927C18.2471 14.8161 18.0172 15.6327 18.1471 16.2175L18.8571 19.3125C19.417 21.7623 18.1271 22.71 15.9774 21.4296L12.9877 19.6452C12.4478 19.3226 11.5579 19.3226 11.0079 19.6452L8.01827 21.4296C5.8785 22.71 4.57865 21.7522 5.13859 19.3125L5.84851 16.2175C5.97849 15.6327 5.74852 14.8161 5.32856 14.3927L2.84884 11.8925C1.389 10.4206 1.85895 8.92853 3.89872 8.58575L7.08837 8.05143C7.61831 7.9607 8.25824 7.48687 8.49821 6.99288L10.258 3.44418C11.2179 1.51861 12.7777 1.51861 13.7276 3.44418Z\"></path>\n </svg>\n );\n}\n\nfunction Avatar({\n login,\n avatarUrl,\n size,\n theme,\n}: {\n login: string;\n avatarUrl: string;\n size: number;\n theme: Theme;\n}) {\n const [errored, setErrored] = useState(false);\n const ringStyle = {\n width: size,\n height: size,\n borderRadius: 9999,\n border: `1px solid ${theme.border}`,\n flexShrink: 0,\n } as const;\n\n if (errored || !avatarUrl) {\n return (\n <div\n style={{\n ...ringStyle,\n background: theme.bgSubtle,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: theme.fgMuted,\n fontSize: size * 0.42,\n fontWeight: 600,\n }}\n >\n {login.charAt(0).toUpperCase()}\n </div>\n );\n }\n\n return (\n <Img\n src={avatarUrl}\n crossOrigin=\"anonymous\"\n onError={() => setErrored(true)}\n style={{ ...ringStyle, objectFit: \"cover\" }}\n />\n );\n}\n\ninterface RowProps {\n stargazer: Stargazer;\n index: number;\n rowH: number;\n avatarSize: number;\n loginSize: number;\n dateLabel: string;\n accent: string;\n theme: Theme;\n isActive: boolean;\n settle: number;\n showSeparator: boolean;\n opacity: number;\n}\n\nconst Row = memo(function Row({\n stargazer,\n index,\n rowH,\n avatarSize,\n loginSize,\n dateLabel,\n accent,\n theme,\n isActive,\n settle,\n showSeparator,\n opacity,\n}: RowProps) {\n return (\n <div\n style={{\n position: \"relative\",\n height: rowH,\n display: \"flex\",\n alignItems: \"center\",\n paddingLeft: 24,\n paddingRight: 24,\n background: \"transparent\",\n opacity,\n boxSizing: \"border-box\",\n borderBottom:\n showSeparator && !isActive ? `1px solid ${theme.border}` : \"none\",\n }}\n >\n {isActive && (\n <>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: theme.bgSubtle,\n opacity: settle,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n bottom: 0,\n width: 2,\n background: accent,\n opacity: settle,\n }}\n />\n </>\n )}\n <div\n style={{\n position: \"relative\",\n display: \"flex\",\n alignItems: \"center\",\n width: \"100%\",\n }}\n >\n <Avatar\n login={stargazer.login}\n avatarUrl={stargazer.avatarUrl}\n size={avatarSize}\n theme={theme}\n />\n <div style={{ marginLeft: 20, minWidth: 0, flex: 1 }}>\n <div\n style={{\n fontSize: loginSize,\n fontWeight: 600,\n color: theme.fg,\n fontFamily: FONT_FAMILY,\n whiteSpace: \"nowrap\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n lineHeight: 1.2,\n }}\n >\n {stargazer.login}\n </div>\n <div\n style={{\n fontSize: 18,\n fontWeight: 400,\n color: theme.fgMuted,\n fontFamily: FONT_FAMILY,\n lineHeight: 1.3,\n }}\n >\n {dateLabel}\n </div>\n </div>\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n color: theme.fgMuted,\n fontFamily: MONO_FAMILY,\n fontSize: 18,\n fontVariantNumeric: \"tabular-nums\",\n flexShrink: 0,\n }}\n >\n <StarGlyph size={20} fill={accent} />\n <span>#{index + 1}</span>\n </div>\n </div>\n </div>\n );\n});\n\n// --- Main composition ------------------------------------------------------\n\nexport function GitHubStars({\n repo = \"remotion-dev/remotion\",\n totalStars = 24813,\n stargazers = SAMPLE_STARGAZERS,\n orientation = \"horizontal\",\n accentColor = \"#ffbb00\",\n speed = 1,\n theme = \"light\",\n repoAvatarUrl,\n}: GitHubStarsProps) {\n const frame = useCurrentFrame();\n const { durationInFrames, width, height } = useVideoConfig();\n const t = THEMES[theme] ?? THEMES.light;\n const isVertical = orientation === \"vertical\";\n\n // Render at the native reference size for the orientation, then scale to fit\n // the actual canvas — keeps proportions at any resolution and letterboxes a\n // vertical layout cleanly inside a horizontal preview canvas.\n const refW = isVertical ? 720 : 1280;\n const refH = isVertical ? 1280 : 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const rows = useMemo(() => downsampleStargazers(stargazers), [stargazers]);\n const N = rows.length;\n\n // Progress drivers: monotonic counter ramp + non-monotonic elastic scroll.\n const counterProgress = computeCounterProgress({\n frame,\n speed,\n durationInFrames,\n });\n const pScroll = computeScrollProgress({ frame, speed, durationInFrames });\n const p = Math.max(0, Math.min(1, (frame * speed) / durationInFrames));\n\n const current = counterProgress * totalStars;\n\n // List viewport geometry (in reference px).\n const rowH = isVertical ? 96 : 88;\n const avatarSize = isVertical ? 60 : 56;\n const loginSize = isVertical ? 30 : 28;\n const dateFormat = isVertical ? \"MMM yyyy\" : \"MMM d, yyyy\";\n const formattedRows = useMemo(\n () =>\n rows.map((sg) => {\n try {\n return { sg, dateLabel: format(parseISO(sg.starredAt), dateFormat) };\n } catch {\n return { sg, dateLabel: sg.starredAt };\n }\n }),\n [rows, dateFormat],\n );\n\n const viewport = isVertical\n ? { x: 48, y: 320, w: 624, h: 888, radius: 28 }\n : { x: 560, y: 60, w: 640, h: 600, radius: 24 };\n\n const visibleRows = Math.floor(viewport.h / rowH);\n const D = Math.max(0, (N - visibleRows + 1) * rowH);\n const scrollY = -pScroll * D;\n\n const spacerRows = computeSpacerRows({\n N,\n rowH,\n viewportH: viewport.h,\n visibleRows,\n });\n const spacerPx = spacerRows * rowH;\n\n const settle = interpolate(p, [0.92, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n // Counter zone type scale.\n const counterSize = isVertical ? 96 : 120;\n const starSize = isVertical ? 56 : 64;\n const underlineMax = isVertical ? 200 : 240;\n const underlineWidth = counterProgress * underlineMax;\n\n const fadeH = Math.round(viewport.h * 0.12);\n\n const listViewport = (\n <div\n style={{\n position: \"absolute\",\n left: viewport.x,\n top: viewport.y,\n width: viewport.w,\n height: viewport.h,\n overflow: \"hidden\",\n borderRadius: viewport.radius,\n border: `1px solid ${t.border}`,\n background: t.bg,\n }}\n >\n <div\n style={{\n transform: `translateY(${scrollY}px)`,\n willChange: \"transform\",\n }}\n >\n {formattedRows.map(({ sg, dateLabel }, i) => (\n <Row\n key={`${sg.login}-${i}`}\n stargazer={sg}\n index={i}\n rowH={rowH}\n avatarSize={avatarSize}\n loginSize={loginSize}\n dateLabel={dateLabel}\n accent={accentColor}\n theme={t}\n isActive={i === N - 1}\n settle={i === N - 1 ? settle : 0}\n showSeparator={i < N - 1}\n opacity={1}\n />\n ))}\n {spacerPx > 0 && (\n <div style={{ height: spacerPx }} aria-hidden=\"true\" />\n )}\n </div>\n <div\n style={{\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n height: fadeH,\n background: `linear-gradient(to bottom, ${t.bg}, transparent)`,\n pointerEvents: \"none\",\n }}\n />\n <div\n style={{\n position: \"absolute\",\n bottom: 0,\n left: 0,\n right: 0,\n height: fadeH,\n background: `linear-gradient(to top, ${t.bg}, transparent)`,\n pointerEvents: \"none\",\n }}\n />\n </div>\n );\n\n const underline = (\n <div\n style={{\n height: 4,\n width: underlineWidth,\n background: accentColor,\n borderRadius: 2,\n }}\n />\n );\n\n const repoOwner = repo.split(\"/\")[0] || repo;\n const repoAvatarSize = isVertical ? 28 : 32;\n const repoAvatarSrc =\n repoAvatarUrl ?? `https://unavatar.io/github/${repoOwner}`;\n\n const repoSlug = (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 12,\n maxWidth: isVertical ? 600 : 392,\n }}\n >\n <Avatar\n login={repoOwner}\n avatarUrl={repoAvatarSrc}\n size={repoAvatarSize}\n theme={t}\n />\n <div\n style={{\n fontSize: isVertical ? 20 : 24,\n fontWeight: 500,\n color: t.fgMuted,\n fontFamily: FONT_FAMILY,\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }}\n >\n {repo}\n </div>\n </div>\n );\n\n const counterZone = isVertical ? (\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n width: refW,\n height: 300,\n paddingTop: 72,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: 14,\n }}\n >\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 20 }}>\n <StarGlyph size={starSize} fill={accentColor} />\n <Odometer current={current} fontSize={counterSize} color={t.fg} />\n </div>\n {underline}\n {repoSlug}\n </div>\n ) : (\n <div\n style={{\n position: \"absolute\",\n left: 80,\n top: 0,\n width: 392,\n height: refH,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"center\",\n alignItems: \"flex-start\",\n }}\n >\n <StarGlyph size={starSize} fill={accentColor} />\n <div style={{ height: 20 }} />\n <Odometer current={current} fontSize={counterSize} color={t.fg} />\n <div style={{ height: 16 }} />\n {underline}\n <div style={{ height: 20 }} />\n\n {repoSlug}\n </div>\n );\n\n return (\n <AbsoluteFill style={{ background: t.bg }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n transform: `translate(-50%, -50%) scale(${stageScale})`,\n }}\n >\n {counterZone}\n {listViewport}\n </div>\n </AbsoluteFill>\n );\n}\n",+ "content": "\"use client\";\n\nimport { loadFont as loadMono } from \"@remotion/google-fonts/GeistMono\";\nimport { loadFont as loadSans } from \"@remotion/google-fonts/Manrope\";\nimport { format, parseISO } from \"date-fns\";\nimport { memo, useMemo, useState } from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n Img,\n interpolate,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Odometer } from \"@/components/remocn/number-wheel\";\n\nexport interface Stargazer {\n login: string;\n avatarUrl: string;\n /** ISO date string, e.g. \"2021-03-04\" */\n starredAt: string;\n}\n\nexport interface GitHubStarsProps {\n repo?: string;\n totalStars?: number;\n stargazers?: Stargazer[];\n orientation?: \"horizontal\" | \"vertical\";\n accentColor?: string;\n speed?: number;\n theme?: \"light\" | \"dark\";\n repoAvatarUrl?: string;\n}\n\n/**\n * Built-in mock stargazers so the composition renders immediately from defaults\n * (own-your-code: no external data needed after `shadcn add`). Real low-id GitHub\n * avatar URLs are CORS-ok, so the docs preview shows round photos.\n */\nexport const SAMPLE_STARGAZERS: Stargazer[] = [\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n {\n login: \"mojombo\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/1?v=4\",\n starredAt: \"2021-03-04\",\n },\n {\n login: \"defunkt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/2?v=4\",\n starredAt: \"2021-06-12\",\n },\n {\n login: \"pjhyett\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/3?v=4\",\n starredAt: \"2021-09-21\",\n },\n {\n login: \"wycats\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/4?v=4\",\n starredAt: \"2021-12-08\",\n },\n {\n login: \"ezmobius\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/14?v=4\",\n starredAt: \"2022-03-17\",\n },\n {\n login: \"ivey\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/18?v=4\",\n starredAt: \"2022-06-29\",\n },\n {\n login: \"evanphx\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/25?v=4\",\n starredAt: \"2022-09-14\",\n },\n {\n login: \"vanpelt\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/26?v=4\",\n starredAt: \"2022-12-23\",\n },\n {\n login: \"wayneeseguin\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/28?v=4\",\n starredAt: \"2023-03-09\",\n },\n {\n login: \"brynary\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/30?v=4\",\n starredAt: \"2023-07-19\",\n },\n {\n login: \"kevinclark\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/31?v=4\",\n starredAt: \"2023-11-02\",\n },\n {\n login: \"technoweenie\",\n avatarUrl: \"https://avatars.githubusercontent.com/u/21?v=4\",\n starredAt: \"2024-02-15\",\n },\n];\n\n// Load fonts INSIDE the composition (via @remotion/google-fonts, which waits for\n// the font with delayRender before rendering frames). Server renders run in a\n// bare headless Chromium with no app CSS / `--font-*` vars, so without this the\n// MP4 falls back to the default sans-serif. Manrope for UI text, JetBrains Mono\n// for the numeric star counter (odometer).\nconst { fontFamily: SANS_FAMILY } = loadSans();\nconst { fontFamily: MONO_FAMILY } = loadMono();\n\nconst FONT_FAMILY = SANS_FAMILY;\n\ninterface Theme {\n bg: string;\n bgSubtle: string;\n fg: string;\n fgMuted: string;\n border: string;\n}\n\nconst THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n bg: \"#ffffff\",\n bgSubtle: \"#fafafa\",\n fg: \"#171717\",\n fgMuted: \"#737373\",\n border: \"#ededed\",\n },\n dark: {\n bg: \"#0a0a0a\",\n bgSubtle: \"#111113\",\n fg: \"#fafafa\",\n fgMuted: \"#a1a1aa\",\n border: \"#262626\",\n },\n};\n\n// --- Pure helpers (unit-tested) -------------------------------------------\n\n/**\n * Clamp a stargazer list to at most `max` evenly-sampled keyframe rows while\n * always preserving the first and last entry. Safety net for callers that pass\n * a huge array straight into the composition.\n */\nexport function downsampleStargazers(\n stargazers: Stargazer[],\n max = 60,\n): Stargazer[] {\n const len = stargazers.length;\n if (len <= max) return stargazers;\n if (max <= 1) return len ? [stargazers[0]] : [];\n const out: Stargazer[] = [];\n for (let i = 0; i < max; i++) {\n out.push(stargazers[Math.round((i * (len - 1)) / (max - 1))]);\n }\n return out;\n}\n\nconst MAX_ELASTIC_OVERSHOOT = 0.0658; // Easing.elastic(1) peak−1 (true ≈0.0657267), rounded UP for use as a safety bound\nconst SCROLL_OVERSHOOT = 1 + MAX_ELASTIC_OVERSHOOT; // ≈1.0658\nconst MASK_SOLID_FRACTION = 0.88; // bottom fade mask is solid until 88% of viewport height\nconst COUNT_PORTION = 0.8;\n\n/** Monotonic counter ramp — mirrors the reference StarCount easing. Drives the\n * odometer, which must stay monotonic or the digit wheels roll backward. */\nexport function computeCounterProgress({\n frame,\n speed = 1,\n durationInFrames,\n}: {\n frame: number;\n speed?: number;\n durationInFrames: number;\n}): number {\n return interpolate(\n frame * speed,\n [0, durationInFrames * COUNT_PORTION],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.5, 1, 0.5, 1),\n },\n );\n}\n\n/** Elastic scroll ramp — mirrors the reference avatar slide. NON-monotonic:\n * overshoots to ~SCROLL_OVERSHOOT near t≈0.63 and settles to exactly 1 at t=1.\n * Drives only scrollY (never the odometer). */\nexport function computeScrollProgress({\n frame,\n speed = 1,\n durationInFrames,\n}: {\n frame: number;\n speed?: number;\n durationInFrames: number;\n}): number {\n return interpolate(frame * speed, [0, durationInFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.elastic(0.8),\n });\n}\n\n/** Empty rows appended below the last stargazer so the elastic recoil never\n * lifts real content off the mask-solid zone, revealing a void. Single source\n * of truth shared with isScrollContained so the two cannot drift. */\nexport function computeSpacerRows({\n N,\n rowH,\n viewportH,\n visibleRows,\n}: {\n N: number;\n rowH: number;\n viewportH: number;\n visibleRows: number;\n}): number {\n const D = Math.max(0, (N - visibleRows + 1) * rowH);\n const needPx =\n MASK_SOLID_FRACTION * viewportH - N * rowH + SCROLL_OVERSHOOT * D;\n return Math.max(0, Math.ceil(needPx / rowH));\n}\n\n/** True when, at the elastic overshoot peak, content still fills the mask-solid\n * zone (no void revealed). True by construction given computeSpacerRows. */\nexport function isScrollContained({\n N,\n rowH,\n viewportH,\n visibleRows,\n}: {\n N: number;\n rowH: number;\n viewportH: number;\n visibleRows: number;\n}): boolean {\n const D = Math.max(0, (N - visibleRows + 1) * rowH);\n const spacerPx =\n computeSpacerRows({ N, rowH, viewportH, visibleRows }) * rowH;\n return (\n N * rowH + spacerPx - SCROLL_OVERSHOOT * D >=\n MASK_SOLID_FRACTION * viewportH\n );\n}\n\n/** The running counter value for a given scroll progress. Locks at totalStars. */\nexport function getStarCount(\n scrollProgress: number,\n totalStars: number,\n): number {\n return Math.round(scrollProgress * totalStars);\n}\n\n// --- Sub-components --------------------------------------------------------\n\nfunction StarGlyph({ size, fill }: { size: number; fill: string }) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n width={size}\n height={size}\n color={fill}\n fill={fill}\n stroke={fill}\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <title>Stars</title>\n <path d=\"M13.7276 3.44418L15.4874 6.99288C15.7274 7.48687 16.3673 7.9607 16.9073 8.05143L20.0969 8.58575C22.1367 8.92853 22.6167 10.4206 21.1468 11.8925L18.6671 14.3927C18.2471 14.8161 18.0172 15.6327 18.1471 16.2175L18.8571 19.3125C19.417 21.7623 18.1271 22.71 15.9774 21.4296L12.9877 19.6452C12.4478 19.3226 11.5579 19.3226 11.0079 19.6452L8.01827 21.4296C5.8785 22.71 4.57865 21.7522 5.13859 19.3125L5.84851 16.2175C5.97849 15.6327 5.74852 14.8161 5.32856 14.3927L2.84884 11.8925C1.389 10.4206 1.85895 8.92853 3.89872 8.58575L7.08837 8.05143C7.61831 7.9607 8.25824 7.48687 8.49821 6.99288L10.258 3.44418C11.2179 1.51861 12.7777 1.51861 13.7276 3.44418Z\"></path>\n </svg>\n );\n}\n\nfunction Avatar({\n login,\n avatarUrl,\n size,\n theme,\n}: {\n login: string;\n avatarUrl: string;\n size: number;\n theme: Theme;\n}) {\n const [errored, setErrored] = useState(false);\n const ringStyle = {\n width: size,\n height: size,\n borderRadius: 9999,\n border: `1px solid ${theme.border}`,\n flexShrink: 0,\n } as const;\n\n if (errored || !avatarUrl) {\n return (\n <div\n style={{\n ...ringStyle,\n background: theme.bgSubtle,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: theme.fgMuted,\n fontSize: size * 0.42,\n fontWeight: 600,\n }}\n >\n {login.charAt(0).toUpperCase()}\n </div>\n );\n }\n\n return (\n <Img\n src={avatarUrl}\n crossOrigin=\"anonymous\"\n onError={() => setErrored(true)}\n style={{ ...ringStyle, objectFit: \"cover\" }}\n />\n );\n}\n\ninterface RowProps {\n stargazer: Stargazer;\n index: number;\n rowH: number;\n avatarSize: number;\n loginSize: number;\n dateLabel: string;\n accent: string;\n theme: Theme;\n isActive: boolean;\n settle: number;\n showSeparator: boolean;\n opacity: number;\n}\n\nconst Row = memo(function Row({\n stargazer,\n index,\n rowH,\n avatarSize,\n loginSize,\n dateLabel,\n accent,\n theme,\n isActive,\n settle,\n showSeparator,\n opacity,\n}: RowProps) {\n return (\n <div\n style={{\n position: \"relative\",\n height: rowH,\n display: \"flex\",\n alignItems: \"center\",\n paddingLeft: 24,\n paddingRight: 24,\n background: \"transparent\",\n opacity,\n boxSizing: \"border-box\",\n borderBottom:\n showSeparator && !isActive ? `1px solid ${theme.border}` : \"none\",\n }}\n >\n {isActive && (\n <>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: theme.bgSubtle,\n opacity: settle,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n bottom: 0,\n width: 2,\n background: accent,\n opacity: settle,\n }}\n />\n </>\n )}\n <div\n style={{\n position: \"relative\",\n display: \"flex\",\n alignItems: \"center\",\n width: \"100%\",\n }}\n >\n <Avatar\n login={stargazer.login}\n avatarUrl={stargazer.avatarUrl}\n size={avatarSize}\n theme={theme}\n />\n <div style={{ marginLeft: 20, minWidth: 0, flex: 1 }}>\n <div\n style={{\n fontSize: loginSize,\n fontWeight: 600,\n color: theme.fg,\n fontFamily: FONT_FAMILY,\n whiteSpace: \"nowrap\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n lineHeight: 1.2,\n }}\n >\n {stargazer.login}\n </div>\n <div\n style={{\n fontSize: 18,\n fontWeight: 400,\n color: theme.fgMuted,\n fontFamily: FONT_FAMILY,\n lineHeight: 1.3,\n }}\n >\n {dateLabel}\n </div>\n </div>\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n color: theme.fgMuted,\n fontFamily: MONO_FAMILY,\n fontSize: 18,\n fontVariantNumeric: \"tabular-nums\",\n flexShrink: 0,\n }}\n >\n <StarGlyph size={20} fill={accent} />\n <span>#{index + 1}</span>\n </div>\n </div>\n </div>\n );\n});\n\n// --- Main composition ------------------------------------------------------\n\nexport function GitHubStars({\n repo = \"remotion-dev/remotion\",\n totalStars = 24813,\n stargazers = SAMPLE_STARGAZERS,\n orientation = \"horizontal\",\n accentColor = \"#ffbb00\",\n speed = 1,\n theme = \"light\",\n repoAvatarUrl,\n}: GitHubStarsProps) {\n const frame = useCurrentFrame();\n const { durationInFrames, width, height } = useVideoConfig();\n const t = THEMES[theme] ?? THEMES.light;\n const isVertical = orientation === \"vertical\";\n\n // Render at the native reference size for the orientation, then scale to fit\n // the actual canvas — keeps proportions at any resolution and letterboxes a\n // vertical layout cleanly inside a horizontal preview canvas.\n const refW = isVertical ? 720 : 1280;\n const refH = isVertical ? 1280 : 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const rows = useMemo(() => downsampleStargazers(stargazers), [stargazers]);\n const N = rows.length;\n\n // Progress drivers: monotonic counter ramp + non-monotonic elastic scroll.\n const counterProgress = computeCounterProgress({\n frame,\n speed,\n durationInFrames,\n });\n const pScroll = computeScrollProgress({ frame, speed, durationInFrames });\n const p = Math.max(0, Math.min(1, (frame * speed) / durationInFrames));\n\n const current = counterProgress * totalStars;\n\n // List viewport geometry (in reference px).\n const rowH = isVertical ? 96 : 88;\n const avatarSize = isVertical ? 60 : 56;\n const loginSize = isVertical ? 30 : 28;\n const dateFormat = isVertical ? \"MMM yyyy\" : \"MMM d, yyyy\";\n const formattedRows = useMemo(\n () =>\n rows.map((sg) => {\n try {\n return { sg, dateLabel: format(parseISO(sg.starredAt), dateFormat) };\n } catch {\n return { sg, dateLabel: sg.starredAt };\n }\n }),\n [rows, dateFormat],\n );\n\n const viewport = isVertical\n ? { x: 48, y: 320, w: 624, h: 888, radius: 28 }\n : { x: 560, y: 60, w: 640, h: 600, radius: 24 };\n\n const visibleRows = Math.floor(viewport.h / rowH);\n const D = Math.max(0, (N - visibleRows + 1) * rowH);\n const scrollY = -pScroll * D;\n\n const spacerRows = computeSpacerRows({\n N,\n rowH,\n viewportH: viewport.h,\n visibleRows,\n });\n const spacerPx = spacerRows * rowH;\n\n const settle = interpolate(p, [0.92, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n // Counter zone type scale.\n const counterSize = isVertical ? 96 : 120;\n const starSize = isVertical ? 56 : 64;\n const underlineMax = isVertical ? 200 : 240;\n const underlineWidth = counterProgress * underlineMax;\n\n const fadeH = Math.round(viewport.h * 0.12);\n\n const listViewport = (\n <div\n style={{\n position: \"absolute\",\n left: viewport.x,\n top: viewport.y,\n width: viewport.w,\n height: viewport.h,\n overflow: \"hidden\",\n borderRadius: viewport.radius,\n border: `1px solid ${t.border}`,\n background: t.bg,\n }}\n >\n <div\n style={{\n transform: `translateY(${scrollY}px)`,\n willChange: \"transform\",\n }}\n >\n {formattedRows.map(({ sg, dateLabel }, i) => (\n <Row\n key={`${sg.login}-${i}`}\n stargazer={sg}\n index={i}\n rowH={rowH}\n avatarSize={avatarSize}\n loginSize={loginSize}\n dateLabel={dateLabel}\n accent={accentColor}\n theme={t}\n isActive={i === N - 1}\n settle={i === N - 1 ? settle : 0}\n showSeparator={i < N - 1}\n opacity={1}\n />\n ))}\n {spacerPx > 0 && (\n <div style={{ height: spacerPx }} aria-hidden=\"true\" />\n )}\n </div>\n <div\n style={{\n position: \"absolute\",\n top: 0,\n left: 0,\n right: 0,\n height: fadeH,\n background: `linear-gradient(to bottom, ${t.bg}, transparent)`,\n pointerEvents: \"none\",\n }}\n />\n <div\n style={{\n position: \"absolute\",\n bottom: 0,\n left: 0,\n right: 0,\n height: fadeH,\n background: `linear-gradient(to top, ${t.bg}, transparent)`,\n pointerEvents: \"none\",\n }}\n />\n </div>\n );\n\n const underline = (\n <div\n style={{\n height: 4,\n width: underlineWidth,\n background: accentColor,\n borderRadius: 2,\n }}\n />\n );\n\n const repoOwner = repo.split(\"/\")[0] || repo;\n const repoAvatarSize = isVertical ? 28 : 32;\n const repoAvatarSrc =\n repoAvatarUrl ?? `https://unavatar.io/github/${repoOwner}`;\n\n const repoSlug = (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 12,\n maxWidth: isVertical ? 600 : 392,\n }}\n >\n <Avatar\n login={repoOwner}\n avatarUrl={repoAvatarSrc}\n size={repoAvatarSize}\n theme={t}\n />\n <div\n style={{\n fontSize: isVertical ? 20 : 24,\n fontWeight: 500,\n color: t.fgMuted,\n fontFamily: FONT_FAMILY,\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }}\n >\n {repo}\n </div>\n </div>\n );\n\n const counterZone = isVertical ? (\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n width: refW,\n height: 300,\n paddingTop: 72,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: 14,\n }}\n >\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 20 }}>\n <StarGlyph size={starSize} fill={accentColor} />\n <Odometer current={current} fontSize={counterSize} color={t.fg} />\n </div>\n {underline}\n {repoSlug}\n </div>\n ) : (\n <div\n style={{\n position: \"absolute\",\n left: 80,\n top: 0,\n width: 392,\n height: refH,\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"center\",\n alignItems: \"flex-start\",\n }}\n >\n <StarGlyph size={starSize} fill={accentColor} />\n <div style={{ height: 20 }} />\n <Odometer current={current} fontSize={counterSize} color={t.fg} />\n <div style={{ height: 16 }} />\n {underline}\n <div style={{ height: 20 }} />\n\n {repoSlug}\n </div>\n );\n\n return (\n <AbsoluteFill style={{ background: t.bg }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n transform: `translate(-50%, -50%) scale(${stageScale})`,\n }}\n >\n {counterZone}\n {listViewport}\n </div>\n </AbsoluteFill>\n );\n}\n","type": "registry:component","target": "components/remocn/github-stars.tsx"}diff --git a/public/r/glass-code-block.json b/public/r/glass-code-block.jsonindex 967f4348..253e725d 100644--- a/public/r/glass-code-block.json+++ b/public/r/glass-code-block.json@@ -7,7 +7,7 @@"files": [{"path": "registry/remocn/glass-code-block/index.tsx",- "content": "\"use client\";\n\nimport { Sequence, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface GlassCodeBlockProps {\n code?: string;\n title?: string;\n width?: number;\n height?: number;\n fontSize?: number;\n glassColor?: string;\n staggerFrames?: number;\n showTrafficLights?: boolean;\n aura?: boolean;\n speed?: number;\n className?: string;\n}\n\nconst FONT_MONO =\n \"var(--font-geist-mono), ui-monospace, SFMono-Regular, monospace\";\n\nconst DEFAULT_CODE = `import { motion } from \"remotion\";\n\n// Generate a hero scene\nexport function Hero() {\n const frame = useCurrentFrame();\n const opacity = frame / 30;\n return <h1 style={{ opacity }}>Hello</h1>;\n}`;\n\n// Minimal regex tokenizer. NOT a real syntax highlighter — just enough to\n// give the eye color anchors. Order matters: comments → strings → keywords.\nconst KEYWORDS = new Set([\n \"import\",\n \"from\",\n \"export\",\n \"function\",\n \"const\",\n \"let\",\n \"var\",\n \"return\",\n \"if\",\n \"else\",\n \"for\",\n \"while\",\n \"new\",\n \"class\",\n \"extends\",\n \"default\",\n \"true\",\n \"false\",\n \"null\",\n \"undefined\",\n]);\n\ntype Token = {\n text: string;\n kind: \"code\" | \"comment\" | \"string\" | \"keyword\" | \"number\";\n};\n\nfunction tokenizeLine(line: string): Token[] {\n // Whole-line comment.\n const trimmed = line.trimStart();\n if (trimmed.startsWith(\"//\")) {\n return [{ text: line, kind: \"comment\" }];\n }\n\n const tokens: Token[] = [];\n // Split keeping delimiters: words, strings, numbers, everything else.\n const re = /(\"[^\"]*\"|'[^']*'|`[^`]*`|\\b\\d+\\b|\\b[A-Za-z_$][\\w$]*\\b|[^\\w\"']+)/g;\n let match: RegExpExecArray | null;\n while ((match = re.exec(line)) !== null) {\n const t = match[0];\n const first = t[0];\n if (first === '\"' || first === \"'\" || first === \"`\") {\n tokens.push({ text: t, kind: \"string\" });\n } else if (/^\\d+$/.test(t)) {\n tokens.push({ text: t, kind: \"number\" });\n } else if (/^[A-Za-z_$][\\w$]*$/.test(t) && KEYWORDS.has(t)) {\n tokens.push({ text: t, kind: \"keyword\" });\n } else {\n tokens.push({ text: t, kind: \"code\" });\n }\n }\n return tokens;\n}\n\nconst TOKEN_COLORS: Record<Token[\"kind\"], string> = {\n code: \"#e4e4e7\",\n comment: \"#52525b\",\n string: \"#86efac\",\n keyword: \"#c4b5fd\",\n number: \"#fcd34d\",\n};\n\nexport function GlassCodeBlock({\n code = DEFAULT_CODE,\n title = \"hero.tsx\",\n width = 760,\n height = 460,\n fontSize = 16,\n glassColor = \"rgba(10, 10, 10, 0.6)\",\n staggerFrames = 4,\n showTrafficLights = true,\n aura = false,\n speed = 1,\n className,\n}: GlassCodeBlockProps) {\n const lines = code.split(\"\\n\");\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n {aura && <BackdropAura />}\n\n {/* 1px gradient ring acting as a microborder */}\n <div\n style={{\n position: \"relative\",\n padding: 1,\n borderRadius: 16,\n background:\n \"linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 100%)\",\n width,\n height,\n boxShadow: \"0 50px 120px rgba(0,0,0,0.55)\",\n }}\n >\n <div\n style={{\n width: \"100%\",\n height: \"100%\",\n borderRadius: 15,\n background: glassColor,\n backdropFilter: \"blur(16px)\",\n WebkitBackdropFilter: \"blur(16px)\",\n boxShadow: \"inset 0 1px 0 rgba(255,255,255,0.06)\",\n display: \"flex\",\n flexDirection: \"column\",\n overflow: \"hidden\",\n fontFamily: FONT_MONO,\n }}\n >\n {/* Chrome */}\n <div\n style={{\n height: 40,\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n padding: \"0 16px\",\n borderBottom: \"1px solid rgba(255,255,255,0.06)\",\n }}\n >\n {showTrafficLights && (\n <>\n <Light color=\"#ff5f57\" />\n <Light color=\"#febc2e\" />\n <Light color=\"#28c840\" />\n </>\n )}\n <div\n style={{\n flex: 1,\n textAlign: \"center\",\n color: \"#a1a1aa\",\n fontSize: 12,\n letterSpacing: \"0.02em\",\n }}\n >\n {title}\n </div>\n </div>\n\n {/* Code body */}\n <div\n style={{\n flex: 1,\n padding: \"20px 24px\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: 4,\n fontSize,\n lineHeight: 1.55,\n }}\n >\n {lines.map((line, i) => (\n <Sequence\n key={i}\n from={Math.round((i * staggerFrames) / speed)}\n layout=\"none\"\n >\n <CodeLine line={line} index={i} fontSize={fontSize} />\n </Sequence>\n ))}\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nfunction Light({ color }: { color: string }) {\n return (\n <div\n style={{\n width: 12,\n height: 12,\n borderRadius: \"50%\",\n background: color,\n opacity: 0.6,\n }}\n />\n );\n}\n\nfunction CodeLine({\n line,\n index,\n fontSize,\n}: {\n line: string;\n index: number;\n fontSize: number;\n}) {\n const frame = useCurrentFrame();\n const opacity = interpolate(frame, [0, 8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const ty = interpolate(frame, [0, 8], [4, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const tokens = tokenizeLine(line);\n // Render an empty line as a half-height spacer so blank lines still take\n // visual space without collapsing the gap.\n if (tokens.length === 0) {\n return <div style={{ height: fontSize * 0.8, opacity }} />;\n }\n return (\n <div\n style={{\n opacity,\n transform: `translateY(${ty}px)`,\n whiteSpace: \"pre\",\n display: \"flex\",\n gap: 0,\n }}\n >\n <span style={{ width: 28, color: \"#3f3f46\", userSelect: \"none\" }}>\n {String(index + 1).padStart(2, \" \")}\n </span>\n <span>\n {tokens.map((t, i) => (\n <span key={i} style={{ color: TOKEN_COLORS[t.kind] }}>\n {t.text}\n </span>\n ))}\n </span>\n </div>\n );\n}\n\nfunction BackdropAura() {\n // Slow, low-amplitude blob behind the glass so the backdrop blur has\n // perceptible content to refract.\n const frame = useCurrentFrame();\n const t = frame / 60;\n const x = 50 + Math.sin(t) * 20;\n const y = 50 + Math.cos(t * 0.7) * 15;\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n pointerEvents: \"none\",\n background: `radial-gradient(circle at ${x}% ${y}%, rgba(56,189,248,0.22), transparent 50%), radial-gradient(circle at ${100 - x}% ${100 - y}%, rgba(168,85,247,0.18), transparent 55%)`,\n }}\n />\n );\n}\n",+ "content": "\"use client\";\n\nimport { interpolate, Sequence, useCurrentFrame } from \"remotion\";\n\nexport interface GlassCodeBlockProps {\n code?: string;\n title?: string;\n width?: number;\n height?: number;\n fontSize?: number;\n glassColor?: string;\n staggerFrames?: number;\n showTrafficLights?: boolean;\n aura?: boolean;\n speed?: number;\n className?: string;\n}\n\nconst FONT_MONO =\n \"var(--font-geist-mono), ui-monospace, SFMono-Regular, monospace\";\n\nconst DEFAULT_CODE = `import { motion } from \"remotion\";\n\n// Generate a hero scene\nexport function Hero() {\n const frame = useCurrentFrame();\n const opacity = frame / 30;\n return <h1 style={{ opacity }}>Hello</h1>;\n}`;\n\n// Minimal regex tokenizer. NOT a real syntax highlighter — just enough to\n// give the eye color anchors. Order matters: comments → strings → keywords.\nconst KEYWORDS = new Set([\n \"import\",\n \"from\",\n \"export\",\n \"function\",\n \"const\",\n \"let\",\n \"var\",\n \"return\",\n \"if\",\n \"else\",\n \"for\",\n \"while\",\n \"new\",\n \"class\",\n \"extends\",\n \"default\",\n \"true\",\n \"false\",\n \"null\",\n \"undefined\",\n]);\n\ntype Token = {\n text: string;\n kind: \"code\" | \"comment\" | \"string\" | \"keyword\" | \"number\";\n};\n\nfunction tokenizeLine(line: string): Token[] {\n // Whole-line comment.\n const trimmed = line.trimStart();\n if (trimmed.startsWith(\"//\")) {\n return [{ text: line, kind: \"comment\" }];\n }\n\n const tokens: Token[] = [];\n // Split keeping delimiters: words, strings, numbers, everything else.\n const re = /(\"[^\"]*\"|'[^']*'|`[^`]*`|\\b\\d+\\b|\\b[A-Za-z_$][\\w$]*\\b|[^\\w\"']+)/g;\n let match: RegExpExecArray | null = re.exec(line);\n while (match !== null) {\n const t = match[0];\n const first = t[0];\n if (first === '\"' || first === \"'\" || first === \"`\") {\n tokens.push({ text: t, kind: \"string\" });\n } else if (/^\\d+$/.test(t)) {\n tokens.push({ text: t, kind: \"number\" });\n } else if (/^[A-Za-z_$][\\w$]*$/.test(t) && KEYWORDS.has(t)) {\n tokens.push({ text: t, kind: \"keyword\" });\n } else {\n tokens.push({ text: t, kind: \"code\" });\n }\n match = re.exec(line);\n }\n return tokens;\n}\n\nconst TOKEN_COLORS: Record<Token[\"kind\"], string> = {\n code: \"#e4e4e7\",\n comment: \"#52525b\",\n string: \"#86efac\",\n keyword: \"#c4b5fd\",\n number: \"#fcd34d\",\n};\n\nexport function GlassCodeBlock({\n code = DEFAULT_CODE,\n title = \"hero.tsx\",\n width = 760,\n height = 460,\n fontSize = 16,\n glassColor = \"rgba(10, 10, 10, 0.6)\",\n staggerFrames = 4,\n showTrafficLights = true,\n aura = false,\n speed = 1,\n className,\n}: GlassCodeBlockProps) {\n const lines = code.split(\"\\n\");\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n {aura && <BackdropAura />}\n\n {/* 1px gradient ring acting as a microborder */}\n <div\n style={{\n position: \"relative\",\n padding: 1,\n borderRadius: 16,\n background:\n \"linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 100%)\",\n width,\n height,\n boxShadow: \"0 50px 120px rgba(0,0,0,0.55)\",\n }}\n >\n <div\n style={{\n width: \"100%\",\n height: \"100%\",\n borderRadius: 15,\n background: glassColor,\n backdropFilter: \"blur(16px)\",\n WebkitBackdropFilter: \"blur(16px)\",\n boxShadow: \"inset 0 1px 0 rgba(255,255,255,0.06)\",\n display: \"flex\",\n flexDirection: \"column\",\n overflow: \"hidden\",\n fontFamily: FONT_MONO,\n }}\n >\n {/* Chrome */}\n <div\n style={{\n height: 40,\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n padding: \"0 16px\",\n borderBottom: \"1px solid rgba(255,255,255,0.06)\",\n }}\n >\n {showTrafficLights && (\n <>\n <Light color=\"#ff5f57\" />\n <Light color=\"#febc2e\" />\n <Light color=\"#28c840\" />\n </>\n )}\n <div\n style={{\n flex: 1,\n textAlign: \"center\",\n color: \"#a1a1aa\",\n fontSize: 12,\n letterSpacing: \"0.02em\",\n }}\n >\n {title}\n </div>\n </div>\n\n {/* Code body */}\n <div\n style={{\n flex: 1,\n padding: \"20px 24px\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: 4,\n fontSize,\n lineHeight: 1.55,\n }}\n >\n {lines.map((line, i) => (\n <Sequence\n key={i}\n from={Math.round((i * staggerFrames) / speed)}\n layout=\"none\"\n >\n <CodeLine line={line} index={i} fontSize={fontSize} />\n </Sequence>\n ))}\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nfunction Light({ color }: { color: string }) {\n return (\n <div\n style={{\n width: 12,\n height: 12,\n borderRadius: \"50%\",\n background: color,\n opacity: 0.6,\n }}\n />\n );\n}\n\nfunction CodeLine({\n line,\n index,\n fontSize,\n}: {\n line: string;\n index: number;\n fontSize: number;\n}) {\n const frame = useCurrentFrame();\n const opacity = interpolate(frame, [0, 8], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const ty = interpolate(frame, [0, 8], [4, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const tokens = tokenizeLine(line);\n // Render an empty line as a half-height spacer so blank lines still take\n // visual space without collapsing the gap.\n if (tokens.length === 0) {\n return <div style={{ height: fontSize * 0.8, opacity }} />;\n }\n return (\n <div\n style={{\n opacity,\n transform: `translateY(${ty}px)`,\n whiteSpace: \"pre\",\n display: \"flex\",\n gap: 0,\n }}\n >\n <span style={{ width: 28, color: \"#3f3f46\", userSelect: \"none\" }}>\n {String(index + 1).padStart(2, \" \")}\n </span>\n <span>\n {tokens.map((t, i) => (\n <span key={i} style={{ color: TOKEN_COLORS[t.kind] }}>\n {t.text}\n </span>\n ))}\n </span>\n </div>\n );\n}\n\nfunction BackdropAura() {\n // Slow, low-amplitude blob behind the glass so the backdrop blur has\n // perceptible content to refract.\n const frame = useCurrentFrame();\n const t = frame / 60;\n const x = 50 + Math.sin(t) * 20;\n const y = 50 + Math.cos(t * 0.7) * 15;\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n pointerEvents: \"none\",\n background: `radial-gradient(circle at ${x}% ${y}%, rgba(56,189,248,0.22), transparent 50%), radial-gradient(circle at ${100 - x}% ${100 - y}%, rgba(168,85,247,0.18), transparent 55%)`,\n }}\n />\n );\n}\n","type": "registry:component","target": "components/remocn/glass-code-block.tsx"}diff --git a/public/r/grain-dissolve.json b/public/r/grain-dissolve.jsonindex 810e962a..38a0773c 100644--- a/public/r/grain-dissolve.json+++ b/public/r/grain-dissolve.json@@ -8,7 +8,7 @@"files": [{"path": "registry/remocn/grain-dissolve/index.tsx",- "content": "\"use client\";\n\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport {\n ShaderGrainGradient,\n type ShaderGrainGradientProps,\n} from \"@/components/remocn/shader-grain-gradient\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst DEFAULT_COLORS = [\"#3a3a52\", \"#4a4a68\", \"#8f88ae\"];\n\nexport type GrainDissolveProps = {\n colors?: string[];\n colorBack?: string;\n shape?: NonNullable<ShaderGrainGradientProps[\"shape\"]>;\n noise?: number;\n zoom?: number;\n speed?: number;\n};\n\nconst GrainDissolvePresentation: React.FC<\n TransitionPresentationComponentProps<GrainDissolveProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n colors = DEFAULT_COLORS,\n colorBack = \"#141318\",\n shape = \"blob\",\n noise = 0.3,\n zoom = 2,\n speed = 1,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n if (!entering) {\n const exitStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.14, 0.34], [1, 0], clampOpts),\n filter: `blur(${interpolate(p, [0.06, 0.34], [0, 10], clampOpts)}px)`,\n };\n return <AbsoluteFill style={exitStyle}>{children}</AbsoluteFill>;\n }\n\n const fieldOpacity = interpolate(p, [0, 0.26], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n const intensity = interpolate(p, [0.08, 0.92], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n const softness = interpolate(p, [0.08, 0.92], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n const fieldScale =\n zoom * interpolate(p, [0, 1], [0.9, 1.15], clampOpts);\n\n const childStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.7, 0.86], [0, 1], clampOpts),\n transform: `scale(${interpolate(p, [0.7, 1], [1.05, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.7, 0.92], [10, 0], clampOpts)}px)`,\n };\n\n return (\n <AbsoluteFill>\n <AbsoluteFill style={{ opacity: fieldOpacity, pointerEvents: \"none\" }}>\n <ShaderGrainGradient\n speed={speed}\n colors={colors}\n colorBack={colorBack}\n shape={shape}\n noise={noise}\n intensity={intensity}\n softness={softness}\n scale={fieldScale}\n />\n </AbsoluteFill>\n <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>\n </AbsoluteFill>\n );\n};\n\nexport function grainDissolve(\n props: GrainDissolveProps = {},\n): TransitionPresentation<GrainDissolveProps> {\n return {\n component: GrainDissolvePresentation,\n props,\n };\n}\n",+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport {\n ShaderGrainGradient,\n type ShaderGrainGradientProps,\n} from \"@/components/remocn/shader-grain-gradient\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst DEFAULT_COLORS = [\"#3a3a52\", \"#4a4a68\", \"#8f88ae\"];\n\nexport type GrainDissolveProps = {\n colors?: string[];\n colorBack?: string;\n shape?: NonNullable<ShaderGrainGradientProps[\"shape\"]>;\n noise?: number;\n zoom?: number;\n speed?: number;\n};\n\nconst GrainDissolvePresentation: React.FC<\n TransitionPresentationComponentProps<GrainDissolveProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n colors = DEFAULT_COLORS,\n colorBack = \"#141318\",\n shape = \"blob\",\n noise = 0.3,\n zoom = 2,\n speed = 1,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n if (!entering) {\n const exitStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.14, 0.34], [1, 0], clampOpts),\n filter: `blur(${interpolate(p, [0.06, 0.34], [0, 10], clampOpts)}px)`,\n };\n return <AbsoluteFill style={exitStyle}>{children}</AbsoluteFill>;\n }\n\n const fieldOpacity = interpolate(p, [0, 0.26], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n const intensity = interpolate(p, [0.08, 0.92], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n const softness = interpolate(p, [0.08, 0.92], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n const fieldScale = zoom * interpolate(p, [0, 1], [0.9, 1.15], clampOpts);\n\n const childStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.7, 0.86], [0, 1], clampOpts),\n transform: `scale(${interpolate(p, [0.7, 1], [1.05, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.7, 0.92], [10, 0], clampOpts)}px)`,\n };\n\n return (\n <AbsoluteFill>\n <AbsoluteFill style={{ opacity: fieldOpacity, pointerEvents: \"none\" }}>\n <ShaderGrainGradient\n speed={speed}\n colors={colors}\n colorBack={colorBack}\n shape={shape}\n noise={noise}\n intensity={intensity}\n softness={softness}\n scale={fieldScale}\n />\n </AbsoluteFill>\n <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>\n </AbsoluteFill>\n );\n};\n\nexport function grainDissolve(\n props: GrainDissolveProps = {},\n): TransitionPresentation<GrainDissolveProps> {\n return {\n component: GrainDissolvePresentation,\n props,\n };\n}\n","type": "registry:component","target": "components/remocn/grain-dissolve.tsx"}diff --git a/public/r/imessage-chat-flow.json b/public/r/imessage-chat-flow.jsonindex 25133cbb..7946ed92 100644--- a/public/r/imessage-chat-flow.json+++ b/public/r/imessage-chat-flow.json@@ -12,7 +12,7 @@"files": [{"path": "registry/remocn-ui/imessage-chat-flow/index.tsx",- "content": "\"use client\";\n\nimport {\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { ArrowUp, ChevronLeft, Plus, Video } from \"lucide-react\";\nimport { type RemocnTheme, revealedText } from \"@/lib/remocn-ui\";\nimport { Caret } from \"@/components/remocn/caret\";\nimport { TypingIndicator } from \"@/components/remocn/typing-indicator\";\n\nexport interface ImessageMessage {\n from: \"me\" | \"them\";\n text: string;\n reaction?: string;\n}\n\nexport interface ImessageContact {\n name: string;\n avatar?: string;\n}\n\nexport interface ImessageChatFlowProps {\n messages?: ImessageMessage[];\n contact?: ImessageContact;\n accentColor?: string;\n speed?: number;\n theme?: Partial<RemocnTheme>;\n}\n\nconst MOBILE_WIDTH = 460;\nconst LEAD_IN = 12;\nconst FRAMES_PER_CHAR = 2.2;\nconst MIN_TYPE = 18;\nconst MAX_TYPE = 86;\nconst SEND_GAP = 10;\nconst REVEAL = 14;\nconst REACT_DELAY = 8;\nconst REACT_DUR = 14;\nconst MSG_GAP = 18;\nconst TYPING_MIN = 34;\nconst TYPING_MAX = 70;\nconst TAIL = 28;\nconst PRESS_WINDOW = 7;\n\nconst IMESSAGE_BLUE = \"#0a7cff\";\nconst SYSTEM_BLUE = \"#007aff\";\nconst INCOMING_BG = \"#e9e9eb\";\nconst INCOMING_FG = \"#000000\";\nconst OUTGOING_FG = \"#ffffff\";\nconst META_GRAY = \"#8e8e93\";\n\nconst DEFAULT_MESSAGES: ImessageMessage[] = [\n { from: \"me\", text: \"Hey — ready for the demo?\" },\n { from: \"them\", text: \"Yep, pushing it live now\", reaction: \"❤️\" },\n { from: \"me\", text: \"Perfect, sending the link over\", reaction: \"👍\" },\n];\n\nfunction clamp(value: number, lo: number, hi: number): number {\n return Math.max(lo, Math.min(hi, value));\n}\n\nexport interface ScheduledMessage {\n index: number;\n from: \"me\" | \"them\";\n text: string;\n reaction?: string;\n presenceStart: number;\n typeStart?: number;\n sendAt?: number;\n typingStart?: number;\n revealAt: number;\n reactAt?: number;\n}\n\nexport interface ImessageChatFlowSchedule {\n items: ScheduledMessage[];\n duration: number;\n}\n\nexport function imessageChatFlowSchedule(\n messages: ImessageMessage[],\n): ImessageChatFlowSchedule {\n const items: ScheduledMessage[] = [];\n let cursor = LEAD_IN;\n\n messages.forEach((message, index) => {\n const hasReaction = message.reaction !== undefined && message.reaction !== \"\";\n if (message.from === \"me\") {\n const typeStart = cursor;\n const typeDur = clamp(\n Math.round(message.text.length * FRAMES_PER_CHAR),\n MIN_TYPE,\n MAX_TYPE,\n );\n const sendAt = typeStart + typeDur + SEND_GAP;\n const revealAt = sendAt;\n const reactAt = hasReaction ? revealAt + REVEAL + REACT_DELAY : undefined;\n items.push({\n index,\n from: \"me\",\n text: message.text,\n reaction: hasReaction ? message.reaction : undefined,\n presenceStart: sendAt - 2,\n typeStart,\n sendAt,\n revealAt,\n reactAt,\n });\n cursor =\n revealAt + REVEAL + (hasReaction ? REACT_DELAY + REACT_DUR : 0) + MSG_GAP;\n } else {\n const typingStart = cursor;\n const typingDur = clamp(\n Math.round(message.text.length * FRAMES_PER_CHAR),\n TYPING_MIN,\n TYPING_MAX,\n );\n const revealAt = typingStart + typingDur;\n const reactAt = hasReaction ? revealAt + REVEAL + REACT_DELAY : undefined;\n items.push({\n index,\n from: \"them\",\n text: message.text,\n reaction: hasReaction ? message.reaction : undefined,\n presenceStart: typingStart,\n typingStart,\n revealAt,\n reactAt,\n });\n cursor =\n revealAt + REVEAL + (hasReaction ? REACT_DELAY + REACT_DUR : 0) + MSG_GAP;\n }\n });\n\n const duration = Math.max(cursor - MSG_GAP + TAIL, LEAD_IN + TAIL);\n return { items, duration };\n}\n\nexport function imessageChatFlowDuration(\n messages: ImessageMessage[] = DEFAULT_MESSAGES,\n speed = 1,\n): number {\n const raw = imessageChatFlowSchedule(messages).duration;\n return Math.ceil(raw / (speed <= 0 ? 1 : speed));\n}\n\nexport function sendPulse(items: ScheduledMessage[], eff: number): number {\n let best = 0;\n for (const item of items) {\n if (item.sendAt === undefined) continue;\n const distance = Math.abs(eff - item.sendAt);\n if (distance <= PRESS_WINDOW) {\n best = Math.max(best, 1 - distance / PRESS_WINDOW);\n }\n }\n return best;\n}\n\nfunction Avatar({ contact, size }: { contact: ImessageContact; size: number }) {\n const initial = contact.name.trim().charAt(0).toUpperCase();\n return (\n <div\n style={{\n flexShrink: 0,\n width: size,\n height: size,\n minWidth: size,\n borderRadius: \"50%\",\n overflow: \"hidden\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"linear-gradient(180deg, #b8c0c9 0%, #8e99a4 100%)\",\n color: \"#ffffff\",\n fontSize: size * 0.42,\n fontWeight: 600,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {contact.avatar !== undefined ? (\n <img\n src={contact.avatar}\n alt={contact.name}\n style={{ width: \"100%\", height: \"100%\", objectFit: \"cover\" }}\n />\n ) : (\n initial\n )}\n </div>\n );\n}\n\nfunction BubbleTail({ side, color }: { side: \"left\" | \"right\"; color: string }) {\n const path =\n side === \"right\"\n ? \"M0 0 C2 8 6 12 12 13 C7 14 1 13 0 8 Z\"\n : \"M13 0 C11 8 7 12 1 13 C6 14 12 13 13 8 Z\";\n return (\n <svg\n width={13}\n height={14}\n viewBox=\"0 0 13 14\"\n style={{\n position: \"absolute\",\n bottom: 0,\n left: side === \"left\" ? -5 : undefined,\n right: side === \"right\" ? -5 : undefined,\n }}\n >\n <path d={path} fill={color} />\n </svg>\n );\n}\n\nexport function ImessageChatFlow({\n messages = DEFAULT_MESSAGES,\n contact,\n accentColor,\n speed = 1,\n}: ImessageChatFlowProps) {\n const frame = useCurrentFrame();\n const eff = frame * speed;\n const accent = accentColor ?? IMESSAGE_BLUE;\n\n const { items } = imessageChatFlowSchedule(messages);\n\n const activeMe = items.find(\n (item) =>\n item.from === \"me\" &&\n item.typeStart !== undefined &&\n item.sendAt !== undefined &&\n eff >= item.typeStart &&\n eff < item.sendAt,\n );\n let composerText = \"\";\n let typing = false;\n if (\n activeMe &&\n activeMe.typeStart !== undefined &&\n activeMe.sendAt !== undefined\n ) {\n const typeDur = Math.max(activeMe.sendAt - SEND_GAP - activeMe.typeStart, 1);\n const progress = clamp((eff - activeMe.typeStart) / typeDur, 0, 1);\n composerText = revealedText(\n activeMe.text,\n Math.floor(progress * activeMe.text.length),\n );\n typing = true;\n }\n\n const sendActive = composerText.length > 0;\n const sendScale = 1 - 0.16 * sendPulse(items, eff);\n const present = items.filter((item) => eff >= item.presenceStart);\n\n let lastMeIndex = -1;\n items.forEach((item) => {\n if (item.from === \"me\") lastMeIndex = item.index;\n });\n const deliveredIndex =\n lastMeIndex === messages.length - 1 ? lastMeIndex : -1;\n\n return (\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n justifyContent: \"center\",\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n width: \"100%\",\n maxWidth: MOBILE_WIDTH,\n height: \"100%\",\n boxSizing: \"border-box\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n padding: \"10px 12px\",\n background: \"rgba(255,255,255,0.82)\",\n backdropFilter: \"blur(12px)\",\n borderBottom: \"1px solid rgba(0,0,0,0.08)\",\n }}\n >\n <ChevronLeft size={28} color={SYSTEM_BLUE} strokeWidth={2.25} />\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: 2,\n flex: 1,\n }}\n >\n {contact !== undefined && <Avatar contact={contact} size={30} />}\n <span\n style={{\n fontSize: 12,\n fontWeight: 600,\n color: \"#000000\",\n }}\n >\n {contact?.name ?? \"Chat\"}\n </span>\n </div>\n <Video size={24} color={SYSTEM_BLUE} strokeWidth={2} />\n </div>\n\n <div\n style={{\n position: \"relative\",\n flex: 1,\n minHeight: 0,\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flex-end\",\n gap: 18,\n minHeight: \"100%\",\n padding: \"16px 14px 12px\",\n }}\n >\n {present.map((item) => (\n <ImessageRow\n key={item.index}\n item={item}\n eff={eff}\n contact={contact}\n accent={accent}\n showDelivered={item.index === deliveredIndex}\n />\n ))}\n </div>\n </div>\n\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-end\",\n gap: 8,\n padding: \"8px 12px 12px\",\n }}\n >\n <div\n style={{\n width: 34,\n height: 34,\n borderRadius: \"50%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"#e9e9eb\",\n }}\n >\n <Plus size={22} color=\"#3c3c43\" strokeWidth={2} />\n </div>\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n minHeight: 36,\n padding: \"0 6px 0 14px\",\n borderRadius: 18,\n border: \"1px solid #d1d1d6\",\n background: \"#ffffff\",\n }}\n >\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n fontSize: 16,\n color: sendActive ? \"#000000\" : \"#9b9ba1\",\n }}\n >\n <span style={{ whiteSpace: \"pre-wrap\", wordBreak: \"break-word\" }}>\n {sendActive ? composerText : \"iMessage\"}\n </span>\n {typing && (\n <Caret\n color={accent}\n height={18}\n radius={1}\n blink\n marginLeft={composerText.length > 0 ? 2 : 0}\n />\n )}\n </div>\n <div\n style={{\n flexShrink: 0,\n width: 28,\n height: 28,\n borderRadius: \"50%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: sendActive ? accent : \"#c6c6cc\",\n transform: `scale(${sendScale})`,\n }}\n >\n <ArrowUp size={20} color=\"#ffffff\" strokeWidth={2.75} />\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nfunction ImessageRow({\n item,\n eff,\n contact,\n accent,\n showDelivered,\n}: {\n item: ScheduledMessage;\n eff: number;\n contact?: ImessageContact;\n accent: string;\n showDelivered: boolean;\n}) {\n const { fps } = useVideoConfig();\n const outgoing = item.from === \"me\";\n const showTyping =\n item.from === \"them\" &&\n item.typingStart !== undefined &&\n eff < item.revealAt;\n\n const enter = spring({\n fps,\n frame: eff - (showTyping ? (item.typingStart ?? 0) : item.revealAt),\n config: { damping: 16, stiffness: 200, mass: 0.7 },\n });\n const opacity = interpolate(enter, [0, 1], [0, 1]);\n const translateY = interpolate(enter, [0, 1], [10, 0]);\n const scale = interpolate(enter, [0, 1], [0.92, 1]);\n\n let reactionScale = 0;\n let reactionOpacity = 0;\n if (item.reactAt !== undefined) {\n reactionScale = spring({\n fps,\n frame: eff - item.reactAt,\n config: { damping: 11, stiffness: 220, mass: 0.6 },\n });\n reactionOpacity = interpolate(eff, [item.reactAt, item.reactAt + 5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n }\n\n const bg = outgoing ? accent : INCOMING_BG;\n const fg = outgoing ? OUTGOING_FG : INCOMING_FG;\n const delivered =\n showDelivered && !showTyping && eff > item.revealAt + REVEAL;\n\n const bubble = (\n <div\n style={{\n position: \"relative\",\n maxWidth: \"72%\",\n padding: showTyping ? \"11px 14px\" : \"7px 13px 8px\",\n background: bg,\n color: fg,\n borderRadius: 19,\n borderBottomRightRadius: outgoing ? 7 : 19,\n borderBottomLeftRadius: outgoing ? 19 : 7,\n fontSize: 16,\n lineHeight: 1.32,\n }}\n >\n {showTyping ? (\n <TypingIndicator color={META_GRAY} />\n ) : (\n <span style={{ wordBreak: \"break-word\", overflowWrap: \"break-word\" }}>\n {item.text}\n </span>\n )}\n {!showTyping && <BubbleTail side={outgoing ? \"right\" : \"left\"} color={bg} />}\n {item.reaction !== undefined && (\n <div\n style={{\n position: \"absolute\",\n top: -16,\n left: outgoing ? -14 : undefined,\n right: outgoing ? undefined : -14,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: 30,\n height: 30,\n borderRadius: \"50%\",\n background: INCOMING_BG,\n fontSize: 15,\n boxShadow: \"0 1px 2px rgba(0,0,0,0.12)\",\n opacity: reactionOpacity,\n transform: `scale(${reactionScale})`,\n transformOrigin: outgoing ? \"bottom left\" : \"bottom right\",\n }}\n >\n {item.reaction}\n </div>\n )}\n </div>\n );\n\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: outgoing ? \"flex-end\" : \"flex-start\",\n gap: 2,\n width: \"100%\",\n opacity,\n transform: `translateY(${translateY}px) scale(${scale})`,\n transformOrigin: outgoing ? \"bottom right\" : \"bottom left\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-end\",\n justifyContent: outgoing ? \"flex-end\" : \"flex-start\",\n gap: 7,\n width: \"100%\",\n }}\n >\n {!outgoing && contact !== undefined && (\n <Avatar contact={contact} size={28} />\n )}\n {bubble}\n </div>\n {delivered && (\n <span\n style={{\n fontSize: 11,\n color: META_GRAY,\n paddingRight: 4,\n }}\n >\n Delivered\n </span>\n )}\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport { ArrowUp, ChevronLeft, Plus, Video } from \"lucide-react\";\nimport { interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { Caret } from \"@/components/remocn/caret\";\nimport { TypingIndicator } from \"@/components/remocn/typing-indicator\";\nimport { type RemocnTheme, revealedText } from \"@/lib/remocn-ui\";\n\nexport interface ImessageMessage {\n from: \"me\" | \"them\";\n text: string;\n reaction?: string;\n}\n\nexport interface ImessageContact {\n name: string;\n avatar?: string;\n}\n\nexport interface ImessageChatFlowProps {\n messages?: ImessageMessage[];\n contact?: ImessageContact;\n accentColor?: string;\n speed?: number;\n theme?: Partial<RemocnTheme>;\n}\n\nconst MOBILE_WIDTH = 460;\nconst LEAD_IN = 12;\nconst FRAMES_PER_CHAR = 2.2;\nconst MIN_TYPE = 18;\nconst MAX_TYPE = 86;\nconst SEND_GAP = 10;\nconst REVEAL = 14;\nconst REACT_DELAY = 8;\nconst REACT_DUR = 14;\nconst MSG_GAP = 18;\nconst TYPING_MIN = 34;\nconst TYPING_MAX = 70;\nconst TAIL = 28;\nconst PRESS_WINDOW = 7;\n\nconst IMESSAGE_BLUE = \"#0a7cff\";\nconst SYSTEM_BLUE = \"#007aff\";\nconst INCOMING_BG = \"#e9e9eb\";\nconst INCOMING_FG = \"#000000\";\nconst OUTGOING_FG = \"#ffffff\";\nconst META_GRAY = \"#8e8e93\";\n\nconst DEFAULT_MESSAGES: ImessageMessage[] = [\n { from: \"me\", text: \"Hey — ready for the demo?\" },\n { from: \"them\", text: \"Yep, pushing it live now\", reaction: \"❤️\" },\n { from: \"me\", text: \"Perfect, sending the link over\", reaction: \"👍\" },\n];\n\nfunction clamp(value: number, lo: number, hi: number): number {\n return Math.max(lo, Math.min(hi, value));\n}\n\nexport interface ScheduledMessage {\n index: number;\n from: \"me\" | \"them\";\n text: string;\n reaction?: string;\n presenceStart: number;\n typeStart?: number;\n sendAt?: number;\n typingStart?: number;\n revealAt: number;\n reactAt?: number;\n}\n\nexport interface ImessageChatFlowSchedule {\n items: ScheduledMessage[];\n duration: number;\n}\n\nexport function imessageChatFlowSchedule(\n messages: ImessageMessage[],\n): ImessageChatFlowSchedule {\n const items: ScheduledMessage[] = [];\n let cursor = LEAD_IN;\n\n messages.forEach((message, index) => {\n const hasReaction =\n message.reaction !== undefined && message.reaction !== \"\";\n if (message.from === \"me\") {\n const typeStart = cursor;\n const typeDur = clamp(\n Math.round(message.text.length * FRAMES_PER_CHAR),\n MIN_TYPE,\n MAX_TYPE,\n );\n const sendAt = typeStart + typeDur + SEND_GAP;\n const revealAt = sendAt;\n const reactAt = hasReaction ? revealAt + REVEAL + REACT_DELAY : undefined;\n items.push({\n index,\n from: \"me\",\n text: message.text,\n reaction: hasReaction ? message.reaction : undefined,\n presenceStart: sendAt - 2,\n typeStart,\n sendAt,\n revealAt,\n reactAt,\n });\n cursor =\n revealAt +\n REVEAL +\n (hasReaction ? REACT_DELAY + REACT_DUR : 0) +\n MSG_GAP;\n } else {\n const typingStart = cursor;\n const typingDur = clamp(\n Math.round(message.text.length * FRAMES_PER_CHAR),\n TYPING_MIN,\n TYPING_MAX,\n );\n const revealAt = typingStart + typingDur;\n const reactAt = hasReaction ? revealAt + REVEAL + REACT_DELAY : undefined;\n items.push({\n index,\n from: \"them\",\n text: message.text,\n reaction: hasReaction ? message.reaction : undefined,\n presenceStart: typingStart,\n typingStart,\n revealAt,\n reactAt,\n });\n cursor =\n revealAt +\n REVEAL +\n (hasReaction ? REACT_DELAY + REACT_DUR : 0) +\n MSG_GAP;\n }\n });\n\n const duration = Math.max(cursor - MSG_GAP + TAIL, LEAD_IN + TAIL);\n return { items, duration };\n}\n\nexport function imessageChatFlowDuration(\n messages: ImessageMessage[] = DEFAULT_MESSAGES,\n speed = 1,\n): number {\n const raw = imessageChatFlowSchedule(messages).duration;\n return Math.ceil(raw / (speed <= 0 ? 1 : speed));\n}\n\nexport function sendPulse(items: ScheduledMessage[], eff: number): number {\n let best = 0;\n for (const item of items) {\n if (item.sendAt === undefined) continue;\n const distance = Math.abs(eff - item.sendAt);\n if (distance <= PRESS_WINDOW) {\n best = Math.max(best, 1 - distance / PRESS_WINDOW);\n }\n }\n return best;\n}\n\nfunction Avatar({ contact, size }: { contact: ImessageContact; size: number }) {\n const initial = contact.name.trim().charAt(0).toUpperCase();\n return (\n <div\n style={{\n flexShrink: 0,\n width: size,\n height: size,\n minWidth: size,\n borderRadius: \"50%\",\n overflow: \"hidden\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"linear-gradient(180deg, #b8c0c9 0%, #8e99a4 100%)\",\n color: \"#ffffff\",\n fontSize: size * 0.42,\n fontWeight: 600,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {contact.avatar !== undefined ? (\n // biome-ignore lint/performance/noImgElement: Remotion output, not a Next.js app — next/image isn't available where this component ships\n <img\n src={contact.avatar}\n alt={contact.name}\n style={{ width: \"100%\", height: \"100%\", objectFit: \"cover\" }}\n />\n ) : (\n initial\n )}\n </div>\n );\n}\n\nfunction BubbleTail({\n side,\n color,\n}: {\n side: \"left\" | \"right\";\n color: string;\n}) {\n const path =\n side === \"right\"\n ? \"M0 0 C2 8 6 12 12 13 C7 14 1 13 0 8 Z\"\n : \"M13 0 C11 8 7 12 1 13 C6 14 12 13 13 8 Z\";\n return (\n <svg\n width={13}\n height={14}\n viewBox=\"0 0 13 14\"\n style={{\n position: \"absolute\",\n bottom: 0,\n left: side === \"left\" ? -5 : undefined,\n right: side === \"right\" ? -5 : undefined,\n }}\n >\n <path d={path} fill={color} />\n </svg>\n );\n}\n\nexport function ImessageChatFlow({\n messages = DEFAULT_MESSAGES,\n contact,\n accentColor,\n speed = 1,\n}: ImessageChatFlowProps) {\n const frame = useCurrentFrame();\n const eff = frame * speed;\n const accent = accentColor ?? IMESSAGE_BLUE;\n\n const { items } = imessageChatFlowSchedule(messages);\n\n const activeMe = items.find(\n (item) =>\n item.from === \"me\" &&\n item.typeStart !== undefined &&\n item.sendAt !== undefined &&\n eff >= item.typeStart &&\n eff < item.sendAt,\n );\n let composerText = \"\";\n let typing = false;\n if (\n activeMe &&\n activeMe.typeStart !== undefined &&\n activeMe.sendAt !== undefined\n ) {\n const typeDur = Math.max(\n activeMe.sendAt - SEND_GAP - activeMe.typeStart,\n 1,\n );\n const progress = clamp((eff - activeMe.typeStart) / typeDur, 0, 1);\n composerText = revealedText(\n activeMe.text,\n Math.floor(progress * activeMe.text.length),\n );\n typing = true;\n }\n\n const sendActive = composerText.length > 0;\n const sendScale = 1 - 0.16 * sendPulse(items, eff);\n const present = items.filter((item) => eff >= item.presenceStart);\n\n let lastMeIndex = -1;\n items.forEach((item) => {\n if (item.from === \"me\") lastMeIndex = item.index;\n });\n const deliveredIndex = lastMeIndex === messages.length - 1 ? lastMeIndex : -1;\n\n return (\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n justifyContent: \"center\",\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n width: \"100%\",\n maxWidth: MOBILE_WIDTH,\n height: \"100%\",\n boxSizing: \"border-box\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n padding: \"10px 12px\",\n background: \"rgba(255,255,255,0.82)\",\n backdropFilter: \"blur(12px)\",\n borderBottom: \"1px solid rgba(0,0,0,0.08)\",\n }}\n >\n <ChevronLeft size={28} color={SYSTEM_BLUE} strokeWidth={2.25} />\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: 2,\n flex: 1,\n }}\n >\n {contact !== undefined && <Avatar contact={contact} size={30} />}\n <span\n style={{\n fontSize: 12,\n fontWeight: 600,\n color: \"#000000\",\n }}\n >\n {contact?.name ?? \"Chat\"}\n </span>\n </div>\n <Video size={24} color={SYSTEM_BLUE} strokeWidth={2} />\n </div>\n\n <div\n style={{\n position: \"relative\",\n flex: 1,\n minHeight: 0,\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flex-end\",\n gap: 18,\n minHeight: \"100%\",\n padding: \"16px 14px 12px\",\n }}\n >\n {present.map((item) => (\n <ImessageRow\n key={item.index}\n item={item}\n eff={eff}\n contact={contact}\n accent={accent}\n showDelivered={item.index === deliveredIndex}\n />\n ))}\n </div>\n </div>\n\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-end\",\n gap: 8,\n padding: \"8px 12px 12px\",\n }}\n >\n <div\n style={{\n width: 34,\n height: 34,\n borderRadius: \"50%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"#e9e9eb\",\n }}\n >\n <Plus size={22} color=\"#3c3c43\" strokeWidth={2} />\n </div>\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n minHeight: 36,\n padding: \"0 6px 0 14px\",\n borderRadius: 18,\n border: \"1px solid #d1d1d6\",\n background: \"#ffffff\",\n }}\n >\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n fontSize: 16,\n color: sendActive ? \"#000000\" : \"#9b9ba1\",\n }}\n >\n <span style={{ whiteSpace: \"pre-wrap\", wordBreak: \"break-word\" }}>\n {sendActive ? composerText : \"iMessage\"}\n </span>\n {typing && (\n <Caret\n color={accent}\n height={18}\n radius={1}\n blink\n marginLeft={composerText.length > 0 ? 2 : 0}\n />\n )}\n </div>\n <div\n style={{\n flexShrink: 0,\n width: 28,\n height: 28,\n borderRadius: \"50%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: sendActive ? accent : \"#c6c6cc\",\n transform: `scale(${sendScale})`,\n }}\n >\n <ArrowUp size={20} color=\"#ffffff\" strokeWidth={2.75} />\n </div>\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nfunction ImessageRow({\n item,\n eff,\n contact,\n accent,\n showDelivered,\n}: {\n item: ScheduledMessage;\n eff: number;\n contact?: ImessageContact;\n accent: string;\n showDelivered: boolean;\n}) {\n const { fps } = useVideoConfig();\n const outgoing = item.from === \"me\";\n const showTyping =\n item.from === \"them\" &&\n item.typingStart !== undefined &&\n eff < item.revealAt;\n\n const enter = spring({\n fps,\n frame: eff - (showTyping ? (item.typingStart ?? 0) : item.revealAt),\n config: { damping: 16, stiffness: 200, mass: 0.7 },\n });\n const opacity = interpolate(enter, [0, 1], [0, 1]);\n const translateY = interpolate(enter, [0, 1], [10, 0]);\n const scale = interpolate(enter, [0, 1], [0.92, 1]);\n\n let reactionScale = 0;\n let reactionOpacity = 0;\n if (item.reactAt !== undefined) {\n reactionScale = spring({\n fps,\n frame: eff - item.reactAt,\n config: { damping: 11, stiffness: 220, mass: 0.6 },\n });\n reactionOpacity = interpolate(\n eff,\n [item.reactAt, item.reactAt + 5],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n },\n );\n }\n\n const bg = outgoing ? accent : INCOMING_BG;\n const fg = outgoing ? OUTGOING_FG : INCOMING_FG;\n const delivered =\n showDelivered && !showTyping && eff > item.revealAt + REVEAL;\n\n const bubble = (\n <div\n style={{\n position: \"relative\",\n maxWidth: \"72%\",\n padding: showTyping ? \"11px 14px\" : \"7px 13px 8px\",\n background: bg,\n color: fg,\n borderRadius: 19,\n borderBottomRightRadius: outgoing ? 7 : 19,\n borderBottomLeftRadius: outgoing ? 19 : 7,\n fontSize: 16,\n lineHeight: 1.32,\n }}\n >\n {showTyping ? (\n <TypingIndicator color={META_GRAY} />\n ) : (\n <span style={{ wordBreak: \"break-word\", overflowWrap: \"break-word\" }}>\n {item.text}\n </span>\n )}\n {!showTyping && (\n <BubbleTail side={outgoing ? \"right\" : \"left\"} color={bg} />\n )}\n {item.reaction !== undefined && (\n <div\n style={{\n position: \"absolute\",\n top: -16,\n left: outgoing ? -14 : undefined,\n right: outgoing ? undefined : -14,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: 30,\n height: 30,\n borderRadius: \"50%\",\n background: INCOMING_BG,\n fontSize: 15,\n boxShadow: \"0 1px 2px rgba(0,0,0,0.12)\",\n opacity: reactionOpacity,\n transform: `scale(${reactionScale})`,\n transformOrigin: outgoing ? \"bottom left\" : \"bottom right\",\n }}\n >\n {item.reaction}\n </div>\n )}\n </div>\n );\n\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: outgoing ? \"flex-end\" : \"flex-start\",\n gap: 2,\n width: \"100%\",\n opacity,\n transform: `translateY(${translateY}px) scale(${scale})`,\n transformOrigin: outgoing ? \"bottom right\" : \"bottom left\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-end\",\n justifyContent: outgoing ? \"flex-end\" : \"flex-start\",\n gap: 7,\n width: \"100%\",\n }}\n >\n {!outgoing && contact !== undefined && (\n <Avatar contact={contact} size={28} />\n )}\n {bubble}\n </div>\n {delivered && (\n <span\n style={{\n fontSize: 11,\n color: META_GRAY,\n paddingRight: 4,\n }}\n >\n Delivered\n </span>\n )}\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/imessage-chat-flow.tsx"}diff --git a/public/r/input.json b/public/r/input.jsonindex 1d03a7ff..6b77c62a 100644--- a/public/r/input.json+++ b/public/r/input.json@@ -8,13 +8,13 @@"files": [{"path": "registry/remocn-ui/input/index.tsx",- "content": "\"use client\";\n\nimport {\n mixOklch,\n type RemocnTheme,\n revealedText,\n useRemocnTheme,\n} from \"@/lib/remocn-ui\";\nimport { Caret } from \"@/components/remocn/caret\";\n\nexport type InputState =\n | \"idle\"\n | \"hover\"\n | \"active\"\n | \"typing\"\n | \"blur\"\n | \"invalid\";\n\ntype InputSize = \"sm\" | \"default\" | \"lg\";\n\nexport interface InputProps {\n state?: InputState;\n style?: InputStyle;\n placeholder?: string;\n value?: string;\n size?: InputSize;\n theme?: Partial<RemocnTheme>;\n primary?: string;\n fullWidth?: boolean;\n className?: string;\n}\n\nconst FIELD_WIDTH = 320;\n\nconst SIZE_STYLES: Record<\n InputSize,\n { height: number; padding: number; fontSize: number }\n> = {\n sm: { height: 36, padding: 12, fontSize: 13 },\n default: { height: 40, padding: 14, fontSize: 15 },\n lg: { height: 48, padding: 16, fontSize: 17 },\n};\n\nexport interface InputStyle {\n borderColor: string;\n ringColor: string;\n ringWidth: number;\n background: string;\n caretOpacity: number;\n valueReveal: number;\n placeholderOpacity: number;\n}\n\nexport interface InputStyleContext {\n idleBorder: string;\n hoverBorder: string;\n activeBorder: string;\n invalidBorder: string;\n ring: string;\n invalidRing: string;\n background: string;\n hoverBackground: string;\n foreground: string;\n mutedForeground: string;\n}\n\nexport function inputStyleContext(theme: RemocnTheme): InputStyleContext {\n return {\n idleBorder: theme.input,\n hoverBorder: mixOklch(theme.input, theme.foreground, 0.18),\n activeBorder: theme.ring,\n invalidBorder: theme.destructive,\n ring: mixOklch(theme.background, theme.ring, 0.5),\n invalidRing: mixOklch(theme.background, theme.destructive, 0.4),\n background: theme.background,\n hoverBackground: mixOklch(theme.background, theme.muted, 0.4),\n foreground: theme.foreground,\n mutedForeground: theme.mutedForeground,\n };\n}\n\nexport function inputStyle(\n state: InputState,\n ctx: InputStyleContext,\n): InputStyle {\n switch (state) {\n case \"hover\":\n return {\n borderColor: ctx.hoverBorder,\n ringColor: ctx.ring,\n ringWidth: 0,\n background: ctx.hoverBackground,\n caretOpacity: 0,\n valueReveal: 0,\n placeholderOpacity: 1,\n };\n case \"active\":\n return {\n borderColor: ctx.activeBorder,\n ringColor: ctx.ring,\n ringWidth: 3,\n background: ctx.background,\n caretOpacity: 1,\n valueReveal: 0,\n placeholderOpacity: 1,\n };\n case \"typing\":\n return {\n borderColor: ctx.activeBorder,\n ringColor: ctx.ring,\n ringWidth: 3,\n background: ctx.background,\n caretOpacity: 1,\n valueReveal: 1,\n placeholderOpacity: 0,\n };\n case \"blur\":\n return {\n borderColor: ctx.idleBorder,\n ringColor: ctx.ring,\n ringWidth: 0,\n background: ctx.background,\n caretOpacity: 0,\n valueReveal: 1,\n placeholderOpacity: 0,\n };\n case \"invalid\":\n return {\n borderColor: ctx.invalidBorder,\n ringColor: ctx.invalidRing,\n ringWidth: 3,\n background: ctx.background,\n caretOpacity: 0,\n valueReveal: 1,\n placeholderOpacity: 0,\n };\n default:\n return {\n borderColor: ctx.idleBorder,\n ringColor: ctx.ring,\n ringWidth: 0,\n background: ctx.background,\n caretOpacity: 0,\n valueReveal: 0,\n placeholderOpacity: 1,\n };\n }\n}\n\nexport function Input({\n state = \"idle\",\n style,\n placeholder = \"[email protected]\",\n value = \"[email protected]\",\n size = \"default\",\n theme: themeOverride,\n primary,\n fullWidth = false,\n className,\n}: InputProps) {\n const theme = useRemocnTheme(\n { ...themeOverride, ...(primary ? { primary } : {}) },\n \"light\",\n );\n\n const sizeStyle = SIZE_STYLES[size];\n const ctx = inputStyleContext(theme);\n const v = style ?? inputStyle(state, ctx);\n const revealed = revealedText(value, Math.round(value.length * v.valueReveal));\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div\n className={className}\n style={{\n position: \"relative\",\n display: \"flex\",\n alignItems: \"center\",\n width: fullWidth ? \"100%\" : FIELD_WIDTH,\n height: sizeStyle.height,\n padding: `0 ${sizeStyle.padding}px`,\n fontSize: sizeStyle.fontSize,\n letterSpacing: \"-0.01em\",\n background: v.background,\n border: `1px solid ${v.borderColor}`,\n borderRadius: theme.radius,\n boxShadow: `0 0 0 ${v.ringWidth}px ${v.ringColor}`,\n }}\n >\n {}\n <span\n style={{\n position: \"absolute\",\n left: sizeStyle.padding,\n color: ctx.mutedForeground,\n opacity: v.valueReveal > 0 ? 0 : v.placeholderOpacity,\n pointerEvents: \"none\",\n whiteSpace: \"nowrap\",\n }}\n >\n {placeholder}\n </span>\n {}\n <div style={{ display: \"flex\", alignItems: \"center\", minWidth: 0 }}>\n <span style={{ whiteSpace: \"nowrap\", color: ctx.foreground }}>\n {revealed}\n </span>\n <Caret\n color={ctx.foreground}\n height={Math.round(sizeStyle.fontSize * 1.1)}\n radius={1}\n opacity={v.caretOpacity}\n marginLeft={revealed.length > 0 ? 4 : 0}\n />\n </div>\n </div>\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport { Caret } from \"@/components/remocn/caret\";\nimport {\n mixOklch,\n type RemocnTheme,\n revealedText,\n useRemocnTheme,\n} from \"@/lib/remocn-ui\";\n\nexport type InputState =\n | \"idle\"\n | \"hover\"\n | \"active\"\n | \"typing\"\n | \"blur\"\n | \"invalid\";\n\ntype InputSize = \"sm\" | \"default\" | \"lg\";\n\nexport interface InputProps {\n state?: InputState;\n style?: InputStyle;\n placeholder?: string;\n value?: string;\n size?: InputSize;\n theme?: Partial<RemocnTheme>;\n primary?: string;\n fullWidth?: boolean;\n className?: string;\n}\n\nconst FIELD_WIDTH = 320;\n\nconst SIZE_STYLES: Record<\n InputSize,\n { height: number; padding: number; fontSize: number }\n> = {\n sm: { height: 36, padding: 12, fontSize: 13 },\n default: { height: 40, padding: 14, fontSize: 15 },\n lg: { height: 48, padding: 16, fontSize: 17 },\n};\n\nexport interface InputStyle {\n borderColor: string;\n ringColor: string;\n ringWidth: number;\n background: string;\n caretOpacity: number;\n valueReveal: number;\n placeholderOpacity: number;\n}\n\nexport interface InputStyleContext {\n idleBorder: string;\n hoverBorder: string;\n activeBorder: string;\n invalidBorder: string;\n ring: string;\n invalidRing: string;\n background: string;\n hoverBackground: string;\n foreground: string;\n mutedForeground: string;\n}\n\nexport function inputStyleContext(theme: RemocnTheme): InputStyleContext {\n return {\n idleBorder: theme.input,\n hoverBorder: mixOklch(theme.input, theme.foreground, 0.18),\n activeBorder: theme.ring,\n invalidBorder: theme.destructive,\n ring: mixOklch(theme.background, theme.ring, 0.5),\n invalidRing: mixOklch(theme.background, theme.destructive, 0.4),\n background: theme.background,\n hoverBackground: mixOklch(theme.background, theme.muted, 0.4),\n foreground: theme.foreground,\n mutedForeground: theme.mutedForeground,\n };\n}\n\nexport function inputStyle(\n state: InputState,\n ctx: InputStyleContext,\n): InputStyle {\n switch (state) {\n case \"hover\":\n return {\n borderColor: ctx.hoverBorder,\n ringColor: ctx.ring,\n ringWidth: 0,\n background: ctx.hoverBackground,\n caretOpacity: 0,\n valueReveal: 0,\n placeholderOpacity: 1,\n };\n case \"active\":\n return {\n borderColor: ctx.activeBorder,\n ringColor: ctx.ring,\n ringWidth: 3,\n background: ctx.background,\n caretOpacity: 1,\n valueReveal: 0,\n placeholderOpacity: 1,\n };\n case \"typing\":\n return {\n borderColor: ctx.activeBorder,\n ringColor: ctx.ring,\n ringWidth: 3,\n background: ctx.background,\n caretOpacity: 1,\n valueReveal: 1,\n placeholderOpacity: 0,\n };\n case \"blur\":\n return {\n borderColor: ctx.idleBorder,\n ringColor: ctx.ring,\n ringWidth: 0,\n background: ctx.background,\n caretOpacity: 0,\n valueReveal: 1,\n placeholderOpacity: 0,\n };\n case \"invalid\":\n return {\n borderColor: ctx.invalidBorder,\n ringColor: ctx.invalidRing,\n ringWidth: 3,\n background: ctx.background,\n caretOpacity: 0,\n valueReveal: 1,\n placeholderOpacity: 0,\n };\n default:\n return {\n borderColor: ctx.idleBorder,\n ringColor: ctx.ring,\n ringWidth: 0,\n background: ctx.background,\n caretOpacity: 0,\n valueReveal: 0,\n placeholderOpacity: 1,\n };\n }\n}\n\nexport function Input({\n state = \"idle\",\n style,\n placeholder = \"[email protected]\",\n value = \"[email protected]\",\n size = \"default\",\n theme: themeOverride,\n primary,\n fullWidth = false,\n className,\n}: InputProps) {\n const theme = useRemocnTheme(\n { ...themeOverride, ...(primary ? { primary } : {}) },\n \"light\",\n );\n\n const sizeStyle = SIZE_STYLES[size];\n const ctx = inputStyleContext(theme);\n const v = style ?? inputStyle(state, ctx);\n const revealed = revealedText(\n value,\n Math.round(value.length * v.valueReveal),\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div\n className={className}\n style={{\n position: \"relative\",\n display: \"flex\",\n alignItems: \"center\",\n width: fullWidth ? \"100%\" : FIELD_WIDTH,\n height: sizeStyle.height,\n padding: `0 ${sizeStyle.padding}px`,\n fontSize: sizeStyle.fontSize,\n letterSpacing: \"-0.01em\",\n background: v.background,\n border: `1px solid ${v.borderColor}`,\n borderRadius: theme.radius,\n boxShadow: `0 0 0 ${v.ringWidth}px ${v.ringColor}`,\n }}\n >\n {}\n <span\n style={{\n position: \"absolute\",\n left: sizeStyle.padding,\n color: ctx.mutedForeground,\n opacity: v.valueReveal > 0 ? 0 : v.placeholderOpacity,\n pointerEvents: \"none\",\n whiteSpace: \"nowrap\",\n }}\n >\n {placeholder}\n </span>\n {}\n <div style={{ display: \"flex\", alignItems: \"center\", minWidth: 0 }}>\n <span style={{ whiteSpace: \"nowrap\", color: ctx.foreground }}>\n {revealed}\n </span>\n <Caret\n color={ctx.foreground}\n height={Math.round(sizeStyle.fontSize * 1.1)}\n radius={1}\n opacity={v.caretOpacity}\n marginLeft={revealed.length > 0 ? 4 : 0}\n />\n </div>\n </div>\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/input.tsx"},{"path": "registry/remocn-ui/input/use-input-transition.ts",- "content": "\"use client\";\n\nimport {\n easings,\n mixOklch,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\nimport {\n inputStyle,\n inputStyleContext,\n type InputState,\n type InputStyle,\n} from \"@/components/remocn/input\";\n\nexport const DEFAULT_DURATION = 8;\n\nexport function tweenInputStyle(\n a: InputStyle,\n b: InputStyle,\n t: number,\n): InputStyle {\n return {\n ringWidth: a.ringWidth + (b.ringWidth - a.ringWidth) * t,\n caretOpacity: a.caretOpacity + (b.caretOpacity - a.caretOpacity) * t,\n valueReveal: a.valueReveal + (b.valueReveal - a.valueReveal) * t,\n placeholderOpacity:\n a.placeholderOpacity + (b.placeholderOpacity - a.placeholderOpacity) * t,\n borderColor: mixOklch(a.borderColor, b.borderColor, t),\n ringColor: mixOklch(a.ringColor, b.ringColor, t),\n background: mixOklch(a.background, b.background, t),\n };\n}\n\nexport interface InputTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n primary?: string;\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useInputTransition(\n steps: Step<InputState>[],\n opts: InputTransitionOptions = {},\n): InputStyle {\n const {\n theme: themeOverride,\n mode,\n primary,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(\n { ...themeOverride, ...(primary ? { primary } : {}) },\n mode,\n );\n const ctx = inputStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"idle\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenInputStyle(inputStyle(from, ctx), inputStyle(to, ctx), t);\n}\n",+ "content": "\"use client\";\n\nimport {\n type InputState,\n type InputStyle,\n inputStyle,\n inputStyleContext,\n} from \"@/components/remocn/input\";\nimport {\n easings,\n mixOklch,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\n\nexport const DEFAULT_DURATION = 8;\n\nexport function tweenInputStyle(\n a: InputStyle,\n b: InputStyle,\n t: number,\n): InputStyle {\n return {\n ringWidth: a.ringWidth + (b.ringWidth - a.ringWidth) * t,\n caretOpacity: a.caretOpacity + (b.caretOpacity - a.caretOpacity) * t,\n valueReveal: a.valueReveal + (b.valueReveal - a.valueReveal) * t,\n placeholderOpacity:\n a.placeholderOpacity + (b.placeholderOpacity - a.placeholderOpacity) * t,\n borderColor: mixOklch(a.borderColor, b.borderColor, t),\n ringColor: mixOklch(a.ringColor, b.ringColor, t),\n background: mixOklch(a.background, b.background, t),\n };\n}\n\nexport interface InputTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n primary?: string;\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useInputTransition(\n steps: Step<InputState>[],\n opts: InputTransitionOptions = {},\n): InputStyle {\n const {\n theme: themeOverride,\n mode,\n primary,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(\n { ...themeOverride, ...(primary ? { primary } : {}) },\n mode,\n );\n const ctx = inputStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"idle\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenInputStyle(inputStyle(from, ctx), inputStyle(to, ctx), t);\n}\n","type": "registry:component","target": "components/remocn/use-input-transition.ts"}diff --git a/public/r/line-by-line-slide.json b/public/r/line-by-line-slide.jsonindex 36070dfc..aff5c9e1 100644--- a/public/r/line-by-line-slide.json+++ b/public/r/line-by-line-slide.json@@ -7,7 +7,7 @@"files": [{"path": "registry/remocn/line-by-line-slide/index.tsx",- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface LineByLineSlideProps {\n text: string;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function LineByLineSlide({\n text,\n distance = 48,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: LineByLineSlideProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const lines = text.split(\"\\n\");\n\n const enterDur = 27;\n const exitDur = 18;\n const enterStagger = 4;\n const exitStagger = 2;\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterEnd = enterDur + (lines.length - 1) * enterStagger;\n const exitStart = Math.max(enterEnd, durationInFrames - exitDur - (lines.length - 1) * exitStagger);\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n lineHeight: 1.1,\n textAlign: \"left\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {lines.map((line, i) => {\n const enterLocal = frame - i * enterStagger;\n const exitLocal = frame - exitStart - i * exitStagger;\n\n const enterP = interpolate(enterLocal, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(exitLocal, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const xEnter = interpolate(enterLocal, [0, enterDur], [-distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const xExit = interpolate(exitLocal, [0, exitDur], [0, distance], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const x = xEnter + xExit;\n\n return (\n <span\n key={i}\n style={{\n display: \"block\",\n transformOrigin: \"0% 50%\",\n opacity,\n transform: `translateX(${x}px)`,\n }}\n >\n {line}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface LineByLineSlideProps {\n text: string;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function LineByLineSlide({\n text,\n distance = 48,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: LineByLineSlideProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const lines = text.split(\"\\n\");\n\n const enterDur = 27;\n const exitDur = 18;\n const enterStagger = 4;\n const exitStagger = 2;\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterEnd = enterDur + (lines.length - 1) * enterStagger;\n const exitStart = Math.max(\n enterEnd,\n durationInFrames - exitDur - (lines.length - 1) * exitStagger,\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n lineHeight: 1.1,\n textAlign: \"left\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {lines.map((line, i) => {\n const enterLocal = frame - i * enterStagger;\n const exitLocal = frame - exitStart - i * exitStagger;\n\n const enterP = interpolate(enterLocal, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(exitLocal, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const xEnter = interpolate(\n enterLocal,\n [0, enterDur],\n [-distance, 0],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n },\n );\n\n const xExit = interpolate(exitLocal, [0, exitDur], [0, distance], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const x = xEnter + xExit;\n\n return (\n <span\n key={i}\n style={{\n display: \"block\",\n transformOrigin: \"0% 50%\",\n opacity,\n transform: `translateX(${x}px)`,\n }}\n >\n {line}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/line-by-line-slide.tsx"}diff --git a/public/r/logo-enter.json b/public/r/logo-enter.jsonindex b48361e6..cd4b83be 100644--- a/public/r/logo-enter.json+++ b/public/r/logo-enter.json@@ -7,7 +7,7 @@"files": [{"path": "registry/remocn/logo-enter/index.tsx",- "content": "\"use client\";\n\nimport { type ReactNode } from \"react\";\nimport {\n AbsoluteFill,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport interface Logo {\n mark: ReactNode;\n bg?: string;\n}\n\nexport interface LogoEnterProps {\n logos?: Logo[];\n diameter?: number;\n overlap?: number;\n ringColor?: string;\n orientation?: \"horizontal\" | \"vertical\";\n stagger?: number;\n speed?: number;\n}\n\nconst ClaudeMark = () => (\n <svg\n width=\"100%\"\n height=\"100%\"\n preserveAspectRatio=\"xMidYMid\"\n viewBox=\"0 0 256 257\"\n >\n <path\n fill=\"#D97757\"\n d=\"m50.228 170.321 50.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0 125.796l.583-3.759 5.12-3.434 7.324.648 16.202 1.101 24.304 1.685 17.629 1.037 26.118 2.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758 7-7.713 9.397.649 2.398.648 9.527 7.323 20.35 15.75L94.817 91.9l3.889 3.24 1.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42 0 82.05 1.426l4.472 3.888 6.61 15.101 10.694 23.786 16.591 32.34 4.861 9.592 2.592 8.879.973 2.722h1.685v-1.556l1.36-18.211 2.528-22.36 2.463-28.776.843-8.1 4.018-9.722 7.971-5.25 6.222 2.981 5.12 7.324-.713 4.73-3.046 19.768-5.962 30.98-3.889 20.739h2.268l2.593-2.593 10.499-13.934 17.628-22.036 7.778-8.749 9.073-9.657 5.833-4.601h11.018l8.1 12.055-3.628 12.443-11.342 14.388-9.398 12.184-13.48 18.147-8.426 14.518.778 1.166 2.01-.194 30.46-6.481 16.462-2.982 19.637-3.37 8.88 4.148.971 4.213-3.5 8.62-20.998 5.184-24.628 4.926-36.682 8.685-.454.324.519.648 16.526 1.555 7.065.389h17.304l32.21 2.398 8.426 5.574 5.055 6.805-.843 5.184-12.962 6.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666 11.406 21.387 19.314 26.767 24.887 1.36 6.157-3.434 4.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73 6.935 25.017 37.59 1.296 11.536-1.814 3.76-6.481 2.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194 77.448-3.37 3.953-7.778 2.981-6.48-4.925-3.436-7.972 3.435-15.749 4.148-20.544 3.37-16.333 3.046-20.285 1.815-6.74-.13-.454-1.49.194-15.295 20.999-23.267 31.433-18.406 19.702-4.407 1.75-7.648-3.954.713-7.064 4.277-6.286 25.47-32.405 15.36-20.092 9.917-11.6-.065-1.686h-.583L44.07 198.125l-12.055 1.555-5.185-4.86.648-7.972 2.463-2.593 20.35-13.999-.064.065Z\"\n />\n </svg>\n);\n\nconst CodexMark = () => (\n <svg\n width=\"100%\"\n height=\"100%\"\n fill=\"#fff\"\n fillRule=\"evenodd\"\n viewBox=\"0 0 24 24\"\n >\n <path\n clipRule=\"evenodd\"\n d=\"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z\"\n />\n </svg>\n);\n\nconst CursorMark = () => (\n <svg width=\"100%\" height=\"100%\" fill=\"#fff\" viewBox=\"0 0 466.73 532.09\">\n <path d=\"M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z\" />\n </svg>\n);\n\nconst GrokMark = () => (\n <svg width=\"100%\" height=\"100%\" fill=\"none\" viewBox=\"0 0 1024 1024\">\n <path\n fill=\"#fff\"\n d=\"M395.479 633.828L735.91 381.105C752.599 368.715 776.454 373.548 784.406 392.792C826.26 494.285 807.561 616.253 724.288 699.996C641.016 783.739 525.151 802.104 419.247 760.277L303.556 814.143C469.49 928.202 670.987 899.995 796.901 773.282C896.776 672.843 927.708 535.937 898.785 412.476L899.047 412.739C857.105 231.37 909.358 158.874 1016.4 10.6326C1018.93 7.11771 1021.47 3.60279 1024 0L883.144 141.651V141.212L395.392 633.916\"\n />\n <path\n fill=\"#fff\"\n d=\"M325.226 695.251C206.128 580.84 226.662 403.776 328.285 301.668C403.431 226.097 526.549 195.254 634.026 240.596L749.454 186.994C728.657 171.88 702.007 155.623 671.424 144.2C533.19 86.9942 367.693 115.465 255.323 228.382C147.234 337.081 113.244 504.215 171.613 646.833C215.216 753.423 143.739 828.818 71.7385 904.916C46.2237 931.893 20.6216 958.87 0 987.429L325.139 695.339\"\n />\n </svg>\n);\n\nexport const SAMPLE_LOGOS: Logo[] = [\n { mark: <ClaudeMark />, bg: \"#F0EEE6\" },\n { mark: <CodexMark />, bg: \"#0A0A0A\" },\n { mark: <CursorMark />, bg: \"#0A0A0A\" },\n { mark: <GrokMark />, bg: \"#0A0A0A\" },\n];\n\nexport function LogoEnter({\n logos = SAMPLE_LOGOS,\n diameter = 118,\n overlap = 38,\n ringColor = \"#fff\",\n orientation = \"horizontal\",\n stagger = 7,\n speed = 1,\n}: LogoEnterProps) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const isVertical = orientation === \"vertical\";\n\n return (\n <AbsoluteFill\n style={{\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: isVertical ? \"column\" : \"row\",\n }}\n >\n {logos.map(({ mark, bg }, i) => {\n const s = spring({\n fps,\n frame: frame * speed - i * stagger,\n config: { damping: 13, stiffness: 130, mass: 0.8 },\n });\n const scale = interpolate(s, [0, 1], [0.5, 1]);\n const offset = interpolate(s, [0, 1], [22, 0]);\n const lead = i === 0 ? 0 : -overlap;\n return (\n <div\n key={i}\n style={{\n width: diameter,\n height: diameter,\n borderRadius: \"50%\",\n marginLeft: isVertical ? 0 : lead,\n marginTop: isVertical ? lead : 0,\n zIndex: logos.length - i,\n background: bg,\n border: `5px solid ${ringColor}`,\n boxShadow: \"0 20px 48px rgba(0,0,0,0.5)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: s,\n transform: isVertical\n ? `translateX(${offset}px) scale(${scale})`\n : `translateY(${offset}px) scale(${scale})`,\n }}\n >\n <div\n style={{\n width: diameter * 0.52,\n height: diameter * 0.52,\n display: \"flex\",\n }}\n >\n {mark}\n </div>\n </div>\n );\n })}\n </div>\n </AbsoluteFill>\n );\n}\n",+ "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport {\n AbsoluteFill,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport interface Logo {\n mark: ReactNode;\n bg?: string;\n}\n\nexport interface LogoEnterProps {\n logos?: Logo[];\n diameter?: number;\n overlap?: number;\n ringColor?: string;\n orientation?: \"horizontal\" | \"vertical\";\n stagger?: number;\n speed?: number;\n}\n\nconst ClaudeMark = () => (\n <svg\n width=\"100%\"\n height=\"100%\"\n preserveAspectRatio=\"xMidYMid\"\n viewBox=\"0 0 256 257\"\n >\n <path\n fill=\"#D97757\"\n d=\"m50.228 170.321 50.357-28.257.843-2.463-.843-1.361h-2.462l-8.426-.518-28.775-.778-24.952-1.037-24.175-1.296-6.092-1.297L0 125.796l.583-3.759 5.12-3.434 7.324.648 16.202 1.101 24.304 1.685 17.629 1.037 26.118 2.722h4.148l.583-1.685-1.426-1.037-1.101-1.037-25.147-17.045-27.22-18.017-14.258-10.37-7.713-5.25-3.888-4.925-1.685-10.758 7-7.713 9.397.649 2.398.648 9.527 7.323 20.35 15.75L94.817 91.9l3.889 3.24 1.555-1.102.195-.777-1.75-2.917-14.453-26.118-15.425-26.572-6.87-11.018-1.814-6.61c-.648-2.723-1.102-4.991-1.102-7.778l7.972-10.823L71.42 0 82.05 1.426l4.472 3.888 6.61 15.101 10.694 23.786 16.591 32.34 4.861 9.592 2.592 8.879.973 2.722h1.685v-1.556l1.36-18.211 2.528-22.36 2.463-28.776.843-8.1 4.018-9.722 7.971-5.25 6.222 2.981 5.12 7.324-.713 4.73-3.046 19.768-5.962 30.98-3.889 20.739h2.268l2.593-2.593 10.499-13.934 17.628-22.036 7.778-8.749 9.073-9.657 5.833-4.601h11.018l8.1 12.055-3.628 12.443-11.342 14.388-9.398 12.184-13.48 18.147-8.426 14.518.778 1.166 2.01-.194 30.46-6.481 16.462-2.982 19.637-3.37 8.88 4.148.971 4.213-3.5 8.62-20.998 5.184-24.628 4.926-36.682 8.685-.454.324.519.648 16.526 1.555 7.065.389h17.304l32.21 2.398 8.426 5.574 5.055 6.805-.843 5.184-12.962 6.611-17.498-4.148-40.83-9.721-14-3.5h-1.944v1.167l11.666 11.406 21.387 19.314 26.767 24.887 1.36 6.157-3.434 4.86-3.63-.518-23.526-17.693-9.073-7.972-20.545-17.304h-1.36v1.814l4.73 6.935 25.017 37.59 1.296 11.536-1.814 3.76-6.481 2.268-7.13-1.297-14.647-20.544-15.1-23.138-12.185-20.739-1.49.843-7.194 77.448-3.37 3.953-7.778 2.981-6.48-4.925-3.436-7.972 3.435-15.749 4.148-20.544 3.37-16.333 3.046-20.285 1.815-6.74-.13-.454-1.49.194-15.295 20.999-23.267 31.433-18.406 19.702-4.407 1.75-7.648-3.954.713-7.064 4.277-6.286 25.47-32.405 15.36-20.092 9.917-11.6-.065-1.686h-.583L44.07 198.125l-12.055 1.555-5.185-4.86.648-7.972 2.463-2.593 20.35-13.999-.064.065Z\"\n />\n </svg>\n);\n\nconst CodexMark = () => (\n <svg\n width=\"100%\"\n height=\"100%\"\n fill=\"#fff\"\n fillRule=\"evenodd\"\n viewBox=\"0 0 24 24\"\n >\n <path\n clipRule=\"evenodd\"\n d=\"M8.086.457a6.105 6.105 0 013.046-.415c1.333.153 2.521.72 3.564 1.7a.117.117 0 00.107.029c1.408-.346 2.762-.224 4.061.366l.063.03.154.076c1.357.703 2.33 1.77 2.918 3.198.278.679.418 1.388.421 2.126a5.655 5.655 0 01-.18 1.631.167.167 0 00.04.155 5.982 5.982 0 011.578 2.891c.385 1.901-.01 3.615-1.183 5.14l-.182.22a6.063 6.063 0 01-2.934 1.851.162.162 0 00-.108.102c-.255.736-.511 1.364-.987 1.992-1.199 1.582-2.962 2.462-4.948 2.451-1.583-.008-2.986-.587-4.21-1.736a.145.145 0 00-.14-.032c-.518.167-1.04.191-1.604.185a5.924 5.924 0 01-2.595-.622 6.058 6.058 0 01-2.146-1.781c-.203-.269-.404-.522-.551-.821a7.74 7.74 0 01-.495-1.283 6.11 6.11 0 01-.017-3.064.166.166 0 00.008-.074.115.115 0 00-.037-.064 5.958 5.958 0 01-1.38-2.202 5.196 5.196 0 01-.333-1.589 6.915 6.915 0 01.188-2.132c.45-1.484 1.309-2.648 2.577-3.493.282-.188.55-.334.802-.438.286-.12.573-.22.861-.304a.129.129 0 00.087-.087A6.016 6.016 0 015.635 2.31C6.315 1.464 7.132.846 8.086.457zm-.804 7.85a.848.848 0 00-1.473.842l1.694 2.965-1.688 2.848a.849.849 0 001.46.864l1.94-3.272a.849.849 0 00.007-.854l-1.94-3.393zm5.446 6.24a.849.849 0 000 1.695h4.848a.849.849 0 000-1.696h-4.848z\"\n />\n </svg>\n);\n\nconst CursorMark = () => (\n <svg width=\"100%\" height=\"100%\" fill=\"#fff\" viewBox=\"0 0 466.73 532.09\">\n <path d=\"M457.43,125.94L244.42,2.96c-6.84-3.95-15.28-3.95-22.12,0L9.3,125.94c-5.75,3.32-9.3,9.46-9.3,16.11v247.99c0,6.65,3.55,12.79,9.3,16.11l213.01,122.98c6.84,3.95,15.28,3.95,22.12,0l213.01-122.98c5.75-3.32,9.3-9.46,9.3-16.11v-247.99c0-6.65-3.55-12.79-9.3-16.11h-.01ZM444.05,151.99l-205.63,356.16c-1.39,2.4-5.06,1.42-5.06-1.36v-233.21c0-4.66-2.49-8.97-6.53-11.31L24.87,145.67c-2.4-1.39-1.42-5.06,1.36-5.06h411.26c5.84,0,9.49,6.33,6.57,11.39h-.01Z\" />\n </svg>\n);\n\nconst GrokMark = () => (\n <svg width=\"100%\" height=\"100%\" fill=\"none\" viewBox=\"0 0 1024 1024\">\n <path\n fill=\"#fff\"\n d=\"M395.479 633.828L735.91 381.105C752.599 368.715 776.454 373.548 784.406 392.792C826.26 494.285 807.561 616.253 724.288 699.996C641.016 783.739 525.151 802.104 419.247 760.277L303.556 814.143C469.49 928.202 670.987 899.995 796.901 773.282C896.776 672.843 927.708 535.937 898.785 412.476L899.047 412.739C857.105 231.37 909.358 158.874 1016.4 10.6326C1018.93 7.11771 1021.47 3.60279 1024 0L883.144 141.651V141.212L395.392 633.916\"\n />\n <path\n fill=\"#fff\"\n d=\"M325.226 695.251C206.128 580.84 226.662 403.776 328.285 301.668C403.431 226.097 526.549 195.254 634.026 240.596L749.454 186.994C728.657 171.88 702.007 155.623 671.424 144.2C533.19 86.9942 367.693 115.465 255.323 228.382C147.234 337.081 113.244 504.215 171.613 646.833C215.216 753.423 143.739 828.818 71.7385 904.916C46.2237 931.893 20.6216 958.87 0 987.429L325.139 695.339\"\n />\n </svg>\n);\n\nexport const SAMPLE_LOGOS: Logo[] = [\n { mark: <ClaudeMark />, bg: \"#F0EEE6\" },\n { mark: <CodexMark />, bg: \"#0A0A0A\" },\n { mark: <CursorMark />, bg: \"#0A0A0A\" },\n { mark: <GrokMark />, bg: \"#0A0A0A\" },\n];\n\nexport function LogoEnter({\n logos = SAMPLE_LOGOS,\n diameter = 118,\n overlap = 38,\n ringColor = \"#fff\",\n orientation = \"horizontal\",\n stagger = 7,\n speed = 1,\n}: LogoEnterProps) {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const isVertical = orientation === \"vertical\";\n\n return (\n <AbsoluteFill\n style={{\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: isVertical ? \"column\" : \"row\",\n }}\n >\n {logos.map(({ mark, bg }, i) => {\n const s = spring({\n fps,\n frame: frame * speed - i * stagger,\n config: { damping: 13, stiffness: 130, mass: 0.8 },\n });\n const scale = interpolate(s, [0, 1], [0.5, 1]);\n const offset = interpolate(s, [0, 1], [22, 0]);\n const lead = i === 0 ? 0 : -overlap;\n return (\n <div\n key={i}\n style={{\n width: diameter,\n height: diameter,\n borderRadius: \"50%\",\n marginLeft: isVertical ? 0 : lead,\n marginTop: isVertical ? lead : 0,\n zIndex: logos.length - i,\n background: bg,\n border: `5px solid ${ringColor}`,\n boxShadow: \"0 20px 48px rgba(0,0,0,0.5)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: s,\n transform: isVertical\n ? `translateX(${offset}px) scale(${scale})`\n : `translateY(${offset}px) scale(${scale})`,\n }}\n >\n <div\n style={{\n width: diameter * 0.52,\n height: diameter * 0.52,\n display: \"flex\",\n }}\n >\n {mark}\n </div>\n </div>\n );\n })}\n </div>\n </AbsoluteFill>\n );\n}\n","type": "registry:component","target": "components/remocn/logo-enter.tsx"}diff --git a/public/r/mask-reveal-up.json b/public/r/mask-reveal-up.jsonindex 3799bc8d..8f7da0d0 100644--- a/public/r/mask-reveal-up.json+++ b/public/r/mask-reveal-up.json@@ -7,7 +7,7 @@"files": [{"path": "registry/remocn/mask-reveal-up/index.tsx",- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface MaskRevealUpProps {\n text: string;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function MaskRevealUp({\n text,\n distance = 30,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: MaskRevealUpProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const lines = text.split(\"\\n\");\n\n const enterDur = 23;\n const exitDur = 16;\n const enterStagger = 3;\n const exitStagger = 2;\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterEnd = enterDur + (lines.length - 1) * enterStagger;\n const exitStart = Math.max(enterEnd, durationInFrames - exitDur - (lines.length - 1) * exitStagger);\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n lineHeight: 1.1,\n textAlign: \"center\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {lines.map((line, i) => {\n const enterLocal = frame - i * enterStagger;\n const exitLocal = frame - exitStart - i * exitStagger;\n\n const enterP = interpolate(enterLocal, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(exitLocal, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(enterLocal, [0, enterDur], [distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const yExit = interpolate(exitLocal, [0, exitDur], [0, -22], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const y = yEnter + yExit;\n\n const blurEnter = interpolate(enterLocal, [0, enterDur], [6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const blurExit = interpolate(exitLocal, [0, exitDur], [0, 6], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const blur = blurEnter + blurExit;\n\n return (\n <span\n key={i}\n style={{\n display: \"block\",\n transformOrigin: \"50% 50%\",\n opacity,\n transform: `translateY(${y}px)`,\n filter: `blur(${blur}px)`,\n }}\n >\n {line}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface MaskRevealUpProps {\n text: string;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function MaskRevealUp({\n text,\n distance = 30,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: MaskRevealUpProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const lines = text.split(\"\\n\");\n\n const enterDur = 23;\n const exitDur = 16;\n const enterStagger = 3;\n const exitStagger = 2;\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterEnd = enterDur + (lines.length - 1) * enterStagger;\n const exitStart = Math.max(\n enterEnd,\n durationInFrames - exitDur - (lines.length - 1) * exitStagger,\n );\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n lineHeight: 1.1,\n textAlign: \"center\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {lines.map((line, i) => {\n const enterLocal = frame - i * enterStagger;\n const exitLocal = frame - exitStart - i * exitStagger;\n\n const enterP = interpolate(enterLocal, [0, enterDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(exitLocal, [0, exitDur], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(enterLocal, [0, enterDur], [distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const yExit = interpolate(exitLocal, [0, exitDur], [0, -22], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const y = yEnter + yExit;\n\n const blurEnter = interpolate(enterLocal, [0, enterDur], [6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const blurExit = interpolate(exitLocal, [0, exitDur], [0, 6], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const blur = blurEnter + blurExit;\n\n return (\n <span\n key={i}\n style={{\n display: \"block\",\n transformOrigin: \"50% 50%\",\n opacity,\n transform: `translateY(${y}px)`,\n filter: `blur(${blur}px)`,\n }}\n >\n {line}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/mask-reveal-up.tsx"}diff --git a/public/r/message-bubble.json b/public/r/message-bubble.jsonindex 271714eb..1ae64c03 100644--- a/public/r/message-bubble.json+++ b/public/r/message-bubble.json@@ -8,13 +8,13 @@"files": [{"path": "registry/remocn-ui/message-bubble/index.tsx",- "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type MessageBubbleState = \"hidden\" | \"visible\";\n\nexport type MessageBubbleVariant = \"incoming\" | \"outgoing\";\n\nexport interface MessageBubbleProps {\n state?: MessageBubbleState;\n style?: MessageBubbleStyle;\n variant?: MessageBubbleVariant;\n children?: ReactNode;\n reaction?: string;\n reactionStyle?: MessageBubbleReactionStyle;\n maxWidth?: number | string;\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nexport interface MessageBubbleStyle {\n opacity: number;\n translateY: number;\n scale: number;\n}\n\nexport interface MessageBubbleReactionStyle {\n opacity: number;\n scale: number;\n}\n\nexport interface MessageBubbleStyleContext {\n background: string;\n color: string;\n align: \"flex-start\" | \"flex-end\";\n reactionSide: \"left\" | \"right\";\n reactionBackground: string;\n reactionColor: string;\n reactionRing: string;\n}\n\nexport function messageBubbleStyleContext(\n variant: MessageBubbleVariant,\n theme: RemocnTheme,\n): MessageBubbleStyleContext {\n const reaction = {\n reactionBackground: theme.muted,\n reactionColor: theme.foreground,\n reactionRing: theme.card,\n };\n if (variant === \"outgoing\") {\n return {\n background: theme.primary,\n color: theme.primaryForeground,\n align: \"flex-end\",\n reactionSide: \"right\",\n ...reaction,\n };\n }\n return {\n background: theme.muted,\n color: theme.foreground,\n align: \"flex-start\",\n reactionSide: \"left\",\n ...reaction,\n };\n}\n\nexport function messageBubbleStyle(state: MessageBubbleState): MessageBubbleStyle {\n switch (state) {\n case \"visible\":\n return { opacity: 1, translateY: 0, scale: 1 };\n default:\n return { opacity: 0, translateY: 12, scale: 0.94 };\n }\n}\n\nexport function messageBubbleReactionStyle(\n state: MessageBubbleState,\n): MessageBubbleReactionStyle {\n return state === \"visible\"\n ? { opacity: 1, scale: 1 }\n : { opacity: 0, scale: 0 };\n}\n\nexport function MessageBubble({\n state = \"hidden\",\n style,\n variant = \"incoming\",\n children,\n reaction,\n reactionStyle,\n maxWidth = \"80%\",\n theme: themeOverride,\n className,\n}: MessageBubbleProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const ctx = messageBubbleStyleContext(variant, theme);\n const v = style ?? messageBubbleStyle(state);\n const reaction_ = reactionStyle ?? messageBubbleReactionStyle(state);\n\n return (\n <div\n className={className}\n style={{\n display: \"flex\",\n justifyContent: ctx.align,\n width: \"100%\",\n opacity: v.opacity,\n transform: `translateY(${v.translateY}px) scale(${v.scale})`,\n transformOrigin: ctx.align === \"flex-end\" ? \"bottom right\" : \"bottom left\",\n }}\n >\n <div style={{ position: \"relative\", maxWidth, minWidth: 0 }}>\n <div\n style={{\n display: \"inline-block\",\n maxWidth: \"100%\",\n padding: \"10px 14px\",\n background: ctx.background,\n color: ctx.color,\n border: \"1px solid transparent\",\n borderRadius: 24,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n fontSize: 14,\n lineHeight: 1.625,\n overflowWrap: \"break-word\",\n wordBreak: \"break-word\",\n }}\n >\n {children}\n </div>\n {reaction !== undefined && (\n <div\n style={{\n position: \"absolute\",\n bottom: 0,\n left: ctx.reactionSide === \"left\" ? 12 : undefined,\n right: ctx.reactionSide === \"right\" ? 12 : undefined,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: 4,\n minWidth: 24,\n padding: \"2px 6px\",\n background: ctx.reactionBackground,\n color: ctx.reactionColor,\n borderRadius: 999,\n fontSize: 14,\n lineHeight: 1,\n boxShadow: `0 0 0 3px ${ctx.reactionRing}`,\n opacity: reaction_.opacity,\n transform: `translateY(75%) scale(${reaction_.scale})`,\n transformOrigin: \"center\",\n }}\n >\n {reaction}\n </div>\n )}\n </div>\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type MessageBubbleState = \"hidden\" | \"visible\";\n\nexport type MessageBubbleVariant = \"incoming\" | \"outgoing\";\n\nexport interface MessageBubbleProps {\n state?: MessageBubbleState;\n style?: MessageBubbleStyle;\n variant?: MessageBubbleVariant;\n children?: ReactNode;\n reaction?: string;\n reactionStyle?: MessageBubbleReactionStyle;\n maxWidth?: number | string;\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nexport interface MessageBubbleStyle {\n opacity: number;\n translateY: number;\n scale: number;\n}\n\nexport interface MessageBubbleReactionStyle {\n opacity: number;\n scale: number;\n}\n\nexport interface MessageBubbleStyleContext {\n background: string;\n color: string;\n align: \"flex-start\" | \"flex-end\";\n reactionSide: \"left\" | \"right\";\n reactionBackground: string;\n reactionColor: string;\n reactionRing: string;\n}\n\nexport function messageBubbleStyleContext(\n variant: MessageBubbleVariant,\n theme: RemocnTheme,\n): MessageBubbleStyleContext {\n const reaction = {\n reactionBackground: theme.muted,\n reactionColor: theme.foreground,\n reactionRing: theme.card,\n };\n if (variant === \"outgoing\") {\n return {\n background: theme.primary,\n color: theme.primaryForeground,\n align: \"flex-end\",\n reactionSide: \"right\",\n ...reaction,\n };\n }\n return {\n background: theme.muted,\n color: theme.foreground,\n align: \"flex-start\",\n reactionSide: \"left\",\n ...reaction,\n };\n}\n\nexport function messageBubbleStyle(\n state: MessageBubbleState,\n): MessageBubbleStyle {\n switch (state) {\n case \"visible\":\n return { opacity: 1, translateY: 0, scale: 1 };\n default:\n return { opacity: 0, translateY: 12, scale: 0.94 };\n }\n}\n\nexport function messageBubbleReactionStyle(\n state: MessageBubbleState,\n): MessageBubbleReactionStyle {\n return state === \"visible\"\n ? { opacity: 1, scale: 1 }\n : { opacity: 0, scale: 0 };\n}\n\nexport function MessageBubble({\n state = \"hidden\",\n style,\n variant = \"incoming\",\n children,\n reaction,\n reactionStyle,\n maxWidth = \"80%\",\n theme: themeOverride,\n className,\n}: MessageBubbleProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const ctx = messageBubbleStyleContext(variant, theme);\n const v = style ?? messageBubbleStyle(state);\n const reaction_ = reactionStyle ?? messageBubbleReactionStyle(state);\n\n return (\n <div\n className={className}\n style={{\n display: \"flex\",\n justifyContent: ctx.align,\n width: \"100%\",\n opacity: v.opacity,\n transform: `translateY(${v.translateY}px) scale(${v.scale})`,\n transformOrigin:\n ctx.align === \"flex-end\" ? \"bottom right\" : \"bottom left\",\n }}\n >\n <div style={{ position: \"relative\", maxWidth, minWidth: 0 }}>\n <div\n style={{\n display: \"inline-block\",\n maxWidth: \"100%\",\n padding: \"10px 14px\",\n background: ctx.background,\n color: ctx.color,\n border: \"1px solid transparent\",\n borderRadius: 24,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n fontSize: 14,\n lineHeight: 1.625,\n overflowWrap: \"break-word\",\n wordBreak: \"break-word\",\n }}\n >\n {children}\n </div>\n {reaction !== undefined && (\n <div\n style={{\n position: \"absolute\",\n bottom: 0,\n left: ctx.reactionSide === \"left\" ? 12 : undefined,\n right: ctx.reactionSide === \"right\" ? 12 : undefined,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: 4,\n minWidth: 24,\n padding: \"2px 6px\",\n background: ctx.reactionBackground,\n color: ctx.reactionColor,\n borderRadius: 999,\n fontSize: 14,\n lineHeight: 1,\n boxShadow: `0 0 0 3px ${ctx.reactionRing}`,\n opacity: reaction_.opacity,\n transform: `translateY(75%) scale(${reaction_.scale})`,\n transformOrigin: \"center\",\n }}\n >\n {reaction}\n </div>\n )}\n </div>\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/message-bubble.tsx"},{"path": "registry/remocn-ui/message-bubble/use-message-bubble-transition.ts",- "content": "\"use client\";\n\nimport { easings, type Step, useStateTransition } from \"@/lib/remocn-ui\";\nimport {\n messageBubbleStyle,\n type MessageBubbleState,\n type MessageBubbleStyle,\n} from \"@/components/remocn/message-bubble\";\n\nexport const DEFAULT_DURATION = 14;\n\nexport function tweenMessageBubbleStyle(\n a: MessageBubbleStyle,\n b: MessageBubbleStyle,\n t: number,\n): MessageBubbleStyle {\n return {\n opacity: a.opacity + (b.opacity - a.opacity) * t,\n translateY: a.translateY + (b.translateY - a.translateY) * t,\n scale: a.scale + (b.scale - a.scale) * t,\n };\n}\n\nexport interface MessageBubbleTransitionOptions {\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useMessageBubbleTransition(\n steps: Step<MessageBubbleState>[],\n opts: MessageBubbleTransitionOptions = {},\n): MessageBubbleStyle {\n const { speed = 1, defaultDuration = DEFAULT_DURATION } = opts;\n const { from, to, progress } = useStateTransition(\n steps,\n \"hidden\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenMessageBubbleStyle(messageBubbleStyle(from), messageBubbleStyle(to), t);\n}\n",+ "content": "\"use client\";\n\nimport {\n type MessageBubbleState,\n type MessageBubbleStyle,\n messageBubbleStyle,\n} from \"@/components/remocn/message-bubble\";\nimport { easings, type Step, useStateTransition } from \"@/lib/remocn-ui\";\n\nexport const DEFAULT_DURATION = 14;\n\nexport function tweenMessageBubbleStyle(\n a: MessageBubbleStyle,\n b: MessageBubbleStyle,\n t: number,\n): MessageBubbleStyle {\n return {\n opacity: a.opacity + (b.opacity - a.opacity) * t,\n translateY: a.translateY + (b.translateY - a.translateY) * t,\n scale: a.scale + (b.scale - a.scale) * t,\n };\n}\n\nexport interface MessageBubbleTransitionOptions {\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useMessageBubbleTransition(\n steps: Step<MessageBubbleState>[],\n opts: MessageBubbleTransitionOptions = {},\n): MessageBubbleStyle {\n const { speed = 1, defaultDuration = DEFAULT_DURATION } = opts;\n const { from, to, progress } = useStateTransition(\n steps,\n \"hidden\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenMessageBubbleStyle(\n messageBubbleStyle(from),\n messageBubbleStyle(to),\n t,\n );\n}\n","type": "registry:component","target": "components/remocn/use-message-bubble-transition.ts"}diff --git a/public/r/number-wheel.json b/public/r/number-wheel.jsonindex 6baaf8a3..f953e84b 100644--- a/public/r/number-wheel.json+++ b/public/r/number-wheel.json@@ -7,7 +7,7 @@"files": [{"path": "registry/remocn/number-wheel/index.tsx",- "content": "\"use client\";\n\nimport type React from \"react\";\nimport { loadFont as loadMono } from \"@remotion/google-fonts/JetBrainsMono\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nconst { fontFamily: MONO_FAMILY } = loadMono();\n\nexport interface NumberWheelProps {\n from?: number;\n to?: number;\n fontSize?: number;\n color?: string;\n speed?: number;\n}\n\nexport interface OdometerProps {\n current: number;\n fontSize: number;\n color: string;\n}\n\nconst WHEEL_ROLL_START = 0.9;\nconst SPRING_FRAMES = 30;\nconst SPRING_CONFIG = { damping: 200, stiffness: 100, mass: 1 } as const;\nconst COUNT_PORTION = 0.8;\n\nfunction rollFraction(current: number, place: number): number {\n const v = current / 10 ** place;\n const frac = v - Math.floor(v);\n if (frac <= WHEEL_ROLL_START) return 0;\n return (frac - WHEEL_ROLL_START) / (1 - WHEEL_ROLL_START);\n}\n\nfunction computeWheel(\n current: number,\n place: number,\n springEased: (t: number) => number,\n): number {\n if (current <= 0) return 0;\n if (place === 0) return current % 10;\n\n const digit = Math.floor(current / 10 ** place) % 10;\n const t = rollFraction(current, place);\n if (t <= 0) return digit;\n return digit + springEased(t);\n}\n\nfunction placeOpacity(current: number, place: number): number {\n if (place === 0) return 1;\n const threshold = 10 ** place;\n return interpolate(current, [threshold * 0.9, threshold], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n}\n\nfunction DigitColumn({\n value,\n fontSize,\n opacity,\n}: {\n value: number;\n fontSize: number;\n opacity: number;\n}) {\n const cellHeight = fontSize * 1.1;\n return (\n <span\n style={{\n display: \"inline-block\",\n overflow: \"hidden\",\n height: cellHeight,\n width: \"0.62em\",\n verticalAlign: \"top\",\n textAlign: \"center\",\n opacity,\n }}\n >\n <span\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n transform: `translateY(${-value * cellHeight}px)`,\n }}\n >\n {[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0].map((d, i) => (\n <span\n key={i}\n style={{ height: cellHeight, lineHeight: `${cellHeight}px` }}\n >\n {d}\n </span>\n ))}\n </span>\n </span>\n );\n}\n\nfunction OdometerColumns({\n current,\n templateValue,\n fontSize,\n color,\n fps,\n}: {\n current: number;\n templateValue: number;\n fontSize: number;\n color: string;\n fps: number;\n}) {\n const springAtEnd = spring({\n frame: SPRING_FRAMES,\n fps,\n config: SPRING_CONFIG,\n });\n const springEased = (t: number) =>\n spring({ frame: t * SPRING_FRAMES, fps, config: SPRING_CONFIG }) /\n springAtEnd;\n\n const template = templateValue.toLocaleString(\"en-US\");\n\n const cells: React.ReactNode[] = [];\n let place = 0;\n for (let i = template.length - 1; i >= 0; i--) {\n const ch = template[i];\n if (ch === \",\") {\n cells.unshift(\n <span\n key={`c${i}`}\n style={{\n display: \"inline-block\",\n width: \"0.32em\",\n color: \"currentColor\",\n fontSize: \"0.85em\",\n textAlign: \"center\",\n opacity: placeOpacity(current, place),\n }}\n >\n ,\n </span>,\n );\n } else {\n const wheel = computeWheel(current, place, springEased);\n cells.unshift(\n <DigitColumn\n key={`d${i}`}\n value={wheel}\n fontSize={fontSize}\n opacity={placeOpacity(current, place)}\n />,\n );\n place++;\n }\n }\n\n return (\n <div\n style={{\n display: \"flex\",\n alignItems: \"baseline\",\n fontSize,\n fontWeight: 800,\n color,\n fontFamily: MONO_FAMILY,\n fontVariantNumeric: \"tabular-nums\",\n letterSpacing: \"-0.03em\",\n lineHeight: 1,\n }}\n >\n {cells}\n </div>\n );\n}\n\nexport function Odometer({ current, fontSize, color }: OdometerProps) {\n const { fps } = useVideoConfig();\n const value = Math.max(0, Math.round(current));\n return (\n <OdometerColumns\n current={current}\n templateValue={value}\n fontSize={fontSize}\n color={color}\n fps={fps}\n />\n );\n}\n\nexport function NumberWheel({\n from = 0,\n to = 24813,\n fontSize = 120,\n color = \"#171717\",\n speed = 1,\n}: NumberWheelProps) {\n const frame = useCurrentFrame();\n const { durationInFrames, fps } = useVideoConfig();\n\n const start = Math.max(0, Math.round(from));\n const end = Math.max(0, Math.round(to));\n\n const progress = interpolate(\n frame * speed,\n [0, durationInFrames * COUNT_PORTION],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.5, 1, 0.5, 1),\n },\n );\n const current = Math.max(0, start + progress * (end - start));\n const maxVal = Math.max(start, end);\n\n return (\n <AbsoluteFill\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <OdometerColumns\n current={current}\n templateValue={maxVal}\n fontSize={fontSize}\n color={color}\n fps={fps}\n />\n </AbsoluteFill>\n );\n}\n",+ "content": "\"use client\";\n\nimport { loadFont as loadMono } from \"@remotion/google-fonts/JetBrainsMono\";\nimport type React from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nconst { fontFamily: MONO_FAMILY } = loadMono();\n\nexport interface NumberWheelProps {\n from?: number;\n to?: number;\n fontSize?: number;\n color?: string;\n speed?: number;\n}\n\nexport interface OdometerProps {\n current: number;\n fontSize: number;\n color: string;\n}\n\nconst WHEEL_ROLL_START = 0.9;\nconst SPRING_FRAMES = 30;\nconst SPRING_CONFIG = { damping: 200, stiffness: 100, mass: 1 } as const;\nconst COUNT_PORTION = 0.8;\n\nfunction rollFraction(current: number, place: number): number {\n const v = current / 10 ** place;\n const frac = v - Math.floor(v);\n if (frac <= WHEEL_ROLL_START) return 0;\n return (frac - WHEEL_ROLL_START) / (1 - WHEEL_ROLL_START);\n}\n\nfunction computeWheel(\n current: number,\n place: number,\n springEased: (t: number) => number,\n): number {\n if (current <= 0) return 0;\n if (place === 0) return current % 10;\n\n const digit = Math.floor(current / 10 ** place) % 10;\n const t = rollFraction(current, place);\n if (t <= 0) return digit;\n return digit + springEased(t);\n}\n\nfunction placeOpacity(current: number, place: number): number {\n if (place === 0) return 1;\n const threshold = 10 ** place;\n return interpolate(current, [threshold * 0.9, threshold], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n}\n\nfunction DigitColumn({\n value,\n fontSize,\n opacity,\n}: {\n value: number;\n fontSize: number;\n opacity: number;\n}) {\n const cellHeight = fontSize * 1.1;\n return (\n <span\n style={{\n display: \"inline-block\",\n overflow: \"hidden\",\n height: cellHeight,\n width: \"0.62em\",\n verticalAlign: \"top\",\n textAlign: \"center\",\n opacity,\n }}\n >\n <span\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n transform: `translateY(${-value * cellHeight}px)`,\n }}\n >\n {[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0].map((d, i) => (\n <span\n key={i}\n style={{ height: cellHeight, lineHeight: `${cellHeight}px` }}\n >\n {d}\n </span>\n ))}\n </span>\n </span>\n );\n}\n\nfunction OdometerColumns({\n current,\n templateValue,\n fontSize,\n color,\n fps,\n}: {\n current: number;\n templateValue: number;\n fontSize: number;\n color: string;\n fps: number;\n}) {\n const springAtEnd = spring({\n frame: SPRING_FRAMES,\n fps,\n config: SPRING_CONFIG,\n });\n const springEased = (t: number) =>\n spring({ frame: t * SPRING_FRAMES, fps, config: SPRING_CONFIG }) /\n springAtEnd;\n\n const template = templateValue.toLocaleString(\"en-US\");\n\n const cells: React.ReactNode[] = [];\n let place = 0;\n for (let i = template.length - 1; i >= 0; i--) {\n const ch = template[i];\n if (ch === \",\") {\n cells.unshift(\n <span\n key={`c${i}`}\n style={{\n display: \"inline-block\",\n width: \"0.32em\",\n color: \"currentColor\",\n fontSize: \"0.85em\",\n textAlign: \"center\",\n opacity: placeOpacity(current, place),\n }}\n >\n ,\n </span>,\n );\n } else {\n const wheel = computeWheel(current, place, springEased);\n cells.unshift(\n <DigitColumn\n key={`d${i}`}\n value={wheel}\n fontSize={fontSize}\n opacity={placeOpacity(current, place)}\n />,\n );\n place++;\n }\n }\n\n return (\n <div\n style={{\n display: \"flex\",\n alignItems: \"baseline\",\n fontSize,\n fontWeight: 800,\n color,\n fontFamily: MONO_FAMILY,\n fontVariantNumeric: \"tabular-nums\",\n letterSpacing: \"-0.03em\",\n lineHeight: 1,\n }}\n >\n {cells}\n </div>\n );\n}\n\nexport function Odometer({ current, fontSize, color }: OdometerProps) {\n const { fps } = useVideoConfig();\n const value = Math.max(0, Math.round(current));\n return (\n <OdometerColumns\n current={current}\n templateValue={value}\n fontSize={fontSize}\n color={color}\n fps={fps}\n />\n );\n}\n\nexport function NumberWheel({\n from = 0,\n to = 24813,\n fontSize = 120,\n color = \"#171717\",\n speed = 1,\n}: NumberWheelProps) {\n const frame = useCurrentFrame();\n const { durationInFrames, fps } = useVideoConfig();\n\n const start = Math.max(0, Math.round(from));\n const end = Math.max(0, Math.round(to));\n\n const progress = interpolate(\n frame * speed,\n [0, durationInFrames * COUNT_PORTION],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.5, 1, 0.5, 1),\n },\n );\n const current = Math.max(0, start + progress * (end - start));\n const maxVal = Math.max(start, end);\n\n return (\n <AbsoluteFill\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <OdometerColumns\n current={current}\n templateValue={maxVal}\n fontSize={fontSize}\n color={color}\n fps={fps}\n />\n </AbsoluteFill>\n );\n}\n","type": "registry:component","target": "components/remocn/number-wheel.tsx"}diff --git a/public/r/onboarding-stepper-flow.json b/public/r/onboarding-stepper-flow.jsonindex c16a10e9..ee5442bf 100644--- a/public/r/onboarding-stepper-flow.json+++ b/public/r/onboarding-stepper-flow.json@@ -15,7 +15,7 @@"files": [{"path": "registry/remocn-ui/onboarding-stepper-flow/index.tsx",- "content": "\"use client\";\n\nimport { Button } from \"@/components/remocn/button\";\nimport { useButtonTransition } from \"@/components/remocn/use-button-transition\";\nimport { Input } from \"@/components/remocn/input\";\nimport { useInputTransition } from \"@/components/remocn/use-input-transition\";\nimport { Radio } from \"@/components/remocn/radio\";\nimport { useRadioTransition } from \"@/components/remocn/use-radio-transition\";\nimport { Stepper } from \"@/components/remocn/stepper\";\nimport { useStepperTransition } from \"@/components/remocn/use-stepper-transition\";\nimport { Switch } from \"@/components/remocn/switch\";\nimport { useSwitchTransition } from \"@/components/remocn/use-switch-transition\";\nimport { clamp01, type RemocnTheme } from \"@/lib/remocn-ui\";\n\nconst DEFAULT_STEPS = [\"Account\", \"Plan\", \"Settings\"];\nconst DEFAULT_PLANS = [\"Free\", \"Pro\", \"Team\"];\n\nconst CONTENT_TOP = 300;\nconst CONTENT_HEIGHT = 220;\nconst NAV_TOP = 540;\n\nexport interface OnboardingStepperFlowProps {\n steps?: string[];\n name?: string;\n plans?: string[];\n nextLabel?: string;\n finishLabel?: string;\n theme?: Partial<RemocnTheme>;\n}\n\nexport function OnboardingStepperFlow({\n steps = DEFAULT_STEPS,\n name = \"[email protected]\",\n plans = DEFAULT_PLANS,\n nextLabel = \"Next\",\n finishLabel = \"Finish\",\n theme,\n}: OnboardingStepperFlowProps) {\n const opts = { theme };\n\n const stepperStyle = useStepperTransition([\n { at: 0, index: 0 },\n { at: 64, index: 1, duration: 20 },\n { at: 104, index: 2, duration: 20 },\n ]);\n\n const nameStyle = useInputTransition(\n [\n { at: 2, state: \"active\", duration: 8 },\n { at: 10, state: \"typing\", duration: 45 },\n ],\n opts,\n );\n\n const planStyle = useRadioTransition(\n [{ at: 90, state: \"checked\", duration: 14 }],\n opts,\n );\n\n const settingsStyle = useSwitchTransition(\n [{ at: 130, state: \"checked\", duration: 14 }],\n opts,\n );\n\n const navStyle = useButtonTransition(\n [\n { at: 60, state: \"press\", duration: 6 },\n { at: 64, state: \"idle\", duration: 6 },\n { at: 100, state: \"press\", duration: 6 },\n { at: 104, state: \"idle\", duration: 6 },\n { at: 150, state: \"press\", duration: 6 },\n { at: 156, state: \"success\", duration: 14 },\n ],\n opts,\n );\n\n const position = stepperStyle.position;\n const panelOpacity = (i: number) => clamp01(1 - Math.abs(position - i));\n\n const navLabel = position >= steps.length - 1 ? finishLabel : nextLabel;\n\n return (\n <div style={{ position: \"relative\", width: \"100%\", height: \"100%\" }}>\n {}\n <div\n style={{ position: \"absolute\", left: 0, right: 0, top: 96, height: 100 }}\n >\n <Stepper style={stepperStyle} steps={steps} theme={theme} />\n </div>\n\n {}\n <div\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n top: CONTENT_TOP,\n height: CONTENT_HEIGHT,\n }}\n >\n {}\n <div style={{ position: \"absolute\", inset: 0, opacity: panelOpacity(0) }}>\n <Input\n style={nameStyle}\n placeholder={name}\n value={name}\n theme={theme}\n />\n </div>\n\n {}\n <div style={{ position: \"absolute\", inset: 0, opacity: panelOpacity(1) }}>\n <Radio\n style={planStyle}\n label={plans[1] ?? \"Pro\"}\n theme={theme}\n />\n </div>\n\n {}\n <div style={{ position: \"absolute\", inset: 0, opacity: panelOpacity(2) }}>\n <Switch\n style={settingsStyle}\n label=\"Email notifications\"\n theme={theme}\n />\n </div>\n </div>\n\n {}\n <div\n style={{ position: \"absolute\", left: 0, right: 0, top: NAV_TOP, height: 64 }}\n >\n <Button label={navLabel} style={navStyle} theme={theme} />\n </div>\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport { Button } from \"@/components/remocn/button\";\nimport { Input } from \"@/components/remocn/input\";\nimport { Radio } from \"@/components/remocn/radio\";\nimport { Stepper } from \"@/components/remocn/stepper\";\nimport { Switch } from \"@/components/remocn/switch\";\nimport { useButtonTransition } from \"@/components/remocn/use-button-transition\";\nimport { useInputTransition } from \"@/components/remocn/use-input-transition\";\nimport { useRadioTransition } from \"@/components/remocn/use-radio-transition\";\nimport { useStepperTransition } from \"@/components/remocn/use-stepper-transition\";\nimport { useSwitchTransition } from \"@/components/remocn/use-switch-transition\";\nimport { clamp01, type RemocnTheme } from \"@/lib/remocn-ui\";\n\nconst DEFAULT_STEPS = [\"Account\", \"Plan\", \"Settings\"];\nconst DEFAULT_PLANS = [\"Free\", \"Pro\", \"Team\"];\n\nconst CONTENT_TOP = 300;\nconst CONTENT_HEIGHT = 220;\nconst NAV_TOP = 540;\n\nexport interface OnboardingStepperFlowProps {\n steps?: string[];\n name?: string;\n plans?: string[];\n nextLabel?: string;\n finishLabel?: string;\n theme?: Partial<RemocnTheme>;\n}\n\nexport function OnboardingStepperFlow({\n steps = DEFAULT_STEPS,\n name = \"[email protected]\",\n plans = DEFAULT_PLANS,\n nextLabel = \"Next\",\n finishLabel = \"Finish\",\n theme,\n}: OnboardingStepperFlowProps) {\n const opts = { theme };\n\n const stepperStyle = useStepperTransition([\n { at: 0, index: 0 },\n { at: 64, index: 1, duration: 20 },\n { at: 104, index: 2, duration: 20 },\n ]);\n\n const nameStyle = useInputTransition(\n [\n { at: 2, state: \"active\", duration: 8 },\n { at: 10, state: \"typing\", duration: 45 },\n ],\n opts,\n );\n\n const planStyle = useRadioTransition(\n [{ at: 90, state: \"checked\", duration: 14 }],\n opts,\n );\n\n const settingsStyle = useSwitchTransition(\n [{ at: 130, state: \"checked\", duration: 14 }],\n opts,\n );\n\n const navStyle = useButtonTransition(\n [\n { at: 60, state: \"press\", duration: 6 },\n { at: 64, state: \"idle\", duration: 6 },\n { at: 100, state: \"press\", duration: 6 },\n { at: 104, state: \"idle\", duration: 6 },\n { at: 150, state: \"press\", duration: 6 },\n { at: 156, state: \"success\", duration: 14 },\n ],\n opts,\n );\n\n const position = stepperStyle.position;\n const panelOpacity = (i: number) => clamp01(1 - Math.abs(position - i));\n\n const navLabel = position >= steps.length - 1 ? finishLabel : nextLabel;\n\n return (\n <div style={{ position: \"relative\", width: \"100%\", height: \"100%\" }}>\n {}\n <div\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n top: 96,\n height: 100,\n }}\n >\n <Stepper style={stepperStyle} steps={steps} theme={theme} />\n </div>\n\n {}\n <div\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n top: CONTENT_TOP,\n height: CONTENT_HEIGHT,\n }}\n >\n {}\n <div\n style={{ position: \"absolute\", inset: 0, opacity: panelOpacity(0) }}\n >\n <Input\n style={nameStyle}\n placeholder={name}\n value={name}\n theme={theme}\n />\n </div>\n\n {}\n <div\n style={{ position: \"absolute\", inset: 0, opacity: panelOpacity(1) }}\n >\n <Radio style={planStyle} label={plans[1] ?? \"Pro\"} theme={theme} />\n </div>\n\n {}\n <div\n style={{ position: \"absolute\", inset: 0, opacity: panelOpacity(2) }}\n >\n <Switch\n style={settingsStyle}\n label=\"Email notifications\"\n theme={theme}\n />\n </div>\n </div>\n\n {}\n <div\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n top: NAV_TOP,\n height: 64,\n }}\n >\n <Button label={navLabel} style={navStyle} theme={theme} />\n </div>\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/onboarding-stepper-flow.tsx"}diff --git a/public/r/opencode.json b/public/r/opencode.jsonindex 27a1d3ac..ebf68a44 100644--- a/public/r/opencode.json+++ b/public/r/opencode.json@@ -8,7 +8,7 @@"files": [{"path": "registry/remocn/opencode/index.tsx",- "content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/JetBrainsMono\";\nimport {\n AbsoluteFill,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Caret } from \"@/components/remocn/caret\";\nimport { useTypewriter } from \"@/lib/remocn-ui\";\n\nconst { fontFamily: MONO_FAMILY } = loadFont();\n\nexport interface OpenCodeProps {\n placeholder?: string;\n query?: string;\n agentName?: string;\n modelName?: string;\n provider?: string;\n accentColor?: string;\n speed?: number;\n}\n\ninterface Theme {\n page: string;\n boxBg: string;\n fg: string;\n fgMuted: string;\n fgQuery: string;\n logoOpen: string;\n logoCode: string;\n}\n\nexport const THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n page: \"#FFFFFF\",\n boxBg: \"#F2F2F2\",\n fg: \"#111111\",\n fgMuted: \"#888888\",\n fgQuery: \"#555555\",\n logoOpen: \"#999999\",\n logoCode: \"#111111\",\n },\n dark: {\n page: \"#000000\",\n boxBg: \"#161616\",\n fg: \"#EDEDED\",\n fgMuted: \"#6B6B6B\",\n fgQuery: \"#9A9A9A\",\n logoOpen: \"#6B6B6B\",\n logoCode: \"#EDEDED\",\n },\n};\n\nexport const TYPING_START_FRAME = 48;\n\nexport const TYPING_CPS = 20;\n\nfunction introBounceIn(\n frame: number,\n fps: number,\n): { translateY: number; scale: number } {\n const s = spring({\n fps,\n frame,\n config: { damping: 14, stiffness: 110, mass: 0.7 },\n });\n const translateY = interpolate(s, [0, 1], [28, 0]);\n const scale = interpolate(s, [0, 1], [0.97, 1]);\n return { translateY, scale };\n}\n\nfunction fadeUpAt(\n frame: number,\n range: [number, number],\n): { opacity: number; translateY: number } {\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n return {\n opacity: interpolate(frame, range, [0, 1], opts),\n translateY: interpolate(frame, range, [12, 0], opts),\n };\n}\n\nexport function OpenCode({\n placeholder = \"Ask anything... \",\n query = '\"What is the tech stack of this project?\"',\n agentName = \"Build\",\n modelName = \"Kimi K2.5\",\n provider = \"Moonshot AI\",\n accentColor = \"#2B7FFF\",\n speed = 1,\n}: OpenCodeProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = THEMES.dark;\n\n const refW = 1280;\n const refH = 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const tw = useTypewriter(query, {\n cps: TYPING_CPS,\n speed,\n startFrame: TYPING_START_FRAME,\n });\n\n const intro = introBounceIn(frame * speed, fps);\n const logoFade = fadeUpAt(frame * speed, [4, 22]);\n const boxFade = fadeUpAt(frame * speed, [12, 30]);\n const hintsFade = fadeUpAt(frame * speed, [20, 38]);\n\n\n const boxWidth = 1000;\n\n return (\n <AbsoluteFill style={{ background: \"transparent\" }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n transform: `translate(-50%, -50%) scale(${stageScale})`,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n lineHeight: 0,\n opacity: logoFade.opacity,\n transform: `translateY(${logoFade.translateY + intro.translateY * 0.4}px)`,\n }}\n >\n <svg\n width={468}\n height={84}\n viewBox=\"0 0 234 42\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <title>opencode</title>\n <clipPath id=\"opencode-wordmark-clip\">\n <rect width={234} height={42} fill=\"#ffffff\" />\n </clipPath>\n <g clipPath=\"url(#opencode-wordmark-clip)\">\n <path d=\"M18 30H6V18H18V30Z\" fill=\"#4B4646\" />\n <path d=\"M18 12H6V30H18V12ZM24 36H0V6H24V36Z\" fill=\"#B7B1B1\" />\n <path d=\"M48 30H36V18H48V30Z\" fill=\"#4B4646\" />\n <path\n d=\"M36 30H48V12H36V30ZM54 36H36V42H30V6H54V36Z\"\n fill=\"#B7B1B1\"\n />\n <path d=\"M84 24V30H66V24H84Z\" fill=\"#4B4646\" />\n <path\n d=\"M84 24H66V30H84V36H60V6H84V24ZM66 18H78V12H66V18Z\"\n fill=\"#B7B1B1\"\n />\n <path d=\"M108 36H96V18H108V36Z\" fill=\"#4B4646\" />\n <path\n d=\"M108 12H96V36H90V6H108V12ZM114 36H108V12H114V36Z\"\n fill=\"#B7B1B1\"\n />\n <path d=\"M144 30H126V18H144V30Z\" fill=\"#4B4646\" />\n <path\n d=\"M144 12H126V30H144V36H120V6H144V12Z\"\n fill=\"#F1ECEC\"\n />\n <path d=\"M168 30H156V18H168V30Z\" fill=\"#4B4646\" />\n <path\n d=\"M168 12H156V30H168V12ZM174 36H150V6H174V36Z\"\n fill=\"#F1ECEC\"\n />\n <path d=\"M198 30H186V18H198V30Z\" fill=\"#4B4646\" />\n <path\n d=\"M198 12H186V30H198V12ZM204 36H180V6H198V0H204V36Z\"\n fill=\"#F1ECEC\"\n />\n <path d=\"M234 24V30H216V24H234Z\" fill=\"#4B4646\" />\n <path\n d=\"M216 12V18H228V12H216ZM234 24H216V30H234V36H210V6H234V24Z\"\n fill=\"#F1ECEC\"\n />\n </g>\n </svg>\n </div>\n\n <div\n style={{\n width: boxWidth,\n marginTop: 40,\n minHeight: 150,\n background: t.boxBg,\n borderLeft: `4px solid ${accentColor}`,\n padding: \"26px 28px\",\n boxSizing: \"border-box\",\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"center\",\n gap: 26,\n opacity: boxFade.opacity,\n transform: `translateY(${boxFade.translateY + intro.translateY * 0.6}px) scale(${intro.scale})`,\n transformOrigin: \"center top\",\n }}\n >\n <div\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n fontFamily: MONO_FAMILY,\n fontSize: 22,\n }}\n >\n <span style={{ color: t.fgMuted }}>{placeholder}</span>\n {tw.count > 0 ? (\n <span style={{ color: t.fgQuery }}>{tw.text}</span>\n ) : null}\n <span style={{ opacity: 0.6, display: \"inline-flex\" }}>\n <Caret\n width={12}\n height={24}\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n marginLeft={2}\n />\n </span>\n </div>\n\n <div\n style={{\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n gap: 16,\n fontFamily: MONO_FAMILY,\n fontSize: 20,\n }}\n >\n <span style={{ color: accentColor, fontWeight: 600 }}>\n {agentName}\n </span>\n <span style={{ color: t.fg }}>{modelName}</span>\n <span style={{ color: t.fgMuted }}>{provider}</span>\n </div>\n </div>\n\n <div\n style={{\n width: boxWidth,\n marginTop: 18,\n display: \"flex\",\n justifyContent: \"flex-end\",\n gap: 22,\n fontFamily: MONO_FAMILY,\n fontSize: 18,\n opacity: hintsFade.opacity,\n transform: `translateY(${hintsFade.translateY}px)`,\n }}\n >\n <span style={{ display: \"inline-flex\", gap: 8 }}>\n <span style={{ color: t.fg, fontWeight: 700 }}>tab</span>\n <span style={{ color: t.fgMuted }}>agents</span>\n </span>\n <span style={{ display: \"inline-flex\", gap: 8 }}>\n <span style={{ color: t.fg, fontWeight: 700 }}>ctrl+p</span>\n <span style={{ color: t.fgMuted }}>commands</span>\n </span>\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n",+ "content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/JetBrainsMono\";\nimport {\n AbsoluteFill,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Caret } from \"@/components/remocn/caret\";\nimport { useTypewriter } from \"@/lib/remocn-ui\";\n\nconst { fontFamily: MONO_FAMILY } = loadFont();\n\nexport interface OpenCodeProps {\n placeholder?: string;\n query?: string;\n agentName?: string;\n modelName?: string;\n provider?: string;\n accentColor?: string;\n speed?: number;\n}\n\ninterface Theme {\n page: string;\n boxBg: string;\n fg: string;\n fgMuted: string;\n fgQuery: string;\n logoOpen: string;\n logoCode: string;\n}\n\nexport const THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n page: \"#FFFFFF\",\n boxBg: \"#F2F2F2\",\n fg: \"#111111\",\n fgMuted: \"#888888\",\n fgQuery: \"#555555\",\n logoOpen: \"#999999\",\n logoCode: \"#111111\",\n },\n dark: {\n page: \"#000000\",\n boxBg: \"#161616\",\n fg: \"#EDEDED\",\n fgMuted: \"#6B6B6B\",\n fgQuery: \"#9A9A9A\",\n logoOpen: \"#6B6B6B\",\n logoCode: \"#EDEDED\",\n },\n};\n\nexport const TYPING_START_FRAME = 48;\n\nexport const TYPING_CPS = 20;\n\nfunction introBounceIn(\n frame: number,\n fps: number,\n): { translateY: number; scale: number } {\n const s = spring({\n fps,\n frame,\n config: { damping: 14, stiffness: 110, mass: 0.7 },\n });\n const translateY = interpolate(s, [0, 1], [28, 0]);\n const scale = interpolate(s, [0, 1], [0.97, 1]);\n return { translateY, scale };\n}\n\nfunction fadeUpAt(\n frame: number,\n range: [number, number],\n): { opacity: number; translateY: number } {\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n return {\n opacity: interpolate(frame, range, [0, 1], opts),\n translateY: interpolate(frame, range, [12, 0], opts),\n };\n}\n\nexport function OpenCode({\n placeholder = \"Ask anything... \",\n query = '\"What is the tech stack of this project?\"',\n agentName = \"Build\",\n modelName = \"Kimi K2.5\",\n provider = \"Moonshot AI\",\n accentColor = \"#2B7FFF\",\n speed = 1,\n}: OpenCodeProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = THEMES.dark;\n\n const refW = 1280;\n const refH = 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const tw = useTypewriter(query, {\n cps: TYPING_CPS,\n speed,\n startFrame: TYPING_START_FRAME,\n });\n\n const intro = introBounceIn(frame * speed, fps);\n const logoFade = fadeUpAt(frame * speed, [4, 22]);\n const boxFade = fadeUpAt(frame * speed, [12, 30]);\n const hintsFade = fadeUpAt(frame * speed, [20, 38]);\n\n const boxWidth = 1000;\n\n return (\n <AbsoluteFill style={{ background: \"transparent\" }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n transform: `translate(-50%, -50%) scale(${stageScale})`,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n lineHeight: 0,\n opacity: logoFade.opacity,\n transform: `translateY(${logoFade.translateY + intro.translateY * 0.4}px)`,\n }}\n >\n <svg\n width={468}\n height={84}\n viewBox=\"0 0 234 42\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <title>opencode</title>\n <clipPath id=\"opencode-wordmark-clip\">\n <rect width={234} height={42} fill=\"#ffffff\" />\n </clipPath>\n <g clipPath=\"url(#opencode-wordmark-clip)\">\n <path d=\"M18 30H6V18H18V30Z\" fill=\"#4B4646\" />\n <path d=\"M18 12H6V30H18V12ZM24 36H0V6H24V36Z\" fill=\"#B7B1B1\" />\n <path d=\"M48 30H36V18H48V30Z\" fill=\"#4B4646\" />\n <path\n d=\"M36 30H48V12H36V30ZM54 36H36V42H30V6H54V36Z\"\n fill=\"#B7B1B1\"\n />\n <path d=\"M84 24V30H66V24H84Z\" fill=\"#4B4646\" />\n <path\n d=\"M84 24H66V30H84V36H60V6H84V24ZM66 18H78V12H66V18Z\"\n fill=\"#B7B1B1\"\n />\n <path d=\"M108 36H96V18H108V36Z\" fill=\"#4B4646\" />\n <path\n d=\"M108 12H96V36H90V6H108V12ZM114 36H108V12H114V36Z\"\n fill=\"#B7B1B1\"\n />\n <path d=\"M144 30H126V18H144V30Z\" fill=\"#4B4646\" />\n <path d=\"M144 12H126V30H144V36H120V6H144V12Z\" fill=\"#F1ECEC\" />\n <path d=\"M168 30H156V18H168V30Z\" fill=\"#4B4646\" />\n <path\n d=\"M168 12H156V30H168V12ZM174 36H150V6H174V36Z\"\n fill=\"#F1ECEC\"\n />\n <path d=\"M198 30H186V18H198V30Z\" fill=\"#4B4646\" />\n <path\n d=\"M198 12H186V30H198V12ZM204 36H180V6H198V0H204V36Z\"\n fill=\"#F1ECEC\"\n />\n <path d=\"M234 24V30H216V24H234Z\" fill=\"#4B4646\" />\n <path\n d=\"M216 12V18H228V12H216ZM234 24H216V30H234V36H210V6H234V24Z\"\n fill=\"#F1ECEC\"\n />\n </g>\n </svg>\n </div>\n\n <div\n style={{\n width: boxWidth,\n marginTop: 40,\n minHeight: 150,\n background: t.boxBg,\n borderLeft: `4px solid ${accentColor}`,\n padding: \"26px 28px\",\n boxSizing: \"border-box\",\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"center\",\n gap: 26,\n opacity: boxFade.opacity,\n transform: `translateY(${boxFade.translateY + intro.translateY * 0.6}px) scale(${intro.scale})`,\n transformOrigin: \"center top\",\n }}\n >\n <div\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n fontFamily: MONO_FAMILY,\n fontSize: 22,\n }}\n >\n <span style={{ color: t.fgMuted }}>{placeholder}</span>\n {tw.count > 0 ? (\n <span style={{ color: t.fgQuery }}>{tw.text}</span>\n ) : null}\n <span style={{ opacity: 0.6, display: \"inline-flex\" }}>\n <Caret\n width={12}\n height={24}\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n marginLeft={2}\n />\n </span>\n </div>\n\n <div\n style={{\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n gap: 16,\n fontFamily: MONO_FAMILY,\n fontSize: 20,\n }}\n >\n <span style={{ color: accentColor, fontWeight: 600 }}>\n {agentName}\n </span>\n <span style={{ color: t.fg }}>{modelName}</span>\n <span style={{ color: t.fgMuted }}>{provider}</span>\n </div>\n </div>\n\n <div\n style={{\n width: boxWidth,\n marginTop: 18,\n display: \"flex\",\n justifyContent: \"flex-end\",\n gap: 22,\n fontFamily: MONO_FAMILY,\n fontSize: 18,\n opacity: hintsFade.opacity,\n transform: `translateY(${hintsFade.translateY}px)`,\n }}\n >\n <span style={{ display: \"inline-flex\", gap: 8 }}>\n <span style={{ color: t.fg, fontWeight: 700 }}>tab</span>\n <span style={{ color: t.fgMuted }}>agents</span>\n </span>\n <span style={{ display: \"inline-flex\", gap: 8 }}>\n <span style={{ color: t.fg, fontWeight: 700 }}>ctrl+p</span>\n <span style={{ color: t.fgMuted }}>commands</span>\n </span>\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n","type": "registry:component","target": "components/remocn/opencode.tsx"}diff --git a/public/r/per-character-rise.json b/public/r/per-character-rise.jsonindex f8e23557..d3623d25 100644--- a/public/r/per-character-rise.json+++ b/public/r/per-character-rise.json@@ -7,7 +7,7 @@"files": [{"path": "registry/remocn/per-character-rise/index.tsx",- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface PerCharacterRiseProps {\n text: string;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function PerCharacterRise({\n text,\n distance = 32,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: PerCharacterRiseProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 21;\n const staggerFrames = 1;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerFrames;\n const easing = Easing.bezier(0.2, 0.8, 0.2, 1);\n const opacity = interpolate(\n local,\n [0, charDurationFrames],\n [0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\", easing },\n );\n const y = interpolate(\n local,\n [0, charDurationFrames],\n [distance, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\", easing },\n );\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface PerCharacterRiseProps {\n text: string;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function PerCharacterRise({\n text,\n distance = 32,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: PerCharacterRiseProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 21;\n const staggerFrames = 1;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerFrames;\n const easing = Easing.bezier(0.2, 0.8, 0.2, 1);\n const opacity = interpolate(local, [0, charDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const y = interpolate(local, [0, charDurationFrames], [distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/per-character-rise.tsx"}diff --git a/public/r/perlin-dissolve.json b/public/r/perlin-dissolve.jsonindex 3c7bf585..ec8d39e1 100644--- a/public/r/perlin-dissolve.json+++ b/public/r/perlin-dissolve.json@@ -8,7 +8,7 @@"files": [{"path": "registry/remocn/perlin-dissolve/index.tsx",- "content": "\"use client\";\n\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport { ShaderPerlinNoise } from \"@/components/remocn/shader-perlin-noise\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nexport type PerlinDissolveProps = {\n colorBack?: string;\n colorFront?: string;\n softness?: number;\n speed?: number;\n};\n\nconst PerlinDissolvePresentation: React.FC<\n TransitionPresentationComponentProps<PerlinDissolveProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n colorBack = \"#141318\",\n colorFront = \"#8f88ae\",\n softness = 0.1,\n speed = 1,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n const proportion = interpolate(p, [0, 0.5], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n\n const childStyle: React.CSSProperties = entering\n ? { opacity: interpolate(p, [0.48, 0.6], [0, 1], clampOpts) }\n : { opacity: interpolate(p, [0.06, 0.13], [1, 0], clampOpts) };\n\n return (\n <AbsoluteFill>\n {entering ? (\n <AbsoluteFill style={{ pointerEvents: \"none\" }}>\n <ShaderPerlinNoise\n speed={speed}\n proportion={proportion}\n colorBack={colorBack}\n colorFront={colorFront}\n softness={softness}\n />\n </AbsoluteFill>\n ) : null}\n <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>\n </AbsoluteFill>\n );\n};\n\nexport function perlinDissolve(\n props: PerlinDissolveProps = {},\n): TransitionPresentation<PerlinDissolveProps> {\n return {\n component: PerlinDissolvePresentation,\n props,\n };\n}\n",+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport { ShaderPerlinNoise } from \"@/components/remocn/shader-perlin-noise\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nexport type PerlinDissolveProps = {\n colorBack?: string;\n colorFront?: string;\n softness?: number;\n speed?: number;\n};\n\nconst PerlinDissolvePresentation: React.FC<\n TransitionPresentationComponentProps<PerlinDissolveProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n colorBack = \"#141318\",\n colorFront = \"#8f88ae\",\n softness = 0.1,\n speed = 1,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n const proportion = interpolate(p, [0, 0.5], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n\n const childStyle: React.CSSProperties = entering\n ? { opacity: interpolate(p, [0.48, 0.6], [0, 1], clampOpts) }\n : { opacity: interpolate(p, [0.06, 0.13], [1, 0], clampOpts) };\n\n return (\n <AbsoluteFill>\n {entering ? (\n <AbsoluteFill style={{ pointerEvents: \"none\" }}>\n <ShaderPerlinNoise\n speed={speed}\n proportion={proportion}\n colorBack={colorBack}\n colorFront={colorFront}\n softness={softness}\n />\n </AbsoluteFill>\n ) : null}\n <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>\n </AbsoluteFill>\n );\n};\n\nexport function perlinDissolve(\n props: PerlinDissolveProps = {},\n): TransitionPresentation<PerlinDissolveProps> {\n return {\n component: PerlinDissolvePresentation,\n props,\n };\n}\n","type": "registry:component","target": "components/remocn/perlin-dissolve.tsx"}diff --git a/public/r/popover.json b/public/r/popover.jsonindex 8d787735..721a8462 100644--- a/public/r/popover.json+++ b/public/r/popover.json@@ -8,13 +8,13 @@"files": [{"path": "registry/remocn-ui/popover/index.tsx",- "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type PopoverState = \"opened\" | \"closed\";\n\nexport type PopoverSide = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nexport interface PopoverProps {\n state?: PopoverState;\n style?: PopoverStyle;\n title?: string;\n description?: string;\n children?: ReactNode;\n side?: PopoverSide;\n width?: number;\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nexport interface PopoverStyle {\n opacity: number;\n scale: number;\n translate: number;\n}\n\nexport function popoverStyle(state: PopoverState): PopoverStyle {\n switch (state) {\n case \"opened\":\n return { opacity: 1, scale: 1, translate: 0 };\n default:\n return { opacity: 0, scale: 0.97, translate: 6 };\n }\n}\n\nfunction offsetFor(side: PopoverSide, translate: number): { x: number; y: number } {\n switch (side) {\n case \"bottom\":\n return { x: 0, y: -translate };\n case \"left\":\n return { x: translate, y: 0 };\n case \"right\":\n return { x: -translate, y: 0 };\n default:\n return { x: 0, y: translate };\n }\n}\n\nexport function Popover({\n state = \"closed\",\n style,\n title,\n description,\n children,\n side = \"bottom\",\n width = 288,\n theme: themeOverride,\n className,\n}: PopoverProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const v = style ?? popoverStyle(state);\n const { x, y } = offsetFor(side, v.translate);\n\n const hasHeader = title !== undefined || description !== undefined;\n\n return (\n <div\n className={className}\n style={{\n display: \"inline-flex\",\n opacity: v.opacity,\n transform: `translate(${x}px, ${y}px) scale(${v.scale})`,\n transformOrigin: \"center\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div\n style={{\n width,\n boxSizing: \"border-box\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n padding: 16,\n background: theme.popover,\n color: theme.popoverForeground,\n border: `1px solid ${theme.border}`,\n borderRadius: theme.radius,\n boxShadow: \"0 8px 24px -8px rgba(0,0,0,0.2)\",\n textAlign: \"left\",\n }}\n >\n {title !== undefined && (\n <div\n style={{\n fontSize: 15,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n lineHeight: 1.3,\n }}\n >\n {title}\n </div>\n )}\n {description !== undefined && (\n <div\n style={{\n fontSize: 13,\n lineHeight: 1.5,\n color: theme.mutedForeground,\n }}\n >\n {description}\n </div>\n )}\n {}\n {children !== undefined && (\n <div style={{ marginTop: hasHeader ? 4 : 0 }}>{children}</div>\n )}\n </div>\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type PopoverState = \"opened\" | \"closed\";\n\nexport type PopoverSide = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nexport interface PopoverProps {\n state?: PopoverState;\n style?: PopoverStyle;\n title?: string;\n description?: string;\n children?: ReactNode;\n side?: PopoverSide;\n width?: number;\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nexport interface PopoverStyle {\n opacity: number;\n scale: number;\n translate: number;\n}\n\nexport function popoverStyle(state: PopoverState): PopoverStyle {\n switch (state) {\n case \"opened\":\n return { opacity: 1, scale: 1, translate: 0 };\n default:\n return { opacity: 0, scale: 0.97, translate: 6 };\n }\n}\n\nfunction offsetFor(\n side: PopoverSide,\n translate: number,\n): { x: number; y: number } {\n switch (side) {\n case \"bottom\":\n return { x: 0, y: -translate };\n case \"left\":\n return { x: translate, y: 0 };\n case \"right\":\n return { x: -translate, y: 0 };\n default:\n return { x: 0, y: translate };\n }\n}\n\nexport function Popover({\n state = \"closed\",\n style,\n title,\n description,\n children,\n side = \"bottom\",\n width = 288,\n theme: themeOverride,\n className,\n}: PopoverProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const v = style ?? popoverStyle(state);\n const { x, y } = offsetFor(side, v.translate);\n\n const hasHeader = title !== undefined || description !== undefined;\n\n return (\n <div\n className={className}\n style={{\n display: \"inline-flex\",\n opacity: v.opacity,\n transform: `translate(${x}px, ${y}px) scale(${v.scale})`,\n transformOrigin: \"center\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div\n style={{\n width,\n boxSizing: \"border-box\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n padding: 16,\n background: theme.popover,\n color: theme.popoverForeground,\n border: `1px solid ${theme.border}`,\n borderRadius: theme.radius,\n boxShadow: \"0 8px 24px -8px rgba(0,0,0,0.2)\",\n textAlign: \"left\",\n }}\n >\n {title !== undefined && (\n <div\n style={{\n fontSize: 15,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n lineHeight: 1.3,\n }}\n >\n {title}\n </div>\n )}\n {description !== undefined && (\n <div\n style={{\n fontSize: 13,\n lineHeight: 1.5,\n color: theme.mutedForeground,\n }}\n >\n {description}\n </div>\n )}\n {}\n {children !== undefined && (\n <div style={{ marginTop: hasHeader ? 4 : 0 }}>{children}</div>\n )}\n </div>\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/popover.tsx"},{"path": "registry/remocn-ui/popover/use-popover-transition.ts",- "content": "\"use client\";\n\nimport { easings, type Step, useStateTransition } from \"@/lib/remocn-ui\";\nimport {\n popoverStyle,\n type PopoverState,\n type PopoverStyle,\n} from \"@/components/remocn/popover\";\n\nexport const DEFAULT_DURATION = 10;\n\nexport function tweenPopoverStyle(\n a: PopoverStyle,\n b: PopoverStyle,\n t: number,\n): PopoverStyle {\n return {\n opacity: a.opacity + (b.opacity - a.opacity) * t,\n scale: a.scale + (b.scale - a.scale) * t,\n translate: a.translate + (b.translate - a.translate) * t,\n };\n}\n\nexport interface PopoverTransitionOptions {\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function usePopoverTransition(\n steps: Step<PopoverState>[],\n opts: PopoverTransitionOptions = {},\n): PopoverStyle {\n const { speed = 1, defaultDuration = DEFAULT_DURATION } = opts;\n const { from, to, progress } = useStateTransition(\n steps,\n \"closed\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenPopoverStyle(popoverStyle(from), popoverStyle(to), t);\n}\n",+ "content": "\"use client\";\n\nimport {\n type PopoverState,\n type PopoverStyle,\n popoverStyle,\n} from \"@/components/remocn/popover\";\nimport { easings, type Step, useStateTransition } from \"@/lib/remocn-ui\";\n\nexport const DEFAULT_DURATION = 10;\n\nexport function tweenPopoverStyle(\n a: PopoverStyle,\n b: PopoverStyle,\n t: number,\n): PopoverStyle {\n return {\n opacity: a.opacity + (b.opacity - a.opacity) * t,\n scale: a.scale + (b.scale - a.scale) * t,\n translate: a.translate + (b.translate - a.translate) * t,\n };\n}\n\nexport interface PopoverTransitionOptions {\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function usePopoverTransition(\n steps: Step<PopoverState>[],\n opts: PopoverTransitionOptions = {},\n): PopoverStyle {\n const { speed = 1, defaultDuration = DEFAULT_DURATION } = opts;\n const { from, to, progress } = useStateTransition(\n steps,\n \"closed\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenPopoverStyle(popoverStyle(from), popoverStyle(to), t);\n}\n","type": "registry:component","target": "components/remocn/use-popover-transition.ts"}diff --git a/public/r/progress.json b/public/r/progress.jsonindex 055be794..c7a987cd 100644--- a/public/r/progress.json+++ b/public/r/progress.json@@ -14,7 +14,7 @@},{"path": "registry/remocn-ui/progress/use-progress-transition.ts",- "content": "\"use client\";\n\nimport { useCurrentFrame } from \"remotion\";\nimport { clamp01, type EasingName, easings } from \"@/lib/remocn-ui\";\nimport type { ProgressStyle } from \"@/components/remocn/progress\";\n\nexport interface ProgressStep {\n at: number;\n value: number;\n duration?: number;\n easing?: EasingName;\n}\n\nexport const DEFAULT_DURATION = 24;\n\nexport interface ProgressTransitionOptions {\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function tweenProgressStyle(\n a: ProgressStyle,\n b: ProgressStyle,\n t: number,\n): ProgressStyle {\n return { value: a.value + (b.value - a.value) * t };\n}\n\nexport function useProgressTransition(\n steps: ProgressStep[],\n opts: ProgressTransitionOptions = {},\n): ProgressStyle {\n const { speed = 1 } = opts;\n const raw = useCurrentFrame() * speed;\n return progressValueAt(steps, raw, opts);\n}\n\nexport function progressValueAt(\n steps: ProgressStep[],\n raw: number,\n opts: ProgressTransitionOptions = {},\n): ProgressStyle {\n const { defaultDuration = DEFAULT_DURATION } = opts;\n\n if (steps.length === 0) return { value: 0 };\n\n const first = steps[0];\n\n if (raw <= first.at) return { value: first.value };\n\n let toIndex = steps.length - 1;\n for (let i = 1; i < steps.length; i++) {\n if (steps[i].at > raw) {\n toIndex = i;\n break;\n }\n }\n const pastLast = raw >= steps[steps.length - 1].at;\n const to = pastLast ? steps[steps.length - 1] : steps[toIndex];\n const from = pastLast ? steps[steps.length - 1] : steps[toIndex - 1];\n\n const dur = to.duration ?? defaultDuration;\n const ease = easings[to.easing ?? \"out\"];\n const start = to.at - dur;\n const t = pastLast || dur <= 0 ? 1 : ease(clamp01((raw - start) / dur));\n const value = from.value + (to.value - from.value) * t;\n\n return { value };\n}\n",+ "content": "\"use client\";\n\nimport { useCurrentFrame } from \"remotion\";\nimport type { ProgressStyle } from \"@/components/remocn/progress\";\nimport { clamp01, type EasingName, easings } from \"@/lib/remocn-ui\";\n\nexport interface ProgressStep {\n at: number;\n value: number;\n duration?: number;\n easing?: EasingName;\n}\n\nexport const DEFAULT_DURATION = 24;\n\nexport interface ProgressTransitionOptions {\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function tweenProgressStyle(\n a: ProgressStyle,\n b: ProgressStyle,\n t: number,\n): ProgressStyle {\n return { value: a.value + (b.value - a.value) * t };\n}\n\nexport function useProgressTransition(\n steps: ProgressStep[],\n opts: ProgressTransitionOptions = {},\n): ProgressStyle {\n const { speed = 1 } = opts;\n const raw = useCurrentFrame() * speed;\n return progressValueAt(steps, raw, opts);\n}\n\nexport function progressValueAt(\n steps: ProgressStep[],\n raw: number,\n opts: ProgressTransitionOptions = {},\n): ProgressStyle {\n const { defaultDuration = DEFAULT_DURATION } = opts;\n\n if (steps.length === 0) return { value: 0 };\n\n const first = steps[0];\n\n if (raw <= first.at) return { value: first.value };\n\n let toIndex = steps.length - 1;\n for (let i = 1; i < steps.length; i++) {\n if (steps[i].at > raw) {\n toIndex = i;\n break;\n }\n }\n const pastLast = raw >= steps[steps.length - 1].at;\n const to = pastLast ? steps[steps.length - 1] : steps[toIndex];\n const from = pastLast ? steps[steps.length - 1] : steps[toIndex - 1];\n\n const dur = to.duration ?? defaultDuration;\n const ease = easings[to.easing ?? \"out\"];\n const start = to.at - dur;\n const t = pastLast || dur <= 0 ? 1 : ease(clamp01((raw - start) / dur));\n const value = from.value + (to.value - from.value) * t;\n\n return { value };\n}\n","type": "registry:component","target": "components/remocn/use-progress-transition.ts"}diff --git a/public/r/push-through.json b/public/r/push-through.jsonindex c773c3dc..f7754162 100644--- a/public/r/push-through.json+++ b/public/r/push-through.json@@ -7,7 +7,7 @@"files": [{"path": "registry/remocn/push-through/index.tsx",- "content": "\"use client\";\n\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nexport type PushThroughProps = {\n zoom?: number;\n blur?: number;\n};\n\nconst PushThroughPresentation: React.FC<\n TransitionPresentationComponentProps<PushThroughProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const { zoom = 2.4, blur = 14 } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n if (!entering) {\n const exitStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.4, 0.62], [1, 0], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n }),\n transform: `scale(${interpolate(p, [0, 0.65], [1, zoom], {\n ...clampOpts,\n easing: Easing.in(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.15, 0.6], [0, blur], clampOpts)}px)`,\n };\n return <AbsoluteFill style={exitStyle}>{children}</AbsoluteFill>;\n }\n\n const childStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.3, 0.5], [0, 1], clampOpts),\n transform: `scale(${interpolate(p, [0.3, 0.88, 1], [0.68, 1.02, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.3, 0.75], [blur * 0.7, 0], clampOpts)}px)`,\n };\n\n return <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>;\n};\n\nexport function pushThrough(\n props: PushThroughProps = {},\n): TransitionPresentation<PushThroughProps> {\n return {\n component: PushThroughPresentation,\n props,\n };\n}\n",+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nexport type PushThroughProps = {\n zoom?: number;\n blur?: number;\n};\n\nconst PushThroughPresentation: React.FC<\n TransitionPresentationComponentProps<PushThroughProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const { zoom = 2.4, blur = 14 } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n if (!entering) {\n const exitStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.4, 0.62], [1, 0], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n }),\n transform: `scale(${interpolate(p, [0, 0.65], [1, zoom], {\n ...clampOpts,\n easing: Easing.in(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.15, 0.6], [0, blur], clampOpts)}px)`,\n };\n return <AbsoluteFill style={exitStyle}>{children}</AbsoluteFill>;\n }\n\n const childStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.3, 0.5], [0, 1], clampOpts),\n transform: `scale(${interpolate(p, [0.3, 0.88, 1], [0.68, 1.02, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.3, 0.75], [blur * 0.7, 0], clampOpts)}px)`,\n };\n\n return <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>;\n};\n\nexport function pushThrough(\n props: PushThroughProps = {},\n): TransitionPresentation<PushThroughProps> {\n return {\n component: PushThroughPresentation,\n props,\n };\n}\n","type": "registry:component","target": "components/remocn/push-through.tsx"}diff --git a/public/r/radio.json b/public/r/radio.jsonindex 69d644f0..9e2aecbb 100644--- a/public/r/radio.json+++ b/public/r/radio.json@@ -14,7 +14,7 @@},{"path": "registry/remocn-ui/radio/use-radio-transition.ts",- "content": "\"use client\";\n\nimport {\n easings,\n mixOklch,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\nimport {\n radioStyle,\n radioStyleContext,\n type RadioState,\n type RadioStyle,\n} from \"@/components/remocn/radio\";\n\nexport const DEFAULT_DURATION = 10;\n\nexport function tweenRadioStyle(\n a: RadioStyle,\n b: RadioStyle,\n t: number,\n): RadioStyle {\n return {\n ringBorderColor: mixOklch(a.ringBorderColor, b.ringBorderColor, t),\n dotOpacity: a.dotOpacity + (b.dotOpacity - a.dotOpacity) * t,\n dotScale: a.dotScale + (b.dotScale - a.dotScale) * t,\n };\n}\n\nexport interface RadioTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n primary?: string;\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useRadioTransition(\n steps: Step<RadioState>[],\n opts: RadioTransitionOptions = {},\n): RadioStyle {\n const {\n theme: themeOverride,\n mode,\n primary,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(\n { ...themeOverride, ...(primary ? { primary } : {}) },\n mode,\n );\n const ctx = radioStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"unchecked\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenRadioStyle(radioStyle(from, ctx), radioStyle(to, ctx), t);\n}\n",+ "content": "\"use client\";\n\nimport {\n type RadioState,\n type RadioStyle,\n radioStyle,\n radioStyleContext,\n} from \"@/components/remocn/radio\";\nimport {\n easings,\n mixOklch,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\n\nexport const DEFAULT_DURATION = 10;\n\nexport function tweenRadioStyle(\n a: RadioStyle,\n b: RadioStyle,\n t: number,\n): RadioStyle {\n return {\n ringBorderColor: mixOklch(a.ringBorderColor, b.ringBorderColor, t),\n dotOpacity: a.dotOpacity + (b.dotOpacity - a.dotOpacity) * t,\n dotScale: a.dotScale + (b.dotScale - a.dotScale) * t,\n };\n}\n\nexport interface RadioTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n primary?: string;\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useRadioTransition(\n steps: Step<RadioState>[],\n opts: RadioTransitionOptions = {},\n): RadioStyle {\n const {\n theme: themeOverride,\n mode,\n primary,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(\n { ...themeOverride, ...(primary ? { primary } : {}) },\n mode,\n );\n const ctx = radioStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"unchecked\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenRadioStyle(radioStyle(from, ctx), radioStyle(to, ctx), t);\n}\n","type": "registry:component","target": "components/remocn/use-radio-transition.ts"}diff --git a/public/r/remocn-ui.json b/public/r/remocn-ui.jsonindex a633daca..23437d6a 100644--- a/public/r/remocn-ui.json+++ b/public/r/remocn-ui.json@@ -7,25 +7,25 @@"files": [{"path": "registry/remocn-ui/core/timeline.ts",- "content": "import { useCurrentFrame, useVideoConfig } from \"remotion\";\nimport type { Step } from \"./types\";\n\nexport function framesFor(d: number | { seconds: number }, fps: number): number {\n return typeof d === \"number\" ? d : Math.round(d.seconds * fps);\n}\n\nexport function revealCount(\n localFrame: number,\n fps: number,\n len: number,\n cps: number,\n): number {\n const over = (len / cps) * fps;\n if (over <= 0) return len;\n return Math.max(0, Math.min(len, Math.floor((localFrame / over) * len)));\n}\n\nexport function clamp01(t: number): number {\n return Math.max(0, Math.min(1, t));\n}\n\nexport function revealedText(full: string, count: number): string {\n const c = Math.max(0, Math.min(full.length, Math.floor(count)));\n return full.slice(0, c);\n}\n\nexport interface TypewriterOptions {\n cps?: number;\n speed?: number;\n startFrame?: number;\n}\n\nexport interface TypewriterState {\n text: string;\n count: number;\n done: boolean;\n typing: boolean;\n}\n\nexport function useTypewriter(\n full: string,\n options: TypewriterOptions = {},\n): TypewriterState {\n const { cps = 20, speed = 1, startFrame = 0 } = options;\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const local = frame * speed - startFrame;\n const count = local <= 0 ? 0 : revealCount(local, fps, full.length, cps);\n return {\n text: revealedText(full, count),\n count,\n done: count >= full.length,\n typing: count > 0 && count < full.length,\n };\n}\n\nexport function useCurrentState<S extends string>(\n steps: Step<S>[],\n defaultState: S,\n speed = 1,\n): S {\n const effectiveFrame = useCurrentFrame() * speed;\n let current = defaultState;\n let bestAt = -Infinity;\n steps.forEach((step) => {\n if (step.at <= effectiveFrame && step.at >= bestAt) {\n bestAt = step.at;\n current = step.state;\n }\n });\n return current;\n}\n\nexport function useStateTransition<S extends string>(\n steps: Step<S>[],\n defaultState: S,\n speed = 1,\n defaultDuration = 8,\n): { from: S; to: S; progress: number } {\n const effectiveFrame = useCurrentFrame() * speed;\n const started = steps\n .map((step, index) => ({ step, index }))\n .sort((a, b) => a.step.at - b.step.at || a.index - b.index)\n .filter((e) => e.step.at <= effectiveFrame);\n if (started.length === 0)\n return { from: defaultState, to: defaultState, progress: 1 };\n const to = started[started.length - 1].step;\n const from = started.length >= 2 ? started[started.length - 2].step : null;\n const dur = to.duration ?? defaultDuration;\n const progress = dur > 0 ? clamp01((effectiveFrame - to.at) / dur) : 1;\n return { from: from ? from.state : defaultState, to: to.state, progress };\n}\n",+ "content": "import { useCurrentFrame, useVideoConfig } from \"remotion\";\nimport type { Step } from \"./types\";\n\nexport function framesFor(\n d: number | { seconds: number },\n fps: number,\n): number {\n return typeof d === \"number\" ? d : Math.round(d.seconds * fps);\n}\n\nexport function revealCount(\n localFrame: number,\n fps: number,\n len: number,\n cps: number,\n): number {\n const over = (len / cps) * fps;\n if (over <= 0) return len;\n return Math.max(0, Math.min(len, Math.floor((localFrame / over) * len)));\n}\n\nexport function clamp01(t: number): number {\n return Math.max(0, Math.min(1, t));\n}\n\nexport function revealedText(full: string, count: number): string {\n const c = Math.max(0, Math.min(full.length, Math.floor(count)));\n return full.slice(0, c);\n}\n\nexport interface TypewriterOptions {\n cps?: number;\n speed?: number;\n startFrame?: number;\n}\n\nexport interface TypewriterState {\n text: string;\n count: number;\n done: boolean;\n typing: boolean;\n}\n\nexport function useTypewriter(\n full: string,\n options: TypewriterOptions = {},\n): TypewriterState {\n const { cps = 20, speed = 1, startFrame = 0 } = options;\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const local = frame * speed - startFrame;\n const count = local <= 0 ? 0 : revealCount(local, fps, full.length, cps);\n return {\n text: revealedText(full, count),\n count,\n done: count >= full.length,\n typing: count > 0 && count < full.length,\n };\n}\n\nexport function useCurrentState<S extends string>(\n steps: Step<S>[],\n defaultState: S,\n speed = 1,\n): S {\n const effectiveFrame = useCurrentFrame() * speed;\n let current = defaultState;\n let bestAt = -Infinity;\n steps.forEach((step) => {\n if (step.at <= effectiveFrame && step.at >= bestAt) {\n bestAt = step.at;\n current = step.state;\n }\n });\n return current;\n}\n\nexport function useStateTransition<S extends string>(\n steps: Step<S>[],\n defaultState: S,\n speed = 1,\n defaultDuration = 8,\n): { from: S; to: S; progress: number } {\n const effectiveFrame = useCurrentFrame() * speed;\n const started = steps\n .map((step, index) => ({ step, index }))\n .sort((a, b) => a.step.at - b.step.at || a.index - b.index)\n .filter((e) => e.step.at <= effectiveFrame);\n if (started.length === 0)\n return { from: defaultState, to: defaultState, progress: 1 };\n const to = started[started.length - 1].step;\n const from = started.length >= 2 ? started[started.length - 2].step : null;\n const dur = to.duration ?? defaultDuration;\n const progress = dur > 0 ? clamp01((effectiveFrame - to.at) / dur) : 1;\n return { from: from ? from.state : defaultState, to: to.state, progress };\n}\n","type": "registry:lib","target": "lib/remocn-ui/timeline.ts"},{"path": "registry/remocn-ui/core/theme.ts",- "content": "\"use client\";\n\nimport { createContext, createElement, useContext } from \"react\";\nimport type { ReactNode } from \"react\";\n\nexport interface RemocnTheme {\n background: string;\n foreground: string;\n card: string;\n cardForeground: string;\n popover: string;\n popoverForeground: string;\n primary: string;\n primaryForeground: string;\n secondary: string;\n secondaryForeground: string;\n muted: string;\n mutedForeground: string;\n accent: string;\n accentForeground: string;\n destructive: string;\n destructiveForeground: string;\n border: string;\n input: string;\n ring: string;\n radius: number;\n}\n\nexport const defaultLightTheme: RemocnTheme = {\n background: \"oklch(1 0 0)\",\n foreground: \"oklch(0.145 0 0)\",\n card: \"oklch(1 0 0)\",\n cardForeground: \"oklch(0.145 0 0)\",\n popover: \"oklch(1 0 0)\",\n popoverForeground: \"oklch(0.145 0 0)\",\n primary: \"oklch(0.205 0 0)\",\n primaryForeground: \"oklch(0.985 0 0)\",\n secondary: \"oklch(0.97 0 0)\",\n secondaryForeground: \"oklch(0.205 0 0)\",\n muted: \"oklch(0.97 0 0)\",\n mutedForeground: \"oklch(0.556 0 0)\",\n accent: \"oklch(0.97 0 0)\",\n accentForeground: \"oklch(0.205 0 0)\",\n destructive: \"oklch(0.577 0.245 27.325)\",\n destructiveForeground: \"oklch(0.985 0 0)\",\n border: \"oklch(0.922 0 0)\",\n input: \"oklch(0.922 0 0)\",\n ring: \"oklch(0.708 0 0)\",\n radius: 10,\n}\n\nexport const defaultDarkTheme: RemocnTheme = {\n background: \"oklch(0.145 0 0)\",\n foreground: \"oklch(0.985 0 0)\",\n card: \"oklch(0.205 0 0)\",\n cardForeground: \"oklch(0.985 0 0)\",\n popover: \"oklch(0.205 0 0)\",\n popoverForeground: \"oklch(0.985 0 0)\",\n primary: \"oklch(0.922 0 0)\",\n primaryForeground: \"oklch(0.205 0 0)\",\n secondary: \"oklch(0.269 0 0)\",\n secondaryForeground: \"oklch(0.985 0 0)\",\n muted: \"oklch(0.269 0 0)\",\n mutedForeground: \"oklch(0.708 0 0)\",\n accent: \"oklch(0.269 0 0)\",\n accentForeground: \"oklch(0.985 0 0)\",\n destructive: \"oklch(0.704 0.191 22.216)\",\n destructiveForeground: \"oklch(0.985 0 0)\",\n border: \"oklch(1 0 0 / 10%)\",\n input: \"oklch(1 0 0 / 15%)\",\n ring: \"oklch(0.556 0 0)\",\n radius: 10,\n};\n\ninterface RemocnThemeContextValue {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n}\n\nconst RemocnThemeContext = createContext<RemocnThemeContextValue>({});\n\nexport interface RemocnUIProviderProps {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n children: ReactNode;\n}\n\nexport function RemocnUIProvider({\n theme,\n mode,\n children,\n}: RemocnUIProviderProps) {\n return createElement(\n RemocnThemeContext.Provider,\n { value: { theme, mode } },\n children,\n );\n}\n\nexport function useRemocnTheme(\n override?: Partial<RemocnTheme>,\n modeOverride?: \"light\" | \"dark\",\n): RemocnTheme {\n const ctx = useContext(RemocnThemeContext);\n const mode = modeOverride ?? ctx.mode ?? \"light\";\n const base = mode === \"dark\" ? defaultDarkTheme : defaultLightTheme;\n return { ...base, ...ctx.theme, ...override };\n}\n",+ "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { createContext, createElement, useContext } from \"react\";\n\nexport interface RemocnTheme {\n background: string;\n foreground: string;\n card: string;\n cardForeground: string;\n popover: string;\n popoverForeground: string;\n primary: string;\n primaryForeground: string;\n secondary: string;\n secondaryForeground: string;\n muted: string;\n mutedForeground: string;\n accent: string;\n accentForeground: string;\n destructive: string;\n destructiveForeground: string;\n border: string;\n input: string;\n ring: string;\n radius: number;\n}\n\nexport const defaultLightTheme: RemocnTheme = {\n background: \"oklch(1 0 0)\",\n foreground: \"oklch(0.145 0 0)\",\n card: \"oklch(1 0 0)\",\n cardForeground: \"oklch(0.145 0 0)\",\n popover: \"oklch(1 0 0)\",\n popoverForeground: \"oklch(0.145 0 0)\",\n primary: \"oklch(0.205 0 0)\",\n primaryForeground: \"oklch(0.985 0 0)\",\n secondary: \"oklch(0.97 0 0)\",\n secondaryForeground: \"oklch(0.205 0 0)\",\n muted: \"oklch(0.97 0 0)\",\n mutedForeground: \"oklch(0.556 0 0)\",\n accent: \"oklch(0.97 0 0)\",\n accentForeground: \"oklch(0.205 0 0)\",\n destructive: \"oklch(0.577 0.245 27.325)\",\n destructiveForeground: \"oklch(0.985 0 0)\",\n border: \"oklch(0.922 0 0)\",\n input: \"oklch(0.922 0 0)\",\n ring: \"oklch(0.708 0 0)\",\n radius: 10,\n};\n\nexport const defaultDarkTheme: RemocnTheme = {\n background: \"oklch(0.145 0 0)\",\n foreground: \"oklch(0.985 0 0)\",\n card: \"oklch(0.205 0 0)\",\n cardForeground: \"oklch(0.985 0 0)\",\n popover: \"oklch(0.205 0 0)\",\n popoverForeground: \"oklch(0.985 0 0)\",\n primary: \"oklch(0.922 0 0)\",\n primaryForeground: \"oklch(0.205 0 0)\",\n secondary: \"oklch(0.269 0 0)\",\n secondaryForeground: \"oklch(0.985 0 0)\",\n muted: \"oklch(0.269 0 0)\",\n mutedForeground: \"oklch(0.708 0 0)\",\n accent: \"oklch(0.269 0 0)\",\n accentForeground: \"oklch(0.985 0 0)\",\n destructive: \"oklch(0.704 0.191 22.216)\",\n destructiveForeground: \"oklch(0.985 0 0)\",\n border: \"oklch(1 0 0 / 10%)\",\n input: \"oklch(1 0 0 / 15%)\",\n ring: \"oklch(0.556 0 0)\",\n radius: 10,\n};\n\ninterface RemocnThemeContextValue {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n}\n\nconst RemocnThemeContext = createContext<RemocnThemeContextValue>({});\n\nexport interface RemocnUIProviderProps {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n children: ReactNode;\n}\n\nexport function RemocnUIProvider({\n theme,\n mode,\n children,\n}: RemocnUIProviderProps) {\n return createElement(\n RemocnThemeContext.Provider,\n { value: { theme, mode } },\n children,\n );\n}\n\nexport function useRemocnTheme(\n override?: Partial<RemocnTheme>,\n modeOverride?: \"light\" | \"dark\",\n): RemocnTheme {\n const ctx = useContext(RemocnThemeContext);\n const mode = modeOverride ?? ctx.mode ?? \"light\";\n const base = mode === \"dark\" ? defaultDarkTheme : defaultLightTheme;\n return { ...base, ...ctx.theme, ...override };\n}\n","type": "registry:lib","target": "lib/remocn-ui/theme.ts"},{"path": "registry/remocn-ui/core/color.ts",- "content": "\nimport {\n clampChroma,\n converter,\n formatRgb,\n interpolate,\n parse,\n type Oklch,\n type Rgb,\n} from \"culori\";\n\nconst toRgb = converter(\"rgb\");\nconst toOklch = converter(\"oklch\");\n\nconst BLACK: Rgb = { mode: \"rgb\", r: 0, g: 0, b: 0, alpha: 1 };\n\nexport function parseColor(c: string): Rgb {\n const s = c.trim();\n\n if (s.startsWith(\"var(\")) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[remocn-ui] parseColor cannot resolve CSS variable \"${s}\" under Remotion's per-frame render. ` +\n \"Animated colors must be concrete oklch/hex/rgb values supplied via the theme. \" +\n \"Falling back to the JS default.\",\n );\n }\n return { ...BLACK };\n }\n\n const rgb = toRgb(parse(s));\n if (!rgb) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(`[remocn-ui] parseColor could not parse \"${s}\"; using black.`);\n }\n return { ...BLACK };\n }\n\n return { mode: \"rgb\", r: rgb.r, g: rgb.g, b: rgb.b, alpha: rgb.alpha ?? 1 };\n}\n\nexport function oklchToRgb(l: number, c: number, h: number): Rgb {\n const mapped = clampChroma({ mode: \"oklch\", l, c, h }, \"oklch\", \"rgb\");\n return toRgb(mapped);\n}\n\nexport function rgbToOklch(rgb: Rgb): Oklch {\n const { l, c, h } = toOklch(rgb);\n return { mode: \"oklch\", l, c, h: Number.isFinite(h) ? h : 0 };\n}\n\nfunction resolveColorString(s: string): string {\n const trimmed = s.trim();\n if (trimmed.startsWith(\"var(\")) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[remocn-ui] mixOklch cannot resolve CSS variable \"${trimmed}\" under Remotion's per-frame render. ` +\n \"Animated colors must be concrete oklch/hex/rgb values supplied via the theme. \" +\n \"Falling back to the JS default.\",\n );\n }\n return \"#000\";\n }\n if (!parse(trimmed)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(`[remocn-ui] mixOklch could not parse \"${trimmed}\"; using black.`);\n }\n return \"#000\";\n }\n return trimmed;\n}\n\nexport function mixOklch(a: string, b: string, t: number): string {\n const mixed = clampChroma(\n interpolate([resolveColorString(a), resolveColorString(b)], \"oklch\")(t),\n \"oklch\",\n \"rgb\",\n );\n return toCss(toRgb(mixed));\n}\n\nexport function toCss(color: Rgb): string {\n return formatRgb(color);\n}\n",+ "content": "import {\n clampChroma,\n converter,\n formatRgb,\n interpolate,\n type Oklch,\n parse,\n type Rgb,\n} from \"culori\";\n\nconst toRgb = converter(\"rgb\");\nconst toOklch = converter(\"oklch\");\n\nconst BLACK: Rgb = { mode: \"rgb\", r: 0, g: 0, b: 0, alpha: 1 };\n\nexport function parseColor(c: string): Rgb {\n const s = c.trim();\n\n if (s.startsWith(\"var(\")) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[remocn-ui] parseColor cannot resolve CSS variable \"${s}\" under Remotion's per-frame render. ` +\n \"Animated colors must be concrete oklch/hex/rgb values supplied via the theme. \" +\n \"Falling back to the JS default.\",\n );\n }\n return { ...BLACK };\n }\n\n const rgb = toRgb(parse(s));\n if (!rgb) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[remocn-ui] parseColor could not parse \"${s}\"; using black.`,\n );\n }\n return { ...BLACK };\n }\n\n return { mode: \"rgb\", r: rgb.r, g: rgb.g, b: rgb.b, alpha: rgb.alpha ?? 1 };\n}\n\nexport function oklchToRgb(l: number, c: number, h: number): Rgb {\n const mapped = clampChroma({ mode: \"oklch\", l, c, h }, \"oklch\", \"rgb\");\n return toRgb(mapped);\n}\n\nexport function rgbToOklch(rgb: Rgb): Oklch {\n const { l, c, h } = toOklch(rgb);\n return { mode: \"oklch\", l, c, h: Number.isFinite(h) ? h : 0 };\n}\n\nfunction resolveColorString(s: string): string {\n const trimmed = s.trim();\n if (trimmed.startsWith(\"var(\")) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[remocn-ui] mixOklch cannot resolve CSS variable \"${trimmed}\" under Remotion's per-frame render. ` +\n \"Animated colors must be concrete oklch/hex/rgb values supplied via the theme. \" +\n \"Falling back to the JS default.\",\n );\n }\n return \"#000\";\n }\n if (!parse(trimmed)) {\n if (process.env.NODE_ENV !== \"production\") {\n console.warn(\n `[remocn-ui] mixOklch could not parse \"${trimmed}\"; using black.`,\n );\n }\n return \"#000\";\n }\n return trimmed;\n}\n\nexport function mixOklch(a: string, b: string, t: number): string {\n const mixed = clampChroma(\n interpolate([resolveColorString(a), resolveColorString(b)], \"oklch\")(t),\n \"oklch\",\n \"rgb\",\n );\n return toCss(toRgb(mixed));\n}\n\nexport function toCss(color: Rgb): string {\n return formatRgb(color);\n}\n","type": "registry:lib","target": "lib/remocn-ui/color.ts"},{"path": "registry/remocn-ui/core/motion.ts",- "content": "\nexport const easings = {\n linear: (t: number): number => t,\n out: (t: number): number => 1 - (1 - t) ** 3,\n in: (t: number): number => t * t * t,\n inOut: (t: number): number =>\n t < 0.5 ? 4 * t * t * t : 1 - (-2 * t + 2) ** 3 / 2,\n} as const;\n\nexport type EasingName = keyof typeof easings;\n\nexport const springs = {\n snappy: { damping: 18, stiffness: 220, mass: 0.7 },\n soft: { damping: 14, stiffness: 120, mass: 0.9 },\n bouncy: { damping: 10, stiffness: 180, mass: 0.8 },\n} as const;\n\nexport type SpringName = keyof typeof springs;\n",+ "content": "export const easings = {\n linear: (t: number): number => t,\n out: (t: number): number => 1 - (1 - t) ** 3,\n in: (t: number): number => t * t * t,\n inOut: (t: number): number =>\n t < 0.5 ? 4 * t * t * t : 1 - (-2 * t + 2) ** 3 / 2,\n} as const;\n\nexport type EasingName = keyof typeof easings;\n\nexport const springs = {\n snappy: { damping: 18, stiffness: 220, mass: 0.7 },\n soft: { damping: 14, stiffness: 120, mass: 0.9 },\n bouncy: { damping: 10, stiffness: 180, mass: 0.8 },\n} as const;\n\nexport type SpringName = keyof typeof springs;\n","type": "registry:lib","target": "lib/remocn-ui/motion.ts"},@@ -37,7 +37,7 @@},{"path": "registry/remocn-ui/core/index.ts",- "content": "export type { Step } from \"./types\";\nexport {\n clamp01,\n framesFor,\n revealCount,\n revealedText,\n useCurrentState,\n useStateTransition,\n useTypewriter,\n} from \"./timeline\";\nexport type { TypewriterOptions, TypewriterState } from \"./timeline\";\nexport {\n mixOklch,\n oklchToRgb,\n parseColor,\n rgbToOklch,\n toCss,\n} from \"./color\";\nexport {\n defaultDarkTheme,\n defaultLightTheme,\n RemocnUIProvider,\n useRemocnTheme,\n} from \"./theme\";\nexport type { RemocnTheme, RemocnUIProviderProps } from \"./theme\";\nexport { easings, springs } from \"./motion\";\nexport type { EasingName, SpringName } from \"./motion\";\n",+ "content": "export {\n mixOklch,\n oklchToRgb,\n parseColor,\n rgbToOklch,\n toCss,\n} from \"./color\";\nexport type { EasingName, SpringName } from \"./motion\";\nexport { easings, springs } from \"./motion\";\nexport type { RemocnTheme, RemocnUIProviderProps } from \"./theme\";\nexport {\n defaultDarkTheme,\n defaultLightTheme,\n RemocnUIProvider,\n useRemocnTheme,\n} from \"./theme\";\nexport type { TypewriterOptions, TypewriterState } from \"./timeline\";\nexport {\n clamp01,\n framesFor,\n revealCount,\n revealedText,\n useCurrentState,\n useStateTransition,\n useTypewriter,\n} from \"./timeline\";\nexport type { Step } from \"./types\";\n","type": "registry:lib","target": "lib/remocn-ui/index.ts"}diff --git a/public/r/resizable.json b/public/r/resizable.jsonindex 39e95595..9b8dd5b6 100644--- a/public/r/resizable.json+++ b/public/r/resizable.json@@ -8,13 +8,13 @@"files": [{"path": "registry/remocn-ui/resizable/index.tsx",- "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { clamp01, mixOklch, type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type ResizableHandleState = \"idle\" | \"hover\" | \"press\";\n\nexport type ResizableDirection = \"horizontal\" | \"vertical\";\n\nexport interface ResizableStyle {\n ratio: number;\n handleScale: number;\n handleRingOpacity: number;\n}\n\nexport interface ResizableProps {\n first?: ReactNode;\n second?: ReactNode;\n direction?: ResizableDirection;\n ratio?: number;\n handleState?: ResizableHandleState;\n style?: ResizableStyle;\n minRatio?: number;\n maxRatio?: number;\n width?: number;\n height?: number;\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nconst DIVIDER = 1;\nconst GRIP_LONG = 24;\nconst GRIP_SHORT = 4;\nconst RING_WIDTH = 4;\n\nfunction clampRatio(ratio: number, minRatio: number, maxRatio: number): number {\n return Math.min(maxRatio, Math.max(minRatio, ratio));\n}\n\nexport function resizableHandleStyle(handleState: ResizableHandleState): {\n handleScale: number;\n handleRingOpacity: number;\n} {\n switch (handleState) {\n case \"hover\":\n return { handleScale: 1.15, handleRingOpacity: 1 };\n case \"press\":\n return { handleScale: 1.25, handleRingOpacity: 1 };\n default:\n return { handleScale: 1, handleRingOpacity: 0 };\n }\n}\n\nexport interface ResizableStyleContext {\n containerBg: string;\n border: string;\n panelBg: string;\n grip: string;\n ring: string;\n placeholderFg: string;\n radius: number;\n}\n\nexport function resizableStyleContext(theme: RemocnTheme): ResizableStyleContext {\n return {\n containerBg: theme.background,\n border: theme.border,\n panelBg: theme.muted,\n grip: theme.border,\n ring: mixOklch(theme.ring, theme.background, 0.6),\n placeholderFg: theme.mutedForeground,\n radius: theme.radius,\n };\n}\n\nexport function resizableStyle(\n ratio: number,\n handleState: ResizableHandleState,\n): ResizableStyle {\n const handle = resizableHandleStyle(handleState);\n return {\n ratio,\n handleScale: handle.handleScale,\n handleRingOpacity: handle.handleRingOpacity,\n };\n}\n\nfunction Placeholder({ label, color }: { label: string; color: string }) {\n return (\n <div\n style={{\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontSize: 13,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n color,\n }}\n >\n {label}\n </div>\n );\n}\n\nexport function Resizable({\n first,\n second,\n direction = \"horizontal\",\n ratio = 0.5,\n handleState = \"idle\",\n style,\n minRatio = 0.15,\n maxRatio = 0.85,\n width = 440,\n height = 240,\n theme: themeOverride,\n className,\n}: ResizableProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const ctx = resizableStyleContext(theme);\n\n const v = style ?? resizableStyle(ratio, handleState);\n const pct = clampRatio(v.ratio, minRatio, maxRatio) * 100;\n const isHorizontal = direction === \"horizontal\";\n\n const gripW = isHorizontal ? GRIP_SHORT : GRIP_LONG;\n const gripH = isHorizontal ? GRIP_LONG : GRIP_SHORT;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div\n style={{\n position: \"relative\",\n width,\n height,\n display: \"flex\",\n flexDirection: isHorizontal ? \"row\" : \"column\",\n background: ctx.containerBg,\n border: `1px solid ${ctx.border}`,\n borderRadius: ctx.radius,\n overflow: \"hidden\",\n boxSizing: \"border-box\",\n }}\n >\n {}\n <div\n style={{\n flex: \"none\",\n [isHorizontal ? \"width\" : \"height\"]: `${pct}%`,\n background: ctx.panelBg,\n overflow: \"hidden\",\n }}\n >\n {first ?? <Placeholder label=\"Panel one\" color={ctx.placeholderFg} />}\n </div>\n {}\n <div\n style={{\n position: \"relative\",\n flex: \"none\",\n [isHorizontal ? \"width\" : \"height\"]: DIVIDER,\n background: ctx.border,\n }}\n >\n {}\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: gripW + RING_WIDTH * 2,\n height: gripH + RING_WIDTH * 2,\n transform: `translate(-50%, -50%) scale(${v.handleScale})`,\n borderRadius: 999,\n background: ctx.ring,\n opacity: v.handleRingOpacity,\n }}\n />\n {}\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: gripW,\n height: gripH,\n transform: `translate(-50%, -50%) scale(${v.handleScale})`,\n borderRadius: 999,\n background: ctx.grip,\n }}\n />\n </div>\n {}\n <div\n style={{\n flex: \"1 1 0\",\n background: ctx.panelBg,\n overflow: \"hidden\",\n }}\n >\n {second ?? <Placeholder label=\"Panel two\" color={ctx.placeholderFg} />}\n </div>\n </div>\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { mixOklch, type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type ResizableHandleState = \"idle\" | \"hover\" | \"press\";\n\nexport type ResizableDirection = \"horizontal\" | \"vertical\";\n\nexport interface ResizableStyle {\n ratio: number;\n handleScale: number;\n handleRingOpacity: number;\n}\n\nexport interface ResizableProps {\n first?: ReactNode;\n second?: ReactNode;\n direction?: ResizableDirection;\n ratio?: number;\n handleState?: ResizableHandleState;\n style?: ResizableStyle;\n minRatio?: number;\n maxRatio?: number;\n width?: number;\n height?: number;\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nconst DIVIDER = 1;\nconst GRIP_LONG = 24;\nconst GRIP_SHORT = 4;\nconst RING_WIDTH = 4;\n\nfunction clampRatio(ratio: number, minRatio: number, maxRatio: number): number {\n return Math.min(maxRatio, Math.max(minRatio, ratio));\n}\n\nexport function resizableHandleStyle(handleState: ResizableHandleState): {\n handleScale: number;\n handleRingOpacity: number;\n} {\n switch (handleState) {\n case \"hover\":\n return { handleScale: 1.15, handleRingOpacity: 1 };\n case \"press\":\n return { handleScale: 1.25, handleRingOpacity: 1 };\n default:\n return { handleScale: 1, handleRingOpacity: 0 };\n }\n}\n\nexport interface ResizableStyleContext {\n containerBg: string;\n border: string;\n panelBg: string;\n grip: string;\n ring: string;\n placeholderFg: string;\n radius: number;\n}\n\nexport function resizableStyleContext(\n theme: RemocnTheme,\n): ResizableStyleContext {\n return {\n containerBg: theme.background,\n border: theme.border,\n panelBg: theme.muted,\n grip: theme.border,\n ring: mixOklch(theme.ring, theme.background, 0.6),\n placeholderFg: theme.mutedForeground,\n radius: theme.radius,\n };\n}\n\nexport function resizableStyle(\n ratio: number,\n handleState: ResizableHandleState,\n): ResizableStyle {\n const handle = resizableHandleStyle(handleState);\n return {\n ratio,\n handleScale: handle.handleScale,\n handleRingOpacity: handle.handleRingOpacity,\n };\n}\n\nfunction Placeholder({ label, color }: { label: string; color: string }) {\n return (\n <div\n style={{\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontSize: 13,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n color,\n }}\n >\n {label}\n </div>\n );\n}\n\nexport function Resizable({\n first,\n second,\n direction = \"horizontal\",\n ratio = 0.5,\n handleState = \"idle\",\n style,\n minRatio = 0.15,\n maxRatio = 0.85,\n width = 440,\n height = 240,\n theme: themeOverride,\n className,\n}: ResizableProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const ctx = resizableStyleContext(theme);\n\n const v = style ?? resizableStyle(ratio, handleState);\n const pct = clampRatio(v.ratio, minRatio, maxRatio) * 100;\n const isHorizontal = direction === \"horizontal\";\n\n const gripW = isHorizontal ? GRIP_SHORT : GRIP_LONG;\n const gripH = isHorizontal ? GRIP_LONG : GRIP_SHORT;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div\n style={{\n position: \"relative\",\n width,\n height,\n display: \"flex\",\n flexDirection: isHorizontal ? \"row\" : \"column\",\n background: ctx.containerBg,\n border: `1px solid ${ctx.border}`,\n borderRadius: ctx.radius,\n overflow: \"hidden\",\n boxSizing: \"border-box\",\n }}\n >\n {}\n <div\n style={{\n flex: \"none\",\n [isHorizontal ? \"width\" : \"height\"]: `${pct}%`,\n background: ctx.panelBg,\n overflow: \"hidden\",\n }}\n >\n {first ?? <Placeholder label=\"Panel one\" color={ctx.placeholderFg} />}\n </div>\n {}\n <div\n style={{\n position: \"relative\",\n flex: \"none\",\n [isHorizontal ? \"width\" : \"height\"]: DIVIDER,\n background: ctx.border,\n }}\n >\n {}\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: gripW + RING_WIDTH * 2,\n height: gripH + RING_WIDTH * 2,\n transform: `translate(-50%, -50%) scale(${v.handleScale})`,\n borderRadius: 999,\n background: ctx.ring,\n opacity: v.handleRingOpacity,\n }}\n />\n {}\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: gripW,\n height: gripH,\n transform: `translate(-50%, -50%) scale(${v.handleScale})`,\n borderRadius: 999,\n background: ctx.grip,\n }}\n />\n </div>\n {}\n <div\n style={{\n flex: \"1 1 0\",\n background: ctx.panelBg,\n overflow: \"hidden\",\n }}\n >\n {second ?? (\n <Placeholder label=\"Panel two\" color={ctx.placeholderFg} />\n )}\n </div>\n </div>\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/resizable.tsx"},{"path": "registry/remocn-ui/resizable/use-resizable-transition.ts",- "content": "\"use client\";\n\nimport { useCurrentFrame } from \"remotion\";\nimport { clamp01, type EasingName, easings } from \"@/lib/remocn-ui\";\nimport {\n resizableHandleStyle,\n type ResizableHandleState,\n type ResizableStyle,\n} from \"@/components/remocn/resizable\";\n\nexport interface ResizableStep {\n at: number;\n ratio?: number;\n handleState?: ResizableHandleState;\n duration?: number;\n easing?: EasingName;\n}\n\nexport const DEFAULT_DURATION = 18;\n\nexport interface ResizableTransitionOptions {\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function tweenResizableStyle(\n a: ResizableStyle,\n b: ResizableStyle,\n t: number,\n): ResizableStyle {\n return {\n ratio: a.ratio + (b.ratio - a.ratio) * t,\n handleScale: a.handleScale + (b.handleScale - a.handleScale) * t,\n handleRingOpacity:\n a.handleRingOpacity + (b.handleRingOpacity - a.handleRingOpacity) * t,\n };\n}\n\nexport function useResizableTransition(\n steps: ResizableStep[],\n opts: ResizableTransitionOptions = {},\n): ResizableStyle {\n const { speed = 1 } = opts;\n const raw = useCurrentFrame() * speed;\n return resizableStyleAt(steps, raw, opts);\n}\n\nfunction ratioAt(\n steps: ResizableStep[],\n raw: number,\n defaultDuration: number,\n): number {\n const ratioSteps = steps.filter(\n (s): s is ResizableStep & { ratio: number } => s.ratio !== undefined,\n );\n if (ratioSteps.length === 0) return 0.5;\n const first = ratioSteps[0];\n if (raw <= first.at) return first.ratio;\n\n let toIndex = ratioSteps.length - 1;\n for (let i = 1; i < ratioSteps.length; i++) {\n if (ratioSteps[i].at > raw) {\n toIndex = i;\n break;\n }\n }\n const pastLast = raw >= ratioSteps[ratioSteps.length - 1].at;\n const to = pastLast ? ratioSteps[ratioSteps.length - 1] : ratioSteps[toIndex];\n const from = pastLast\n ? ratioSteps[ratioSteps.length - 1]\n : ratioSteps[toIndex - 1];\n\n const dur = to.duration ?? defaultDuration;\n const ease = easings[to.easing ?? \"out\"];\n const start = to.at - dur;\n const t = pastLast || dur <= 0 ? 1 : ease(clamp01((raw - start) / dur));\n return from.ratio + (to.ratio - from.ratio) * t;\n}\n\nfunction handleAt(\n steps: ResizableStep[],\n raw: number,\n defaultDuration: number,\n): { handleScale: number; handleRingOpacity: number } {\n const handleSteps = steps.filter(\n (s): s is ResizableStep & { handleState: ResizableHandleState } =>\n s.handleState !== undefined,\n );\n if (handleSteps.length === 0) return resizableHandleStyle(\"idle\");\n const first = handleSteps[0];\n if (raw <= first.at) return resizableHandleStyle(first.handleState);\n\n let toIndex = handleSteps.length - 1;\n for (let i = 1; i < handleSteps.length; i++) {\n if (handleSteps[i].at > raw) {\n toIndex = i;\n break;\n }\n }\n const pastLast = raw >= handleSteps[handleSteps.length - 1].at;\n const to = pastLast\n ? handleSteps[handleSteps.length - 1]\n : handleSteps[toIndex];\n const from = pastLast\n ? handleSteps[handleSteps.length - 1]\n : handleSteps[toIndex - 1];\n\n const dur = to.duration ?? defaultDuration;\n const ease = easings[to.easing ?? \"out\"];\n const start = to.at - dur;\n const t = pastLast || dur <= 0 ? 1 : ease(clamp01((raw - start) / dur));\n\n const a = resizableHandleStyle(from.handleState);\n const b = resizableHandleStyle(to.handleState);\n return {\n handleScale: a.handleScale + (b.handleScale - a.handleScale) * t,\n handleRingOpacity:\n a.handleRingOpacity + (b.handleRingOpacity - a.handleRingOpacity) * t,\n };\n}\n\nexport function resizableStyleAt(\n steps: ResizableStep[],\n raw: number,\n opts: ResizableTransitionOptions = {},\n): ResizableStyle {\n const { defaultDuration = DEFAULT_DURATION } = opts;\n const ratio = ratioAt(steps, raw, defaultDuration);\n const handle = handleAt(steps, raw, defaultDuration);\n return {\n ratio,\n handleScale: handle.handleScale,\n handleRingOpacity: handle.handleRingOpacity,\n };\n}\n",+ "content": "\"use client\";\n\nimport { useCurrentFrame } from \"remotion\";\nimport {\n type ResizableHandleState,\n type ResizableStyle,\n resizableHandleStyle,\n} from \"@/components/remocn/resizable\";\nimport { clamp01, type EasingName, easings } from \"@/lib/remocn-ui\";\n\nexport interface ResizableStep {\n at: number;\n ratio?: number;\n handleState?: ResizableHandleState;\n duration?: number;\n easing?: EasingName;\n}\n\nexport const DEFAULT_DURATION = 18;\n\nexport interface ResizableTransitionOptions {\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function tweenResizableStyle(\n a: ResizableStyle,\n b: ResizableStyle,\n t: number,\n): ResizableStyle {\n return {\n ratio: a.ratio + (b.ratio - a.ratio) * t,\n handleScale: a.handleScale + (b.handleScale - a.handleScale) * t,\n handleRingOpacity:\n a.handleRingOpacity + (b.handleRingOpacity - a.handleRingOpacity) * t,\n };\n}\n\nexport function useResizableTransition(\n steps: ResizableStep[],\n opts: ResizableTransitionOptions = {},\n): ResizableStyle {\n const { speed = 1 } = opts;\n const raw = useCurrentFrame() * speed;\n return resizableStyleAt(steps, raw, opts);\n}\n\nfunction ratioAt(\n steps: ResizableStep[],\n raw: number,\n defaultDuration: number,\n): number {\n const ratioSteps = steps.filter(\n (s): s is ResizableStep & { ratio: number } => s.ratio !== undefined,\n );\n if (ratioSteps.length === 0) return 0.5;\n const first = ratioSteps[0];\n if (raw <= first.at) return first.ratio;\n\n let toIndex = ratioSteps.length - 1;\n for (let i = 1; i < ratioSteps.length; i++) {\n if (ratioSteps[i].at > raw) {\n toIndex = i;\n break;\n }\n }\n const pastLast = raw >= ratioSteps[ratioSteps.length - 1].at;\n const to = pastLast ? ratioSteps[ratioSteps.length - 1] : ratioSteps[toIndex];\n const from = pastLast\n ? ratioSteps[ratioSteps.length - 1]\n : ratioSteps[toIndex - 1];\n\n const dur = to.duration ?? defaultDuration;\n const ease = easings[to.easing ?? \"out\"];\n const start = to.at - dur;\n const t = pastLast || dur <= 0 ? 1 : ease(clamp01((raw - start) / dur));\n return from.ratio + (to.ratio - from.ratio) * t;\n}\n\nfunction handleAt(\n steps: ResizableStep[],\n raw: number,\n defaultDuration: number,\n): { handleScale: number; handleRingOpacity: number } {\n const handleSteps = steps.filter(\n (s): s is ResizableStep & { handleState: ResizableHandleState } =>\n s.handleState !== undefined,\n );\n if (handleSteps.length === 0) return resizableHandleStyle(\"idle\");\n const first = handleSteps[0];\n if (raw <= first.at) return resizableHandleStyle(first.handleState);\n\n let toIndex = handleSteps.length - 1;\n for (let i = 1; i < handleSteps.length; i++) {\n if (handleSteps[i].at > raw) {\n toIndex = i;\n break;\n }\n }\n const pastLast = raw >= handleSteps[handleSteps.length - 1].at;\n const to = pastLast\n ? handleSteps[handleSteps.length - 1]\n : handleSteps[toIndex];\n const from = pastLast\n ? handleSteps[handleSteps.length - 1]\n : handleSteps[toIndex - 1];\n\n const dur = to.duration ?? defaultDuration;\n const ease = easings[to.easing ?? \"out\"];\n const start = to.at - dur;\n const t = pastLast || dur <= 0 ? 1 : ease(clamp01((raw - start) / dur));\n\n const a = resizableHandleStyle(from.handleState);\n const b = resizableHandleStyle(to.handleState);\n return {\n handleScale: a.handleScale + (b.handleScale - a.handleScale) * t,\n handleRingOpacity:\n a.handleRingOpacity + (b.handleRingOpacity - a.handleRingOpacity) * t,\n };\n}\n\nexport function resizableStyleAt(\n steps: ResizableStep[],\n raw: number,\n opts: ResizableTransitionOptions = {},\n): ResizableStyle {\n const { defaultDuration = DEFAULT_DURATION } = opts;\n const ratio = ratioAt(steps, raw, defaultDuration);\n const handle = handleAt(steps, raw, defaultDuration);\n return {\n ratio,\n handleScale: handle.handleScale,\n handleRingOpacity: handle.handleRingOpacity,\n };\n}\n","type": "registry:component","target": "components/remocn/use-resizable-transition.ts"}diff --git a/public/r/ripple-zoom.json b/public/r/ripple-zoom.jsonindex 1f89d646..5645db21 100644--- a/public/r/ripple-zoom.json+++ b/public/r/ripple-zoom.json@@ -8,7 +8,7 @@"files": [{"path": "registry/remocn/ripple-zoom/index.tsx",- "content": "\"use client\";\n\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport { ShaderGrainGradient } from \"@/components/remocn/shader-grain-gradient\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst DEFAULT_COLORS = [\"#3a3a52\", \"#4a4a68\", \"#8f88ae\"];\n\nexport type RippleZoomProps = {\n colors?: string[];\n colorBack?: string;\n intensity?: number;\n softness?: number;\n noise?: number;\n zoom?: number;\n speed?: number;\n};\n\nconst RippleZoomPresentation: React.FC<\n TransitionPresentationComponentProps<RippleZoomProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n colors = DEFAULT_COLORS,\n colorBack = \"#141318\",\n intensity = 0.5,\n softness = 0.5,\n noise = 0.5,\n zoom = 4,\n speed = 1,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n if (!entering) {\n const exitStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.35, 0.55], [1, 0], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n }),\n transform: `scale(${interpolate(p, [0.3, 0.62], [1, 1.6], {\n ...clampOpts,\n easing: Easing.in(Easing.cubic),\n })})`,\n };\n return <AbsoluteFill style={exitStyle}>{children}</AbsoluteFill>;\n }\n\n const fieldOpacity = interpolate(p, [0.08, 0.32], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n const fieldScale = interpolate(p, [0.32, 1], [0.2, zoom], {\n ...clampOpts,\n easing: Easing.bezier(0.7, 0, 0.3, 1),\n });\n\n const childStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.45, 0.62], [0, 1], clampOpts),\n transform: `scale(${interpolate(p, [0.42, 0.97], [0.2, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.33, 1, 0.68, 1),\n })})`,\n filter: `blur(${interpolate(p, [0.42, 0.8], [8, 0], clampOpts)}px)`,\n };\n\n return (\n <AbsoluteFill>\n <AbsoluteFill style={{ opacity: fieldOpacity, pointerEvents: \"none\" }}>\n <ShaderGrainGradient\n speed={speed}\n shape=\"ripple\"\n colors={colors}\n colorBack={colorBack}\n intensity={intensity}\n softness={softness}\n noise={noise}\n scale={fieldScale}\n />\n </AbsoluteFill>\n <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>\n </AbsoluteFill>\n );\n};\n\nexport function rippleZoom(\n props: RippleZoomProps = {},\n): TransitionPresentation<RippleZoomProps> {\n return {\n component: RippleZoomPresentation,\n props,\n };\n}\n",+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport { ShaderGrainGradient } from \"@/components/remocn/shader-grain-gradient\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst DEFAULT_COLORS = [\"#3a3a52\", \"#4a4a68\", \"#8f88ae\"];\n\nexport type RippleZoomProps = {\n colors?: string[];\n colorBack?: string;\n intensity?: number;\n softness?: number;\n noise?: number;\n zoom?: number;\n speed?: number;\n};\n\nconst RippleZoomPresentation: React.FC<\n TransitionPresentationComponentProps<RippleZoomProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n colors = DEFAULT_COLORS,\n colorBack = \"#141318\",\n intensity = 0.5,\n softness = 0.5,\n noise = 0.5,\n zoom = 4,\n speed = 1,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n if (!entering) {\n const exitStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.35, 0.55], [1, 0], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n }),\n transform: `scale(${interpolate(p, [0.3, 0.62], [1, 1.6], {\n ...clampOpts,\n easing: Easing.in(Easing.cubic),\n })})`,\n };\n return <AbsoluteFill style={exitStyle}>{children}</AbsoluteFill>;\n }\n\n const fieldOpacity = interpolate(p, [0.08, 0.32], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n const fieldScale = interpolate(p, [0.32, 1], [0.2, zoom], {\n ...clampOpts,\n easing: Easing.bezier(0.7, 0, 0.3, 1),\n });\n\n const childStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.45, 0.62], [0, 1], clampOpts),\n transform: `scale(${interpolate(p, [0.42, 0.97], [0.2, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.33, 1, 0.68, 1),\n })})`,\n filter: `blur(${interpolate(p, [0.42, 0.8], [8, 0], clampOpts)}px)`,\n };\n\n return (\n <AbsoluteFill>\n <AbsoluteFill style={{ opacity: fieldOpacity, pointerEvents: \"none\" }}>\n <ShaderGrainGradient\n speed={speed}\n shape=\"ripple\"\n colors={colors}\n colorBack={colorBack}\n intensity={intensity}\n softness={softness}\n noise={noise}\n scale={fieldScale}\n />\n </AbsoluteFill>\n <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>\n </AbsoluteFill>\n );\n};\n\nexport function rippleZoom(\n props: RippleZoomProps = {},\n): TransitionPresentation<RippleZoomProps> {\n return {\n component: RippleZoomPresentation,\n props,\n };\n}\n","type": "registry:component","target": "components/remocn/ripple-zoom.tsx"}diff --git a/public/r/rolling-number.json b/public/r/rolling-number.jsonindex 3bc4efa5..28e8f42d 100644--- a/public/r/rolling-number.json+++ b/public/r/rolling-number.json@@ -7,7 +7,7 @@"files": [{"path": "registry/remocn/rolling-number/index.tsx",- "content": "\"use client\";\n\nimport type React from \"react\";\nimport { loadFont as loadMono } from \"@remotion/google-fonts/JetBrainsMono\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nconst { fontFamily: MONO_FAMILY } = loadMono();\n\nexport interface RollingNumberProps {\n from?: number;\n to?: number;\n fontSize?: number;\n color?: string;\n speed?: number;\n}\n\nconst COUNT_PORTION = 0.8;\nconst COUNT_EASING = Easing.out(Easing.poly(4));\nconst REVEAL_BAND = 0.4;\nconst REVEAL_EASING = Easing.inOut(Easing.sin);\nconst REVEAL_RISE_EM = 0.32;\n\nfunction easedProgress(\n frame: number,\n speed: number,\n durationInFrames: number,\n): number {\n return interpolate(\n frame * speed,\n [0, durationInFrames * COUNT_PORTION],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: COUNT_EASING,\n },\n );\n}\n\nfunction placeTravel(start: number, end: number, place: number): number {\n const pow = 10 ** place;\n const up = end >= start;\n const diff = Math.abs(end - start);\n const startDigit = Math.floor(start / pow) % 10;\n const finalDigit = Math.floor(end / pow) % 10;\n const fullTurns = Math.floor(diff / (pow * 10));\n const stepDelta = up\n ? (finalDigit - startDigit + 10) % 10\n : (startDigit - finalDigit + 10) % 10;\n const magnitude = fullTurns * 10 + stepDelta;\n return up ? magnitude : -magnitude;\n}\n\nfunction placeReveal(current: number, place: number): number {\n if (place === 0) return 1;\n const threshold = 10 ** place;\n return interpolate(current, [threshold * REVEAL_BAND, threshold], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: REVEAL_EASING,\n });\n}\n\nfunction wrap10(value: number): number {\n return ((value % 10) + 10) % 10;\n}\n\nfunction DigitColumn({\n value,\n fontSize,\n reveal,\n}: {\n value: number;\n fontSize: number;\n reveal: number;\n}) {\n const cellHeight = fontSize * 1.1;\n return (\n <span\n style={{\n display: \"inline-block\",\n overflow: \"hidden\",\n height: cellHeight,\n width: \"0.62em\",\n verticalAlign: \"top\",\n textAlign: \"center\",\n opacity: reveal,\n transform: `translateY(${(1 - reveal) * fontSize * REVEAL_RISE_EM}px)`,\n }}\n >\n <span\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n transform: `translateY(${-value * cellHeight}px)`,\n }}\n >\n {[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0].map((d, i) => (\n <span\n key={i}\n style={{ height: cellHeight, lineHeight: `${cellHeight}px` }}\n >\n {d}\n </span>\n ))}\n </span>\n </span>\n );\n}\n\nexport function RollingNumber({\n from = 0,\n to = 24813,\n fontSize = 120,\n color = \"#171717\",\n speed = 1,\n}: RollingNumberProps) {\n const frame = useCurrentFrame();\n const { durationInFrames } = useVideoConfig();\n\n const start = Math.max(0, Math.round(from));\n const end = Math.max(0, Math.round(to));\n\n const e = easedProgress(frame, speed, durationInFrames);\n const current = start + e * (end - start);\n\n const maxVal = Math.max(start, end);\n const digits = String(maxVal);\n const cellHeight = fontSize * 1.1;\n\n const cells: React.ReactNode[] = [];\n for (let place = 0; place < digits.length; place++) {\n if (place > 0 && place % 3 === 0) {\n cells.unshift(\n <span\n key={`s${place}`}\n style={{\n display: \"inline-block\",\n width: \"0.34em\",\n height: cellHeight,\n }}\n />,\n );\n }\n const pow = 10 ** place;\n const startDigit = Math.floor(start / pow) % 10;\n const travel = placeTravel(start, end, place);\n const pos = startDigit + e * travel;\n cells.unshift(\n <DigitColumn\n key={`d${place}`}\n value={wrap10(pos)}\n fontSize={fontSize}\n reveal={placeReveal(current, place)}\n />,\n );\n }\n\n return (\n <AbsoluteFill\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-start\",\n fontSize,\n fontWeight: 800,\n color,\n fontFamily: MONO_FAMILY,\n fontVariantNumeric: \"tabular-nums\",\n letterSpacing: \"-0.03em\",\n lineHeight: 1,\n }}\n >\n {cells}\n </div>\n </AbsoluteFill>\n );\n}\n",+ "content": "\"use client\";\n\nimport { loadFont as loadMono } from \"@remotion/google-fonts/JetBrainsMono\";\nimport type React from \"react\";\nimport {\n AbsoluteFill,\n Easing,\n interpolate,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nconst { fontFamily: MONO_FAMILY } = loadMono();\n\nexport interface RollingNumberProps {\n from?: number;\n to?: number;\n fontSize?: number;\n color?: string;\n speed?: number;\n}\n\nconst COUNT_PORTION = 0.8;\nconst COUNT_EASING = Easing.out(Easing.poly(4));\nconst REVEAL_BAND = 0.4;\nconst REVEAL_EASING = Easing.inOut(Easing.sin);\nconst REVEAL_RISE_EM = 0.32;\n\nfunction easedProgress(\n frame: number,\n speed: number,\n durationInFrames: number,\n): number {\n return interpolate(\n frame * speed,\n [0, durationInFrames * COUNT_PORTION],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: COUNT_EASING,\n },\n );\n}\n\nfunction placeTravel(start: number, end: number, place: number): number {\n const pow = 10 ** place;\n const up = end >= start;\n const diff = Math.abs(end - start);\n const startDigit = Math.floor(start / pow) % 10;\n const finalDigit = Math.floor(end / pow) % 10;\n const fullTurns = Math.floor(diff / (pow * 10));\n const stepDelta = up\n ? (finalDigit - startDigit + 10) % 10\n : (startDigit - finalDigit + 10) % 10;\n const magnitude = fullTurns * 10 + stepDelta;\n return up ? magnitude : -magnitude;\n}\n\nfunction placeReveal(current: number, place: number): number {\n if (place === 0) return 1;\n const threshold = 10 ** place;\n return interpolate(current, [threshold * REVEAL_BAND, threshold], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: REVEAL_EASING,\n });\n}\n\nfunction wrap10(value: number): number {\n return ((value % 10) + 10) % 10;\n}\n\nfunction DigitColumn({\n value,\n fontSize,\n reveal,\n}: {\n value: number;\n fontSize: number;\n reveal: number;\n}) {\n const cellHeight = fontSize * 1.1;\n return (\n <span\n style={{\n display: \"inline-block\",\n overflow: \"hidden\",\n height: cellHeight,\n width: \"0.62em\",\n verticalAlign: \"top\",\n textAlign: \"center\",\n opacity: reveal,\n transform: `translateY(${(1 - reveal) * fontSize * REVEAL_RISE_EM}px)`,\n }}\n >\n <span\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n transform: `translateY(${-value * cellHeight}px)`,\n }}\n >\n {[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0].map((d, i) => (\n <span\n key={i}\n style={{ height: cellHeight, lineHeight: `${cellHeight}px` }}\n >\n {d}\n </span>\n ))}\n </span>\n </span>\n );\n}\n\nexport function RollingNumber({\n from = 0,\n to = 24813,\n fontSize = 120,\n color = \"#171717\",\n speed = 1,\n}: RollingNumberProps) {\n const frame = useCurrentFrame();\n const { durationInFrames } = useVideoConfig();\n\n const start = Math.max(0, Math.round(from));\n const end = Math.max(0, Math.round(to));\n\n const e = easedProgress(frame, speed, durationInFrames);\n const current = start + e * (end - start);\n\n const maxVal = Math.max(start, end);\n const digits = String(maxVal);\n const cellHeight = fontSize * 1.1;\n\n const cells: React.ReactNode[] = [];\n for (let place = 0; place < digits.length; place++) {\n if (place > 0 && place % 3 === 0) {\n cells.unshift(\n <span\n key={`s${place}`}\n style={{\n display: \"inline-block\",\n width: \"0.34em\",\n height: cellHeight,\n }}\n />,\n );\n }\n const pow = 10 ** place;\n const startDigit = Math.floor(start / pow) % 10;\n const travel = placeTravel(start, end, place);\n const pos = startDigit + e * travel;\n cells.unshift(\n <DigitColumn\n key={`d${place}`}\n value={wrap10(pos)}\n fontSize={fontSize}\n reveal={placeReveal(current, place)}\n />,\n );\n }\n\n return (\n <AbsoluteFill\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-start\",\n fontSize,\n fontWeight: 800,\n color,\n fontFamily: MONO_FAMILY,\n fontVariantNumeric: \"tabular-nums\",\n letterSpacing: \"-0.03em\",\n lineHeight: 1,\n }}\n >\n {cells}\n </div>\n </AbsoluteFill>\n );\n}\n","type": "registry:component","target": "components/remocn/rolling-number.tsx"}diff --git a/public/r/scale-down-fade.json b/public/r/scale-down-fade.jsonindex 35f5cc1f..835e7bf7 100644--- a/public/r/scale-down-fade.json+++ b/public/r/scale-down-fade.json@@ -7,7 +7,7 @@"files": [{"path": "registry/remocn/scale-down-fade/index.tsx",- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface ScaleDownFadeProps {\n text: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function ScaleDownFade({\n text,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: ScaleDownFadeProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const enterDurFrames = 16;\n const exitDurFrames = 11;\n const exitStart = Math.max(enterDurFrames, durationInFrames - exitDurFrames);\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterP = interpolate(frame, [0, enterDurFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(frame, [exitStart, durationInFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(frame, [0, enterDurFrames], [8, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const yExit = interpolate(frame, [exitStart, durationInFrames], [0, -8], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const y = yEnter + yExit;\n\n const scaleEnter = interpolate(frame, [0, enterDurFrames], [1.04, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const scaleExitDelta = interpolate(\n frame,\n [exitStart, durationInFrames],\n [0, -0.06],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n }\n );\n\n const scale = scaleEnter + scaleExitDelta;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity,\n transform: `translateY(${y}px) scale(${scale})`,\n }}\n >\n {text}\n </span>\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface ScaleDownFadeProps {\n text: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function ScaleDownFade({\n text,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: ScaleDownFadeProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const enterDurFrames = 16;\n const exitDurFrames = 11;\n const exitStart = Math.max(enterDurFrames, durationInFrames - exitDurFrames);\n\n const enterEasing = Easing.bezier(0.22, 1, 0.36, 1);\n const exitEasing = Easing.bezier(0.64, 0, 0.78, 0);\n\n const enterP = interpolate(frame, [0, enterDurFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const exitP = interpolate(frame, [exitStart, durationInFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const opacity = enterP * (1 - exitP);\n\n const yEnter = interpolate(frame, [0, enterDurFrames], [8, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const yExit = interpolate(frame, [exitStart, durationInFrames], [0, -8], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n });\n\n const y = yEnter + yExit;\n\n const scaleEnter = interpolate(frame, [0, enterDurFrames], [1.04, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: enterEasing,\n });\n\n const scaleExitDelta = interpolate(\n frame,\n [exitStart, durationInFrames],\n [0, -0.06],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: exitEasing,\n },\n );\n\n const scale = scaleEnter + scaleExitDelta;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n display: \"inline-block\",\n transformOrigin: \"50% 50%\",\n opacity,\n transform: `translateY(${y}px) scale(${scale})`,\n }}\n >\n {text}\n </span>\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/scale-down-fade.tsx"}diff --git a/public/r/select-item.json b/public/r/select-item.jsonindex 7d8aea5c..7ecfbc50 100644--- a/public/r/select-item.json+++ b/public/r/select-item.json@@ -14,7 +14,7 @@},{"path": "registry/remocn-ui/select-item/use-select-item-transition.ts",- "content": "\"use client\";\n\nimport {\n easings,\n mixOklch,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\nimport {\n selectItemStyle,\n selectItemStyleContext,\n type SelectItemState,\n type SelectItemStyle,\n} from \"@/components/remocn/select-item\";\n\nexport const DEFAULT_DURATION = 8;\n\nexport function tweenSelectItemStyle(\n a: SelectItemStyle,\n b: SelectItemStyle,\n t: number,\n): SelectItemStyle {\n return {\n background: mixOklch(a.background, b.background, t),\n labelColor: mixOklch(a.labelColor, b.labelColor, t),\n checkOpacity: a.checkOpacity + (b.checkOpacity - a.checkOpacity) * t,\n scale: a.scale + (b.scale - a.scale) * t,\n };\n}\n\nexport interface SelectItemTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useSelectItemTransition(\n steps: Step<SelectItemState>[],\n opts: SelectItemTransitionOptions = {},\n): SelectItemStyle {\n const { theme: themeOverride, mode, speed = 1, defaultDuration = DEFAULT_DURATION } =\n opts;\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = selectItemStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"idle\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenSelectItemStyle(\n selectItemStyle(from, ctx),\n selectItemStyle(to, ctx),\n t,\n );\n}\n",+ "content": "\"use client\";\n\nimport {\n type SelectItemState,\n type SelectItemStyle,\n selectItemStyle,\n selectItemStyleContext,\n} from \"@/components/remocn/select-item\";\nimport {\n easings,\n mixOklch,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\n\nexport const DEFAULT_DURATION = 8;\n\nexport function tweenSelectItemStyle(\n a: SelectItemStyle,\n b: SelectItemStyle,\n t: number,\n): SelectItemStyle {\n return {\n background: mixOklch(a.background, b.background, t),\n labelColor: mixOklch(a.labelColor, b.labelColor, t),\n checkOpacity: a.checkOpacity + (b.checkOpacity - a.checkOpacity) * t,\n scale: a.scale + (b.scale - a.scale) * t,\n };\n}\n\nexport interface SelectItemTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useSelectItemTransition(\n steps: Step<SelectItemState>[],\n opts: SelectItemTransitionOptions = {},\n): SelectItemStyle {\n const {\n theme: themeOverride,\n mode,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = selectItemStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"idle\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenSelectItemStyle(\n selectItemStyle(from, ctx),\n selectItemStyle(to, ctx),\n t,\n );\n}\n","type": "registry:component","target": "components/remocn/use-select-item-transition.ts"}diff --git a/public/r/select.json b/public/r/select.jsonindex 4b033bdf..194c7b1b 100644--- a/public/r/select.json+++ b/public/r/select.json@@ -12,13 +12,13 @@"files": [{"path": "registry/remocn-ui/select/index.tsx",- "content": "\"use client\";\n\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\nimport {\n buttonStyle,\n buttonStyleContext,\n type ButtonStyle,\n type ButtonStyleContext,\n} from \"@/components/remocn/button\";\nimport {\n SelectItemRow,\n selectItemStyle,\n selectItemStyleContext,\n type SelectItemState,\n type SelectItemStyle,\n type SelectItemStyleContext,\n} from \"@/components/remocn/select-item\";\n\nexport type SelectState = \"opened\" | \"closed\";\n\nexport interface SelectProps {\n state?: SelectState;\n style?: SelectStyle;\n label?: string;\n triggerStyle?: ButtonStyle;\n items?: string[];\n selectedIndex?: number;\n highlightedIndex?: number;\n pressedIndex?: number;\n itemStyles?: (SelectItemStyle | undefined)[];\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nconst WIDTH = 260;\n\nexport interface SelectStyle {\n panelOpacity: number;\n panelScale: number;\n panelTranslateY: number;\n chevronRotation: number;\n}\n\nexport interface SelectStyleContext {\n triggerCtx: ButtonStyleContext;\n panelBg: string;\n panelBorder: string;\n triggerFg: string;\n mutedFg: string;\n radius: number;\n itemCtx: SelectItemStyleContext;\n}\n\nexport function selectStyleContext(theme: RemocnTheme): SelectStyleContext {\n return {\n triggerCtx: buttonStyleContext(\"outline\", theme),\n panelBg: theme.popover,\n panelBorder: theme.border,\n triggerFg: theme.foreground,\n mutedFg: theme.mutedForeground,\n radius: theme.radius,\n itemCtx: selectItemStyleContext(theme),\n };\n}\n\nexport function selectStyle(\n state: SelectState,\n _ctx: SelectStyleContext,\n): SelectStyle {\n switch (state) {\n case \"opened\":\n return {\n panelOpacity: 1,\n panelScale: 1,\n panelTranslateY: 0,\n chevronRotation: 180,\n };\n default:\n return {\n panelOpacity: 0,\n panelScale: 0.96,\n panelTranslateY: -4,\n chevronRotation: 0,\n };\n }\n}\n\nfunction rowState(\n i: number,\n selectedIndex: number,\n highlightedIndex: number,\n pressedIndex: number,\n): SelectItemState {\n if (i === pressedIndex) return \"press\";\n if (i === selectedIndex) return \"selected\";\n if (i === highlightedIndex) return \"hover\";\n return \"idle\";\n}\n\nexport function Select({\n state = \"closed\",\n style,\n label = \"Select a fruit\",\n triggerStyle,\n items = [\"Apple\", \"Banana\", \"Orange\", \"Grape\"],\n selectedIndex = -1,\n highlightedIndex = -1,\n pressedIndex = -1,\n itemStyles,\n theme: themeOverride,\n className,\n}: SelectProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const ctx = selectStyleContext(theme);\n const v = style ?? selectStyle(state, ctx);\n\n const trigger: ButtonStyle =\n triggerStyle ?? buttonStyle(\"idle\", ctx.triggerCtx);\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div style={{ position: \"relative\", width: WIDTH }}>\n {}\n <div\n style={{\n width: WIDTH,\n boxSizing: \"border-box\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n gap: 8,\n height: 40,\n padding: \"0 16px\",\n fontSize: 15,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n color: ctx.triggerFg,\n transform: `translateY(${trigger.translateY}px) scale(${trigger.scale})`,\n background: trigger.background,\n border: `1px solid ${ctx.panelBorder}`,\n borderRadius: ctx.radius,\n }}\n >\n <span>{label}</span>\n <svg\n width={16}\n height={16}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n style={{\n flexShrink: 0,\n transform: `rotate(${v.chevronRotation}deg)`,\n }}\n >\n <path\n d=\"M6 9l6 6 6-6\"\n stroke={ctx.mutedFg}\n strokeWidth=\"2.2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n {}\n <div\n style={{\n position: \"absolute\",\n top: \"calc(100% + 6px)\",\n left: 0,\n width: WIDTH,\n boxSizing: \"border-box\",\n transformOrigin: \"top\",\n transform: `translateY(${v.panelTranslateY}px) scale(${v.panelScale})`,\n opacity: v.panelOpacity,\n background: ctx.panelBg,\n border: `1px solid ${ctx.panelBorder}`,\n borderRadius: ctx.radius,\n padding: 4,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 2,\n boxShadow: \"0 16px 32px -12px rgba(0,0,0,0.25)\",\n }}\n >\n {items.map((item, i) => {\n const override = itemStyles?.[i];\n return (\n <SelectItemRow\n key={item}\n style={\n override ??\n selectItemStyle(\n rowState(i, selectedIndex, highlightedIndex, pressedIndex),\n ctx.itemCtx,\n )\n }\n ctx={ctx.itemCtx}\n label={item}\n width={WIDTH - 8}\n radius={theme.radius}\n check={ctx.itemCtx.check}\n />\n );\n })}\n </div>\n </div>\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport {\n type ButtonStyle,\n type ButtonStyleContext,\n buttonStyle,\n buttonStyleContext,\n} from \"@/components/remocn/button\";\nimport {\n SelectItemRow,\n type SelectItemState,\n type SelectItemStyle,\n type SelectItemStyleContext,\n selectItemStyle,\n selectItemStyleContext,\n} from \"@/components/remocn/select-item\";\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type SelectState = \"opened\" | \"closed\";\n\nexport interface SelectProps {\n state?: SelectState;\n style?: SelectStyle;\n label?: string;\n triggerStyle?: ButtonStyle;\n items?: string[];\n selectedIndex?: number;\n highlightedIndex?: number;\n pressedIndex?: number;\n itemStyles?: (SelectItemStyle | undefined)[];\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nconst WIDTH = 260;\n\nexport interface SelectStyle {\n panelOpacity: number;\n panelScale: number;\n panelTranslateY: number;\n chevronRotation: number;\n}\n\nexport interface SelectStyleContext {\n triggerCtx: ButtonStyleContext;\n panelBg: string;\n panelBorder: string;\n triggerFg: string;\n mutedFg: string;\n radius: number;\n itemCtx: SelectItemStyleContext;\n}\n\nexport function selectStyleContext(theme: RemocnTheme): SelectStyleContext {\n return {\n triggerCtx: buttonStyleContext(\"outline\", theme),\n panelBg: theme.popover,\n panelBorder: theme.border,\n triggerFg: theme.foreground,\n mutedFg: theme.mutedForeground,\n radius: theme.radius,\n itemCtx: selectItemStyleContext(theme),\n };\n}\n\nexport function selectStyle(\n state: SelectState,\n _ctx: SelectStyleContext,\n): SelectStyle {\n switch (state) {\n case \"opened\":\n return {\n panelOpacity: 1,\n panelScale: 1,\n panelTranslateY: 0,\n chevronRotation: 180,\n };\n default:\n return {\n panelOpacity: 0,\n panelScale: 0.96,\n panelTranslateY: -4,\n chevronRotation: 0,\n };\n }\n}\n\nfunction rowState(\n i: number,\n selectedIndex: number,\n highlightedIndex: number,\n pressedIndex: number,\n): SelectItemState {\n if (i === pressedIndex) return \"press\";\n if (i === selectedIndex) return \"selected\";\n if (i === highlightedIndex) return \"hover\";\n return \"idle\";\n}\n\nexport function Select({\n state = \"closed\",\n style,\n label = \"Select a fruit\",\n triggerStyle,\n items = [\"Apple\", \"Banana\", \"Orange\", \"Grape\"],\n selectedIndex = -1,\n highlightedIndex = -1,\n pressedIndex = -1,\n itemStyles,\n theme: themeOverride,\n className,\n}: SelectProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const ctx = selectStyleContext(theme);\n const v = style ?? selectStyle(state, ctx);\n\n const trigger: ButtonStyle =\n triggerStyle ?? buttonStyle(\"idle\", ctx.triggerCtx);\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div style={{ position: \"relative\", width: WIDTH }}>\n {}\n <div\n style={{\n width: WIDTH,\n boxSizing: \"border-box\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n gap: 8,\n height: 40,\n padding: \"0 16px\",\n fontSize: 15,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n color: ctx.triggerFg,\n transform: `translateY(${trigger.translateY}px) scale(${trigger.scale})`,\n background: trigger.background,\n border: `1px solid ${ctx.panelBorder}`,\n borderRadius: ctx.radius,\n }}\n >\n <span>{label}</span>\n <svg\n width={16}\n height={16}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n style={{\n flexShrink: 0,\n transform: `rotate(${v.chevronRotation}deg)`,\n }}\n >\n <path\n d=\"M6 9l6 6 6-6\"\n stroke={ctx.mutedFg}\n strokeWidth=\"2.2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n {}\n <div\n style={{\n position: \"absolute\",\n top: \"calc(100% + 6px)\",\n left: 0,\n width: WIDTH,\n boxSizing: \"border-box\",\n transformOrigin: \"top\",\n transform: `translateY(${v.panelTranslateY}px) scale(${v.panelScale})`,\n opacity: v.panelOpacity,\n background: ctx.panelBg,\n border: `1px solid ${ctx.panelBorder}`,\n borderRadius: ctx.radius,\n padding: 4,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 2,\n boxShadow: \"0 16px 32px -12px rgba(0,0,0,0.25)\",\n }}\n >\n {items.map((item, i) => {\n const override = itemStyles?.[i];\n return (\n <SelectItemRow\n key={item}\n style={\n override ??\n selectItemStyle(\n rowState(i, selectedIndex, highlightedIndex, pressedIndex),\n ctx.itemCtx,\n )\n }\n ctx={ctx.itemCtx}\n label={item}\n width={WIDTH - 8}\n radius={theme.radius}\n check={ctx.itemCtx.check}\n />\n );\n })}\n </div>\n </div>\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/select.tsx"},{"path": "registry/remocn-ui/select/use-select-transition.ts",- "content": "\"use client\";\n\nimport {\n easings,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\nimport {\n selectStyle,\n selectStyleContext,\n type SelectState,\n type SelectStyle,\n} from \"@/components/remocn/select\";\n\nexport const DEFAULT_DURATION = 12;\n\nexport function tweenSelectStyle(\n a: SelectStyle,\n b: SelectStyle,\n t: number,\n): SelectStyle {\n return {\n panelOpacity: a.panelOpacity + (b.panelOpacity - a.panelOpacity) * t,\n panelScale: a.panelScale + (b.panelScale - a.panelScale) * t,\n panelTranslateY:\n a.panelTranslateY + (b.panelTranslateY - a.panelTranslateY) * t,\n chevronRotation:\n a.chevronRotation + (b.chevronRotation - a.chevronRotation) * t,\n };\n}\n\nexport interface SelectTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useSelectTransition(\n steps: Step<SelectState>[],\n opts: SelectTransitionOptions = {},\n): SelectStyle {\n const { theme: themeOverride, mode, speed = 1, defaultDuration = DEFAULT_DURATION } =\n opts;\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = selectStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"closed\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenSelectStyle(selectStyle(from, ctx), selectStyle(to, ctx), t);\n}\n",+ "content": "\"use client\";\n\nimport {\n type SelectState,\n type SelectStyle,\n selectStyle,\n selectStyleContext,\n} from \"@/components/remocn/select\";\nimport {\n easings,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\n\nexport const DEFAULT_DURATION = 12;\n\nexport function tweenSelectStyle(\n a: SelectStyle,\n b: SelectStyle,\n t: number,\n): SelectStyle {\n return {\n panelOpacity: a.panelOpacity + (b.panelOpacity - a.panelOpacity) * t,\n panelScale: a.panelScale + (b.panelScale - a.panelScale) * t,\n panelTranslateY:\n a.panelTranslateY + (b.panelTranslateY - a.panelTranslateY) * t,\n chevronRotation:\n a.chevronRotation + (b.chevronRotation - a.chevronRotation) * t,\n };\n}\n\nexport interface SelectTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useSelectTransition(\n steps: Step<SelectState>[],\n opts: SelectTransitionOptions = {},\n): SelectStyle {\n const {\n theme: themeOverride,\n mode,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = selectStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"closed\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenSelectStyle(selectStyle(from, ctx), selectStyle(to, ctx), t);\n}\n","type": "registry:component","target": "components/remocn/use-select-transition.ts"}diff --git a/public/r/settings-toggle-flow.json b/public/r/settings-toggle-flow.jsonindex 8e19ec5a..8ede8962 100644--- a/public/r/settings-toggle-flow.json+++ b/public/r/settings-toggle-flow.json@@ -17,7 +17,7 @@"files": [{"path": "registry/remocn-ui/settings-toggle-flow/index.tsx",- "content": "\"use client\";\n\nimport { Button } from \"@/components/remocn/button\";\nimport { useButtonTransition } from \"@/components/remocn/use-button-transition\";\nimport { Cursor } from \"@/components/remocn/cursor\";\nimport { useCursorPath } from \"@/components/remocn/use-cursor-path\";\nimport { Select } from \"@/components/remocn/select\";\nimport { useSelectTransition } from \"@/components/remocn/use-select-transition\";\nimport { useSelectItemTransition } from \"@/components/remocn/use-select-item-transition\";\nimport { Slider } from \"@/components/remocn/slider\";\nimport { useSliderTransition } from \"@/components/remocn/use-slider-transition\";\nimport { Switch } from \"@/components/remocn/switch\";\nimport { useSwitchTransition } from \"@/components/remocn/use-switch-transition\";\nimport { Toast } from \"@/components/remocn/toast\";\nimport { useToastTransition } from \"@/components/remocn/use-toast-transition\";\nimport { useBlurInTransition } from \"@/components/remocn/use-blur-in-transition\";\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nconst DEFAULT_ROWS = [\n { label: \"Notifications\" },\n { label: \"Theme\" },\n { label: \"Volume\" },\n];\nconst DEFAULT_SELECT_ITEMS = [\"System\", \"Light\", \"Dark\"];\n\nconst LEFT_X = 320;\nconst RIGHT_X = 700;\nconst COL_W = 300;\n\nconst NOTIF_LABEL_Y = 196;\nconst SWITCH_TOP = 222;\nconst SWITCH_W = 44;\nconst SWITCH_H = 28;\nconst SWITCH_CX = RIGHT_X + SWITCH_W / 2;\nconst SWITCH_CY = SWITCH_TOP + SWITCH_H / 2;\n\nconst THEME_LABEL_Y = 280;\nconst SELECT_W = 260;\nconst TRIGGER_TOP = 320;\nconst TRIGGER_H = 40;\nconst TRIGGER_CX = RIGHT_X + SELECT_W / 2;\nconst TRIGGER_CY = TRIGGER_TOP + TRIGGER_H / 2;\nconst ITEM_CX = TRIGGER_CX;\nconst PANEL_TOP = TRIGGER_TOP + TRIGGER_H + 6;\nconst PANEL_PAD = 4;\nconst ITEM_H = 33;\nconst ITEM_GAP = 2;\n\nconst VOL_LABEL_Y = 380;\nconst SLIDER_TOP = 400;\nconst SLIDER_W = 260;\nconst SLIDER_H = 16;\nconst SLIDER_CY = SLIDER_TOP + SLIDER_H / 2;\nconst SLIDER_X0 = RIGHT_X;\nconst THUMB_X_AT_20 = SLIDER_X0 + 0.2 * SLIDER_W;\nconst THUMB_X_AT_80 = SLIDER_X0 + 0.8 * SLIDER_W;\n\nconst SAVE_W = 160;\nconst SAVE_LEFT = RIGHT_X + SELECT_W - SAVE_W;\nconst SAVE_TOP = 544;\nconst SAVE_H = 40;\nconst SAVE_CX = SAVE_LEFT + SAVE_W / 2;\nconst SAVE_CY = SAVE_TOP + SAVE_H / 2;\n\nconst CARD_PAD = 44;\nconst CARD_LEFT = LEFT_X - CARD_PAD;\nconst CARD_TOP = NOTIF_LABEL_Y - CARD_PAD;\nconst CARD_W = RIGHT_X + SELECT_W + CARD_PAD - CARD_LEFT;\nconst CARD_H = SAVE_TOP + SAVE_H + CARD_PAD - CARD_TOP;\n\nconst DEMO = 44;\n\nexport interface SettingsToggleFlowProps {\n title?: string;\n description?: string;\n rows?: { label: string }[];\n selectItems?: string[];\n saveLabel?: string;\n toastTitle?: string;\n theme?: Partial<RemocnTheme>;\n}\n\nexport function SettingsToggleFlow({\n title = \"Notification settings\",\n description = \"Manage how you receive alerts, set your theme, and tune the volume.\",\n rows = DEFAULT_ROWS,\n selectItems = DEFAULT_SELECT_ITEMS,\n saveLabel = \"Save settings\",\n toastTitle = \"Settings saved\",\n theme,\n}: SettingsToggleFlowProps) {\n const resolved = useRemocnTheme(theme);\n const opts = { theme };\n\n const lastItem = selectItems.length - 1;\n const ITEM_CY =\n PANEL_TOP + PANEL_PAD + lastItem * (ITEM_H + ITEM_GAP) + ITEM_H / 2;\n\n const cardEnter = useBlurInTransition(\n [{ at: 0, state: \"revealed\", duration: 18 }],\n { distance: 0 },\n );\n const enterHeader = useBlurInTransition([\n { at: 18, state: \"revealed\", duration: 16 },\n ]);\n const enterSwitch = useBlurInTransition([\n { at: 24, state: \"revealed\", duration: 16 },\n ]);\n const enterTheme = useBlurInTransition([\n { at: 30, state: \"revealed\", duration: 16 },\n ]);\n const enterVolume = useBlurInTransition([\n { at: 36, state: \"revealed\", duration: 16 },\n ]);\n const enterSave = useBlurInTransition([\n { at: 42, state: \"revealed\", duration: 16 },\n ]);\n\n const reveal = (e: { opacity: number; blur: number; translateX: number; translateY: number }) => ({\n opacity: e.opacity,\n filter: e.blur > 0 ? `blur(${e.blur}px)` : \"none\",\n transform: `translate(${e.translateX}px, ${e.translateY}px)`,\n });\n\n const cursorStyle = useCursorPath([\n { at: 0, x: 220, y: 130 },\n { at: 24 + DEMO, x: SWITCH_CX, y: SWITCH_CY, duration: 20 },\n { at: 24 + DEMO, x: SWITCH_CX, y: SWITCH_CY, click: true, duration: 0 },\n { at: 55 + DEMO, x: TRIGGER_CX, y: TRIGGER_CY, duration: 22 },\n { at: 55 + DEMO, x: TRIGGER_CX, y: TRIGGER_CY, click: true, duration: 0 },\n { at: 80 + DEMO, x: ITEM_CX, y: ITEM_CY, duration: 18 },\n { at: 80 + DEMO, x: ITEM_CX, y: ITEM_CY, click: true, duration: 0 },\n { at: 105 + DEMO, x: THUMB_X_AT_20, y: SLIDER_CY, duration: 18 },\n { at: 105 + DEMO, x: THUMB_X_AT_20, y: SLIDER_CY, press: true, duration: 0 },\n { at: 150 + DEMO, x: THUMB_X_AT_80, y: SLIDER_CY, press: true, duration: 45 },\n { at: 158 + DEMO, x: THUMB_X_AT_80, y: SLIDER_CY, duration: 0 },\n { at: 180 + DEMO, x: SAVE_CX, y: SAVE_CY, duration: 18 },\n { at: 180 + DEMO, x: SAVE_CX, y: SAVE_CY, click: true, duration: 0 },\n ]);\n\n const switchStyle = useSwitchTransition(\n [{ at: 24 + DEMO, state: \"checked\", duration: 12 }],\n opts,\n );\n\n const panelStyle = useSelectTransition(\n [\n { at: 55 + DEMO, state: \"opened\", duration: 14 },\n { at: 90 + DEMO, state: \"closed\", duration: 12 },\n ],\n opts,\n );\n\n const triggerStyle = useButtonTransition(\n [\n { at: 45 + DEMO, state: \"hover\", duration: 8 },\n { at: 55 + DEMO, state: \"press\", duration: 8 },\n ],\n { variant: \"outline\", ...opts },\n );\n\n const itemStyle = useSelectItemTransition(\n [\n { at: 68 + DEMO, state: \"hover\", duration: 8 },\n { at: 78 + DEMO, state: \"press\", duration: 6 },\n { at: 80 + DEMO, state: \"selected\", duration: 10 },\n ],\n opts,\n );\n\n const sliderStyle = useSliderTransition([\n { at: 0, value: 20, thumbState: \"idle\" },\n { at: 105 + DEMO, thumbState: \"press\", duration: 6 },\n { at: 105 + DEMO, value: 20 },\n { at: 150 + DEMO, value: 80, duration: 45, easing: \"inOut\" },\n { at: 158 + DEMO, thumbState: \"idle\", duration: 8 },\n ]);\n\n const saveStyle = useButtonTransition(\n [\n { at: 172 + DEMO, state: \"hover\", duration: 8 },\n { at: 180 + DEMO, state: \"press\", duration: 6 },\n { at: 188 + DEMO, state: \"success\", duration: 14 },\n ],\n opts,\n );\n\n const toastStyle = useToastTransition(\n [\n { at: 196 + DEMO, state: \"visible\", duration: 12 },\n { at: 256 + DEMO, state: \"hidden\", duration: 12 },\n ],\n {},\n );\n\n const rowLabelStyle = {\n fontSize: 14,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n color: resolved.foreground,\n } as const;\n\n return (\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {}\n <div\n style={{\n position: \"absolute\",\n left: CARD_LEFT,\n top: CARD_TOP,\n width: CARD_W,\n height: CARD_H,\n boxSizing: \"border-box\",\n background: resolved.background,\n border: `1px solid ${resolved.border}`,\n borderRadius: 16,\n boxShadow:\n \"0 10px 30px -12px rgba(0,0,0,0.22), 0 2px 8px -3px rgba(0,0,0,0.10)\",\n opacity: cardEnter.opacity,\n filter: cardEnter.blur > 0 ? `blur(${cardEnter.blur}px)` : \"none\",\n }}\n />\n\n {}\n <div\n style={{\n position: \"absolute\",\n left: LEFT_X,\n top: NOTIF_LABEL_Y,\n width: COL_W,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 10,\n ...reveal(enterHeader),\n }}\n >\n <div\n style={{\n fontSize: 22,\n lineHeight: \"28px\",\n fontWeight: 600,\n letterSpacing: \"-0.02em\",\n color: resolved.foreground,\n }}\n >\n {title}\n </div>\n <div\n style={{\n fontSize: 14,\n lineHeight: \"22px\",\n color: resolved.mutedForeground,\n }}\n >\n {description}\n </div>\n </div>\n\n {}\n <div\n style={{\n position: \"absolute\",\n left: RIGHT_X,\n top: NOTIF_LABEL_Y,\n ...rowLabelStyle,\n ...reveal(enterSwitch),\n }}\n >\n {rows[0]?.label ?? \"Notifications\"}\n </div>\n <div\n style={{\n position: \"absolute\",\n left: RIGHT_X,\n top: SWITCH_TOP,\n width: SWITCH_W,\n height: SWITCH_H,\n ...reveal(enterSwitch),\n }}\n >\n <Switch style={switchStyle} theme={theme} />\n </div>\n\n {}\n <div\n style={{\n position: \"absolute\",\n left: RIGHT_X,\n top: VOL_LABEL_Y,\n ...rowLabelStyle,\n ...reveal(enterVolume),\n }}\n >\n {rows[2]?.label ?? \"Volume\"}\n </div>\n <div\n style={{\n position: \"absolute\",\n left: SLIDER_X0,\n top: SLIDER_TOP,\n ...reveal(enterVolume),\n }}\n >\n <Slider style={sliderStyle} width={SLIDER_W} theme={theme} />\n </div>\n\n {}\n <div\n style={{\n position: \"absolute\",\n left: RIGHT_X,\n top: THEME_LABEL_Y,\n ...rowLabelStyle,\n ...reveal(enterTheme),\n }}\n >\n {rows[1]?.label ?? \"Theme\"}\n </div>\n <div\n style={{\n position: \"absolute\",\n left: RIGHT_X,\n top: TRIGGER_TOP,\n width: SELECT_W,\n height: TRIGGER_H,\n ...reveal(enterTheme),\n }}\n >\n <Select\n style={panelStyle}\n label={selectItems[0] ?? \"System\"}\n items={selectItems}\n triggerStyle={triggerStyle}\n itemStyles={selectItems.map((_, i) =>\n i === selectItems.length - 1 ? itemStyle : undefined,\n )}\n theme={theme}\n />\n </div>\n\n {}\n <div\n style={{\n position: \"absolute\",\n left: SAVE_LEFT,\n top: SAVE_TOP,\n width: SAVE_W,\n height: SAVE_H,\n ...reveal(enterSave),\n }}\n >\n <Button label={saveLabel} style={saveStyle} theme={theme} />\n </div>\n\n {}\n <div style={{ position: \"absolute\", right: 24, bottom: 24 }}>\n <Toast\n style={toastStyle}\n title={toastTitle}\n variant=\"success\"\n theme={theme}\n />\n </div>\n\n <Cursor style={cursorStyle} variant=\"pointer\" theme={theme} />\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport { Button } from \"@/components/remocn/button\";\nimport { Cursor } from \"@/components/remocn/cursor\";\nimport { Select } from \"@/components/remocn/select\";\nimport { Slider } from \"@/components/remocn/slider\";\nimport { Switch } from \"@/components/remocn/switch\";\nimport { Toast } from \"@/components/remocn/toast\";\nimport { useBlurInTransition } from \"@/components/remocn/use-blur-in-transition\";\nimport { useButtonTransition } from \"@/components/remocn/use-button-transition\";\nimport { useCursorPath } from \"@/components/remocn/use-cursor-path\";\nimport { useSelectItemTransition } from \"@/components/remocn/use-select-item-transition\";\nimport { useSelectTransition } from \"@/components/remocn/use-select-transition\";\nimport { useSliderTransition } from \"@/components/remocn/use-slider-transition\";\nimport { useSwitchTransition } from \"@/components/remocn/use-switch-transition\";\nimport { useToastTransition } from \"@/components/remocn/use-toast-transition\";\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nconst DEFAULT_ROWS = [\n { label: \"Notifications\" },\n { label: \"Theme\" },\n { label: \"Volume\" },\n];\nconst DEFAULT_SELECT_ITEMS = [\"System\", \"Light\", \"Dark\"];\n\nconst LEFT_X = 320;\nconst RIGHT_X = 700;\nconst COL_W = 300;\n\nconst NOTIF_LABEL_Y = 196;\nconst SWITCH_TOP = 222;\nconst SWITCH_W = 44;\nconst SWITCH_H = 28;\nconst SWITCH_CX = RIGHT_X + SWITCH_W / 2;\nconst SWITCH_CY = SWITCH_TOP + SWITCH_H / 2;\n\nconst THEME_LABEL_Y = 280;\nconst SELECT_W = 260;\nconst TRIGGER_TOP = 320;\nconst TRIGGER_H = 40;\nconst TRIGGER_CX = RIGHT_X + SELECT_W / 2;\nconst TRIGGER_CY = TRIGGER_TOP + TRIGGER_H / 2;\nconst ITEM_CX = TRIGGER_CX;\nconst PANEL_TOP = TRIGGER_TOP + TRIGGER_H + 6;\nconst PANEL_PAD = 4;\nconst ITEM_H = 33;\nconst ITEM_GAP = 2;\n\nconst VOL_LABEL_Y = 380;\nconst SLIDER_TOP = 400;\nconst SLIDER_W = 260;\nconst SLIDER_H = 16;\nconst SLIDER_CY = SLIDER_TOP + SLIDER_H / 2;\nconst SLIDER_X0 = RIGHT_X;\nconst THUMB_X_AT_20 = SLIDER_X0 + 0.2 * SLIDER_W;\nconst THUMB_X_AT_80 = SLIDER_X0 + 0.8 * SLIDER_W;\n\nconst SAVE_W = 160;\nconst SAVE_LEFT = RIGHT_X + SELECT_W - SAVE_W;\nconst SAVE_TOP = 544;\nconst SAVE_H = 40;\nconst SAVE_CX = SAVE_LEFT + SAVE_W / 2;\nconst SAVE_CY = SAVE_TOP + SAVE_H / 2;\n\nconst CARD_PAD = 44;\nconst CARD_LEFT = LEFT_X - CARD_PAD;\nconst CARD_TOP = NOTIF_LABEL_Y - CARD_PAD;\nconst CARD_W = RIGHT_X + SELECT_W + CARD_PAD - CARD_LEFT;\nconst CARD_H = SAVE_TOP + SAVE_H + CARD_PAD - CARD_TOP;\n\nconst DEMO = 44;\n\nexport interface SettingsToggleFlowProps {\n title?: string;\n description?: string;\n rows?: { label: string }[];\n selectItems?: string[];\n saveLabel?: string;\n toastTitle?: string;\n theme?: Partial<RemocnTheme>;\n}\n\nexport function SettingsToggleFlow({\n title = \"Notification settings\",\n description = \"Manage how you receive alerts, set your theme, and tune the volume.\",\n rows = DEFAULT_ROWS,\n selectItems = DEFAULT_SELECT_ITEMS,\n saveLabel = \"Save settings\",\n toastTitle = \"Settings saved\",\n theme,\n}: SettingsToggleFlowProps) {\n const resolved = useRemocnTheme(theme);\n const opts = { theme };\n\n const lastItem = selectItems.length - 1;\n const ITEM_CY =\n PANEL_TOP + PANEL_PAD + lastItem * (ITEM_H + ITEM_GAP) + ITEM_H / 2;\n\n const cardEnter = useBlurInTransition(\n [{ at: 0, state: \"revealed\", duration: 18 }],\n { distance: 0 },\n );\n const enterHeader = useBlurInTransition([\n { at: 18, state: \"revealed\", duration: 16 },\n ]);\n const enterSwitch = useBlurInTransition([\n { at: 24, state: \"revealed\", duration: 16 },\n ]);\n const enterTheme = useBlurInTransition([\n { at: 30, state: \"revealed\", duration: 16 },\n ]);\n const enterVolume = useBlurInTransition([\n { at: 36, state: \"revealed\", duration: 16 },\n ]);\n const enterSave = useBlurInTransition([\n { at: 42, state: \"revealed\", duration: 16 },\n ]);\n\n const reveal = (e: {\n opacity: number;\n blur: number;\n translateX: number;\n translateY: number;\n }) => ({\n opacity: e.opacity,\n filter: e.blur > 0 ? `blur(${e.blur}px)` : \"none\",\n transform: `translate(${e.translateX}px, ${e.translateY}px)`,\n });\n\n const cursorStyle = useCursorPath([\n { at: 0, x: 220, y: 130 },\n { at: 24 + DEMO, x: SWITCH_CX, y: SWITCH_CY, duration: 20 },\n { at: 24 + DEMO, x: SWITCH_CX, y: SWITCH_CY, click: true, duration: 0 },\n { at: 55 + DEMO, x: TRIGGER_CX, y: TRIGGER_CY, duration: 22 },\n { at: 55 + DEMO, x: TRIGGER_CX, y: TRIGGER_CY, click: true, duration: 0 },\n { at: 80 + DEMO, x: ITEM_CX, y: ITEM_CY, duration: 18 },\n { at: 80 + DEMO, x: ITEM_CX, y: ITEM_CY, click: true, duration: 0 },\n { at: 105 + DEMO, x: THUMB_X_AT_20, y: SLIDER_CY, duration: 18 },\n {\n at: 105 + DEMO,\n x: THUMB_X_AT_20,\n y: SLIDER_CY,\n press: true,\n duration: 0,\n },\n {\n at: 150 + DEMO,\n x: THUMB_X_AT_80,\n y: SLIDER_CY,\n press: true,\n duration: 45,\n },\n { at: 158 + DEMO, x: THUMB_X_AT_80, y: SLIDER_CY, duration: 0 },\n { at: 180 + DEMO, x: SAVE_CX, y: SAVE_CY, duration: 18 },\n { at: 180 + DEMO, x: SAVE_CX, y: SAVE_CY, click: true, duration: 0 },\n ]);\n\n const switchStyle = useSwitchTransition(\n [{ at: 24 + DEMO, state: \"checked\", duration: 12 }],\n opts,\n );\n\n const panelStyle = useSelectTransition(\n [\n { at: 55 + DEMO, state: \"opened\", duration: 14 },\n { at: 90 + DEMO, state: \"closed\", duration: 12 },\n ],\n opts,\n );\n\n const triggerStyle = useButtonTransition(\n [\n { at: 45 + DEMO, state: \"hover\", duration: 8 },\n { at: 55 + DEMO, state: \"press\", duration: 8 },\n ],\n { variant: \"outline\", ...opts },\n );\n\n const itemStyle = useSelectItemTransition(\n [\n { at: 68 + DEMO, state: \"hover\", duration: 8 },\n { at: 78 + DEMO, state: \"press\", duration: 6 },\n { at: 80 + DEMO, state: \"selected\", duration: 10 },\n ],\n opts,\n );\n\n const sliderStyle = useSliderTransition([\n { at: 0, value: 20, thumbState: \"idle\" },\n { at: 105 + DEMO, thumbState: \"press\", duration: 6 },\n { at: 105 + DEMO, value: 20 },\n { at: 150 + DEMO, value: 80, duration: 45, easing: \"inOut\" },\n { at: 158 + DEMO, thumbState: \"idle\", duration: 8 },\n ]);\n\n const saveStyle = useButtonTransition(\n [\n { at: 172 + DEMO, state: \"hover\", duration: 8 },\n { at: 180 + DEMO, state: \"press\", duration: 6 },\n { at: 188 + DEMO, state: \"success\", duration: 14 },\n ],\n opts,\n );\n\n const toastStyle = useToastTransition(\n [\n { at: 196 + DEMO, state: \"visible\", duration: 12 },\n { at: 256 + DEMO, state: \"hidden\", duration: 12 },\n ],\n {},\n );\n\n const rowLabelStyle = {\n fontSize: 14,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n color: resolved.foreground,\n } as const;\n\n return (\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {}\n <div\n style={{\n position: \"absolute\",\n left: CARD_LEFT,\n top: CARD_TOP,\n width: CARD_W,\n height: CARD_H,\n boxSizing: \"border-box\",\n background: resolved.background,\n border: `1px solid ${resolved.border}`,\n borderRadius: 16,\n boxShadow:\n \"0 10px 30px -12px rgba(0,0,0,0.22), 0 2px 8px -3px rgba(0,0,0,0.10)\",\n opacity: cardEnter.opacity,\n filter: cardEnter.blur > 0 ? `blur(${cardEnter.blur}px)` : \"none\",\n }}\n />\n\n {}\n <div\n style={{\n position: \"absolute\",\n left: LEFT_X,\n top: NOTIF_LABEL_Y,\n width: COL_W,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 10,\n ...reveal(enterHeader),\n }}\n >\n <div\n style={{\n fontSize: 22,\n lineHeight: \"28px\",\n fontWeight: 600,\n letterSpacing: \"-0.02em\",\n color: resolved.foreground,\n }}\n >\n {title}\n </div>\n <div\n style={{\n fontSize: 14,\n lineHeight: \"22px\",\n color: resolved.mutedForeground,\n }}\n >\n {description}\n </div>\n </div>\n\n {}\n <div\n style={{\n position: \"absolute\",\n left: RIGHT_X,\n top: NOTIF_LABEL_Y,\n ...rowLabelStyle,\n ...reveal(enterSwitch),\n }}\n >\n {rows[0]?.label ?? \"Notifications\"}\n </div>\n <div\n style={{\n position: \"absolute\",\n left: RIGHT_X,\n top: SWITCH_TOP,\n width: SWITCH_W,\n height: SWITCH_H,\n ...reveal(enterSwitch),\n }}\n >\n <Switch style={switchStyle} theme={theme} />\n </div>\n\n {}\n <div\n style={{\n position: \"absolute\",\n left: RIGHT_X,\n top: VOL_LABEL_Y,\n ...rowLabelStyle,\n ...reveal(enterVolume),\n }}\n >\n {rows[2]?.label ?? \"Volume\"}\n </div>\n <div\n style={{\n position: \"absolute\",\n left: SLIDER_X0,\n top: SLIDER_TOP,\n ...reveal(enterVolume),\n }}\n >\n <Slider style={sliderStyle} width={SLIDER_W} theme={theme} />\n </div>\n\n {}\n <div\n style={{\n position: \"absolute\",\n left: RIGHT_X,\n top: THEME_LABEL_Y,\n ...rowLabelStyle,\n ...reveal(enterTheme),\n }}\n >\n {rows[1]?.label ?? \"Theme\"}\n </div>\n <div\n style={{\n position: \"absolute\",\n left: RIGHT_X,\n top: TRIGGER_TOP,\n width: SELECT_W,\n height: TRIGGER_H,\n ...reveal(enterTheme),\n }}\n >\n <Select\n style={panelStyle}\n label={selectItems[0] ?? \"System\"}\n items={selectItems}\n triggerStyle={triggerStyle}\n itemStyles={selectItems.map((_, i) =>\n i === selectItems.length - 1 ? itemStyle : undefined,\n )}\n theme={theme}\n />\n </div>\n\n {}\n <div\n style={{\n position: \"absolute\",\n left: SAVE_LEFT,\n top: SAVE_TOP,\n width: SAVE_W,\n height: SAVE_H,\n ...reveal(enterSave),\n }}\n >\n <Button label={saveLabel} style={saveStyle} theme={theme} />\n </div>\n\n {}\n <div style={{ position: \"absolute\", right: 24, bottom: 24 }}>\n <Toast\n style={toastStyle}\n title={toastTitle}\n variant=\"success\"\n theme={theme}\n />\n </div>\n\n <Cursor style={cursorStyle} variant=\"pointer\" theme={theme} />\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/settings-toggle-flow.tsx"}diff --git a/public/r/sheet.json b/public/r/sheet.jsonindex 11cebac1..82a7ab6e 100644--- a/public/r/sheet.json+++ b/public/r/sheet.json@@ -14,7 +14,7 @@},{"path": "registry/remocn-ui/sheet/use-sheet-transition.ts",- "content": "\"use client\";\n\nimport {\n easings,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\nimport {\n sheetStyle,\n sheetStyleContext,\n type SheetState,\n type SheetStyle,\n} from \"@/components/remocn/sheet\";\n\nexport const DEFAULT_DURATION = 12;\n\nexport function tweenSheetStyle(\n a: SheetStyle,\n b: SheetStyle,\n t: number,\n): SheetStyle {\n return {\n overlayOpacity: a.overlayOpacity + (b.overlayOpacity - a.overlayOpacity) * t,\n panelOpacity: a.panelOpacity + (b.panelOpacity - a.panelOpacity) * t,\n panelTranslateX:\n a.panelTranslateX + (b.panelTranslateX - a.panelTranslateX) * t,\n };\n}\n\nexport interface SheetTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useSheetTransition(\n steps: Step<SheetState>[],\n opts: SheetTransitionOptions = {},\n): SheetStyle {\n const {\n theme: themeOverride,\n mode,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = sheetStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"closed\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenSheetStyle(sheetStyle(from, ctx), sheetStyle(to, ctx), t);\n}\n",+ "content": "\"use client\";\n\nimport {\n type SheetState,\n type SheetStyle,\n sheetStyle,\n sheetStyleContext,\n} from \"@/components/remocn/sheet\";\nimport {\n easings,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\n\nexport const DEFAULT_DURATION = 12;\n\nexport function tweenSheetStyle(\n a: SheetStyle,\n b: SheetStyle,\n t: number,\n): SheetStyle {\n return {\n overlayOpacity:\n a.overlayOpacity + (b.overlayOpacity - a.overlayOpacity) * t,\n panelOpacity: a.panelOpacity + (b.panelOpacity - a.panelOpacity) * t,\n panelTranslateX:\n a.panelTranslateX + (b.panelTranslateX - a.panelTranslateX) * t,\n };\n}\n\nexport interface SheetTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useSheetTransition(\n steps: Step<SheetState>[],\n opts: SheetTransitionOptions = {},\n): SheetStyle {\n const {\n theme: themeOverride,\n mode,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = sheetStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"closed\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenSheetStyle(sheetStyle(from, ctx), sheetStyle(to, ctx), t);\n}\n","type": "registry:component","target": "components/remocn/use-sheet-transition.ts"}diff --git a/public/r/short-slide-right.json b/public/r/short-slide-right.jsonindex 80da5a63..fefde439 100644--- a/public/r/short-slide-right.json+++ b/public/r/short-slide-right.json@@ -7,7 +7,7 @@"files": [{"path": "registry/remocn/short-slide-right/index.tsx",- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface ShortSlideRightProps {\n text: string;\n distance?: number;\n staggerDelay?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function ShortSlideRight({\n text,\n distance = 24,\n staggerDelay = 3,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: ShortSlideRightProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.split(\" \");\n\n const enterDur = 16;\n const wordOpacityDur = 6;\n const easing = Easing.bezier(0.2, 0.8, 0.2, 1);\n\n const x = interpolate(frame, [0, enterDur], [-distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\n const blurVal = interpolate(frame, [0, enterDur], [1.2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n display: \"inline-block\",\n transform: `translateX(${x}px)`,\n filter: `blur(${blurVal}px)`,\n }}\n >\n {words.map((word, i) => {\n const opacity = interpolate(\n frame - i * staggerDelay,\n [0, wordOpacityDur],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n }\n );\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface ShortSlideRightProps {\n text: string;\n distance?: number;\n staggerDelay?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function ShortSlideRight({\n text,\n distance = 24,\n staggerDelay = 3,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: ShortSlideRightProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.split(\" \");\n\n const enterDur = 16;\n const wordOpacityDur = 6;\n const easing = Easing.bezier(0.2, 0.8, 0.2, 1);\n\n const x = interpolate(frame, [0, enterDur], [-distance, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\n const blurVal = interpolate(frame, [0, enterDur], [1.2, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n display: \"inline-block\",\n transform: `translateX(${x}px)`,\n filter: `blur(${blurVal}px)`,\n }}\n >\n {words.map((word, i) => {\n const opacity = interpolate(\n frame - i * staggerDelay,\n [0, wordOpacityDur],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n },\n );\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n opacity,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/short-slide-right.tsx"}diff --git a/public/r/signup-flow.json b/public/r/signup-flow.jsonindex 47b682b7..48958cff 100644--- a/public/r/signup-flow.json+++ b/public/r/signup-flow.json@@ -16,7 +16,7 @@"files": [{"path": "registry/remocn-ui/signup-flow/index.tsx",- "content": "\"use client\";\n\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\nimport { Cursor } from \"@/components/remocn/cursor\";\nimport { useCursorPath } from \"@/components/remocn/use-cursor-path\";\nimport { Input } from \"@/components/remocn/input\";\nimport { useInputTransition } from \"@/components/remocn/use-input-transition\";\nimport { Button } from \"@/components/remocn/button\";\nimport { useButtonTransition } from \"@/components/remocn/use-button-transition\";\nimport { Toast } from \"@/components/remocn/toast\";\nimport { useToastTransition } from \"@/components/remocn/use-toast-transition\";\nimport { BlurIn } from \"@/components/remocn/blur-in\";\nimport { useBlurInTransition } from \"@/components/remocn/use-blur-in-transition\";\nimport {\n Field,\n FieldControl,\n FieldDescription,\n FieldGroup,\n FieldLabel,\n} from \"@/components/remocn/field\";\n\nexport interface SignupFlowProps {\n title?: string;\n description?: string;\n fullName?: string;\n email?: string;\n password?: string;\n createLabel?: string;\n googleLabel?: string;\n signinText?: string;\n toastTitle?: string;\n theme?: Partial<RemocnTheme>;\n}\n\nconst STAGE_W = 1280;\nconst CARD_W = 376;\nconst CARD_TOP = 48;\nconst CARD_LEFT = (STAGE_W - CARD_W) / 2;\nconst CENTER_X = STAGE_W / 2;\n\nconst NAME_Y = 216;\nconst EMAIL_Y = 296;\nconst PASS_Y = 398;\nconst CONFIRM_Y = 500;\nconst CREATE_Y = 564;\n\nexport function SignupFlow({\n title = \"Create an account\",\n description = \"Enter your information below to create your account\",\n fullName = \"John Doe\",\n email = \"[email protected]\",\n password = \"••••••••\",\n createLabel = \"Create account\",\n toastTitle = \"Account created\",\n theme,\n}: SignupFlowProps) {\n const resolved = useRemocnTheme(theme);\n const opts = { theme };\n\n const cardEnter = useBlurInTransition(\n [{ at: 0, state: \"revealed\", duration: 18 }],\n { distance: 0 },\n );\n const enterHeader = useBlurInTransition([\n { at: 18, state: \"revealed\", duration: 16 },\n ]);\n const enterName = useBlurInTransition([\n { at: 24, state: \"revealed\", duration: 16 },\n ]);\n const enterEmail = useBlurInTransition([\n { at: 30, state: \"revealed\", duration: 16 },\n ]);\n const enterPass = useBlurInTransition([\n { at: 36, state: \"revealed\", duration: 16 },\n ]);\n const enterConfirm = useBlurInTransition([\n { at: 42, state: \"revealed\", duration: 16 },\n ]);\n const enterButton = useBlurInTransition([\n { at: 48, state: \"revealed\", duration: 16 },\n ]);\n\n const DEMO = 48;\n\n const cursorStyle = useCursorPath([\n { at: 0, x: 160, y: 120 },\n { at: 18 + DEMO, x: CENTER_X, y: NAME_Y, duration: 18, click: true },\n { at: 52 + DEMO, x: CENTER_X, y: EMAIL_Y, duration: 30, click: true },\n { at: 96 + DEMO, x: CENTER_X, y: PASS_Y, duration: 40, click: true },\n { at: 134 + DEMO, x: CENTER_X, y: CONFIRM_Y, duration: 32, click: true },\n { at: 176 + DEMO, x: CENTER_X, y: CREATE_Y, duration: 38, click: true },\n ]);\n\n const nameStyle = useInputTransition(\n [\n { at: 18 + DEMO, state: \"active\", duration: 6 },\n { at: 20 + DEMO, state: \"typing\", duration: 20 },\n { at: 52 + DEMO, state: \"blur\", duration: 8 },\n ],\n opts,\n );\n const emailStyle = useInputTransition(\n [\n { at: 52 + DEMO, state: \"active\", duration: 6 },\n { at: 54 + DEMO, state: \"typing\", duration: 28 },\n { at: 96 + DEMO, state: \"blur\", duration: 8 },\n ],\n opts,\n );\n const passStyle = useInputTransition(\n [\n { at: 96 + DEMO, state: \"active\", duration: 6 },\n { at: 98 + DEMO, state: \"typing\", duration: 22 },\n { at: 134 + DEMO, state: \"blur\", duration: 8 },\n ],\n opts,\n );\n const confirmStyle = useInputTransition(\n [\n { at: 134 + DEMO, state: \"active\", duration: 6 },\n { at: 136 + DEMO, state: \"typing\", duration: 22 },\n { at: 176 + DEMO, state: \"blur\", duration: 8 },\n ],\n opts,\n );\n\n const buttonStyle = useButtonTransition(\n [\n { at: 176 + DEMO, state: \"hover\", duration: 8 },\n { at: 186 + DEMO, state: \"press\", duration: 6 },\n { at: 192 + DEMO, state: \"loading\", duration: 6 },\n { at: 234 + DEMO, state: \"success\", duration: 16 },\n ],\n opts,\n );\n\n const toastStyle = useToastTransition(\n [\n { at: 234 + DEMO, state: \"visible\", duration: 14 },\n { at: 300 + DEMO, state: \"hidden\", duration: 14 },\n ],\n {},\n );\n\n return (\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: CARD_LEFT,\n top: CARD_TOP,\n width: CARD_W,\n height: 580,\n boxSizing: \"border-box\",\n padding: 28,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 24,\n background: resolved.background,\n border: `1px solid ${resolved.border}`,\n borderRadius: 14,\n boxShadow:\n \"0 10px 30px -12px rgba(0,0,0,0.22), 0 2px 8px -3px rgba(0,0,0,0.10)\",\n opacity: cardEnter.opacity,\n filter: cardEnter.blur > 0 ? `blur(${cardEnter.blur}px)` : \"none\",\n }}\n >\n <BlurIn display=\"block\" style={enterHeader}>\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 4 }}>\n <div\n style={{\n fontSize: 22,\n lineHeight: \"28px\",\n fontWeight: 600,\n letterSpacing: \"-0.02em\",\n color: resolved.cardForeground,\n }}\n >\n {title}\n </div>\n <div\n style={{\n fontSize: 14,\n lineHeight: \"20px\",\n color: resolved.mutedForeground,\n }}\n >\n {description}\n </div>\n </div>\n </BlurIn>\n\n <FieldGroup gap={16}>\n <BlurIn display=\"block\" style={enterName}>\n <Field>\n <FieldLabel theme={theme}>\n Full Name\n </FieldLabel>\n <FieldControl>\n <Input\n placeholder={fullName}\n value={fullName}\n style={nameStyle}\n theme={theme}\n />\n </FieldControl>\n </Field>\n </BlurIn>\n\n <BlurIn display=\"block\" style={enterEmail}>\n <Field>\n <FieldLabel theme={theme}>\n Email\n </FieldLabel>\n <FieldControl>\n <Input\n placeholder={email}\n value={email}\n style={emailStyle}\n theme={theme}\n />\n </FieldControl>\n <FieldDescription theme={theme}>\n We'll use this to contact you.\n </FieldDescription>\n </Field>\n </BlurIn>\n\n <BlurIn display=\"block\" style={enterPass}>\n <Field>\n <FieldLabel theme={theme}>\n Password\n </FieldLabel>\n <FieldControl>\n <Input\n placeholder={password}\n value={password}\n style={passStyle}\n theme={theme}\n />\n </FieldControl>\n <FieldDescription theme={theme}>\n Must be at least 8 characters long.\n </FieldDescription>\n </Field>\n </BlurIn>\n\n <BlurIn display=\"block\" style={enterConfirm}>\n <Field>\n <FieldLabel theme={theme}>\n Confirm Password\n </FieldLabel>\n <FieldControl>\n <Input\n placeholder={password}\n value={password}\n style={confirmStyle}\n theme={theme}\n />\n </FieldControl>\n </Field>\n </BlurIn>\n </FieldGroup>\n\n <BlurIn display=\"block\" style={enterButton}>\n <Field gap={10}>\n <FieldControl>\n <Button\n label={createLabel}\n style={buttonStyle}\n theme={theme}\n />\n </FieldControl>\n </Field>\n </BlurIn>\n </div>\n\n <div style={{ position: \"absolute\", right: 32, bottom: 32 }}>\n <Toast\n title={toastTitle}\n variant=\"success\"\n style={toastStyle}\n theme={theme}\n />\n </div>\n\n <Cursor style={cursorStyle} variant=\"pointer\" theme={theme} />\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport { BlurIn } from \"@/components/remocn/blur-in\";\nimport { Button } from \"@/components/remocn/button\";\nimport { Cursor } from \"@/components/remocn/cursor\";\nimport {\n Field,\n FieldControl,\n FieldDescription,\n FieldGroup,\n FieldLabel,\n} from \"@/components/remocn/field\";\nimport { Input } from \"@/components/remocn/input\";\nimport { Toast } from \"@/components/remocn/toast\";\nimport { useBlurInTransition } from \"@/components/remocn/use-blur-in-transition\";\nimport { useButtonTransition } from \"@/components/remocn/use-button-transition\";\nimport { useCursorPath } from \"@/components/remocn/use-cursor-path\";\nimport { useInputTransition } from \"@/components/remocn/use-input-transition\";\nimport { useToastTransition } from \"@/components/remocn/use-toast-transition\";\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport interface SignupFlowProps {\n title?: string;\n description?: string;\n fullName?: string;\n email?: string;\n password?: string;\n createLabel?: string;\n googleLabel?: string;\n signinText?: string;\n toastTitle?: string;\n theme?: Partial<RemocnTheme>;\n}\n\nconst STAGE_W = 1280;\nconst CARD_W = 376;\nconst CARD_TOP = 48;\nconst CARD_LEFT = (STAGE_W - CARD_W) / 2;\nconst CENTER_X = STAGE_W / 2;\n\nconst NAME_Y = 216;\nconst EMAIL_Y = 296;\nconst PASS_Y = 398;\nconst CONFIRM_Y = 500;\nconst CREATE_Y = 564;\n\nexport function SignupFlow({\n title = \"Create an account\",\n description = \"Enter your information below to create your account\",\n fullName = \"John Doe\",\n email = \"[email protected]\",\n password = \"••••••••\",\n createLabel = \"Create account\",\n toastTitle = \"Account created\",\n theme,\n}: SignupFlowProps) {\n const resolved = useRemocnTheme(theme);\n const opts = { theme };\n\n const cardEnter = useBlurInTransition(\n [{ at: 0, state: \"revealed\", duration: 18 }],\n { distance: 0 },\n );\n const enterHeader = useBlurInTransition([\n { at: 18, state: \"revealed\", duration: 16 },\n ]);\n const enterName = useBlurInTransition([\n { at: 24, state: \"revealed\", duration: 16 },\n ]);\n const enterEmail = useBlurInTransition([\n { at: 30, state: \"revealed\", duration: 16 },\n ]);\n const enterPass = useBlurInTransition([\n { at: 36, state: \"revealed\", duration: 16 },\n ]);\n const enterConfirm = useBlurInTransition([\n { at: 42, state: \"revealed\", duration: 16 },\n ]);\n const enterButton = useBlurInTransition([\n { at: 48, state: \"revealed\", duration: 16 },\n ]);\n\n const DEMO = 48;\n\n const cursorStyle = useCursorPath([\n { at: 0, x: 160, y: 120 },\n { at: 18 + DEMO, x: CENTER_X, y: NAME_Y, duration: 18, click: true },\n { at: 52 + DEMO, x: CENTER_X, y: EMAIL_Y, duration: 30, click: true },\n { at: 96 + DEMO, x: CENTER_X, y: PASS_Y, duration: 40, click: true },\n { at: 134 + DEMO, x: CENTER_X, y: CONFIRM_Y, duration: 32, click: true },\n { at: 176 + DEMO, x: CENTER_X, y: CREATE_Y, duration: 38, click: true },\n ]);\n\n const nameStyle = useInputTransition(\n [\n { at: 18 + DEMO, state: \"active\", duration: 6 },\n { at: 20 + DEMO, state: \"typing\", duration: 20 },\n { at: 52 + DEMO, state: \"blur\", duration: 8 },\n ],\n opts,\n );\n const emailStyle = useInputTransition(\n [\n { at: 52 + DEMO, state: \"active\", duration: 6 },\n { at: 54 + DEMO, state: \"typing\", duration: 28 },\n { at: 96 + DEMO, state: \"blur\", duration: 8 },\n ],\n opts,\n );\n const passStyle = useInputTransition(\n [\n { at: 96 + DEMO, state: \"active\", duration: 6 },\n { at: 98 + DEMO, state: \"typing\", duration: 22 },\n { at: 134 + DEMO, state: \"blur\", duration: 8 },\n ],\n opts,\n );\n const confirmStyle = useInputTransition(\n [\n { at: 134 + DEMO, state: \"active\", duration: 6 },\n { at: 136 + DEMO, state: \"typing\", duration: 22 },\n { at: 176 + DEMO, state: \"blur\", duration: 8 },\n ],\n opts,\n );\n\n const buttonStyle = useButtonTransition(\n [\n { at: 176 + DEMO, state: \"hover\", duration: 8 },\n { at: 186 + DEMO, state: \"press\", duration: 6 },\n { at: 192 + DEMO, state: \"loading\", duration: 6 },\n { at: 234 + DEMO, state: \"success\", duration: 16 },\n ],\n opts,\n );\n\n const toastStyle = useToastTransition(\n [\n { at: 234 + DEMO, state: \"visible\", duration: 14 },\n { at: 300 + DEMO, state: \"hidden\", duration: 14 },\n ],\n {},\n );\n\n return (\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: CARD_LEFT,\n top: CARD_TOP,\n width: CARD_W,\n height: 580,\n boxSizing: \"border-box\",\n padding: 28,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 24,\n background: resolved.background,\n border: `1px solid ${resolved.border}`,\n borderRadius: 14,\n boxShadow:\n \"0 10px 30px -12px rgba(0,0,0,0.22), 0 2px 8px -3px rgba(0,0,0,0.10)\",\n opacity: cardEnter.opacity,\n filter: cardEnter.blur > 0 ? `blur(${cardEnter.blur}px)` : \"none\",\n }}\n >\n <BlurIn display=\"block\" style={enterHeader}>\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 4 }}>\n <div\n style={{\n fontSize: 22,\n lineHeight: \"28px\",\n fontWeight: 600,\n letterSpacing: \"-0.02em\",\n color: resolved.cardForeground,\n }}\n >\n {title}\n </div>\n <div\n style={{\n fontSize: 14,\n lineHeight: \"20px\",\n color: resolved.mutedForeground,\n }}\n >\n {description}\n </div>\n </div>\n </BlurIn>\n\n <FieldGroup gap={16}>\n <BlurIn display=\"block\" style={enterName}>\n <Field>\n <FieldLabel theme={theme}>Full Name</FieldLabel>\n <FieldControl>\n <Input\n placeholder={fullName}\n value={fullName}\n style={nameStyle}\n theme={theme}\n />\n </FieldControl>\n </Field>\n </BlurIn>\n\n <BlurIn display=\"block\" style={enterEmail}>\n <Field>\n <FieldLabel theme={theme}>Email</FieldLabel>\n <FieldControl>\n <Input\n placeholder={email}\n value={email}\n style={emailStyle}\n theme={theme}\n />\n </FieldControl>\n <FieldDescription theme={theme}>\n We'll use this to contact you.\n </FieldDescription>\n </Field>\n </BlurIn>\n\n <BlurIn display=\"block\" style={enterPass}>\n <Field>\n <FieldLabel theme={theme}>Password</FieldLabel>\n <FieldControl>\n <Input\n placeholder={password}\n value={password}\n style={passStyle}\n theme={theme}\n />\n </FieldControl>\n <FieldDescription theme={theme}>\n Must be at least 8 characters long.\n </FieldDescription>\n </Field>\n </BlurIn>\n\n <BlurIn display=\"block\" style={enterConfirm}>\n <Field>\n <FieldLabel theme={theme}>Confirm Password</FieldLabel>\n <FieldControl>\n <Input\n placeholder={password}\n value={password}\n style={confirmStyle}\n theme={theme}\n />\n </FieldControl>\n </Field>\n </BlurIn>\n </FieldGroup>\n\n <BlurIn display=\"block\" style={enterButton}>\n <Field gap={10}>\n <FieldControl>\n <Button label={createLabel} style={buttonStyle} theme={theme} />\n </FieldControl>\n </Field>\n </BlurIn>\n </div>\n\n <div style={{ position: \"absolute\", right: 32, bottom: 32 }}>\n <Toast\n title={toastTitle}\n variant=\"success\"\n style={toastStyle}\n theme={theme}\n />\n </div>\n\n <Cursor style={cursorStyle} variant=\"pointer\" theme={theme} />\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/signup-flow.tsx"}diff --git a/public/r/skeleton.json b/public/r/skeleton.jsonindex cc6c5843..9b8b6663 100644--- a/public/r/skeleton.json+++ b/public/r/skeleton.json@@ -8,13 +8,13 @@"files": [{"path": "registry/remocn-ui/skeleton/index.tsx",- "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\nimport { SkeletonBlock } from \"@/components/remocn/skeleton-block\";\n\nexport type SkeletonState = \"loading\" | \"loaded\";\n\nexport type SkeletonLayout = \"lines\" | \"card\";\n\nexport interface SkeletonProps {\n state?: SkeletonState;\n style?: SkeletonStyle;\n children?: ReactNode;\n placeholder?: ReactNode;\n layout?: SkeletonLayout;\n speed?: number;\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nexport interface SkeletonStyle {\n skeletonOpacity: number;\n contentOpacity: number;\n}\n\nexport function skeletonStyle(state: SkeletonState): SkeletonStyle {\n switch (state) {\n case \"loaded\":\n return { skeletonOpacity: 0, contentOpacity: 1 };\n default:\n return { skeletonOpacity: 1, contentOpacity: 0 };\n }\n}\n\nfunction LayoutPlaceholder({\n layout,\n speed,\n baseColor,\n}: {\n layout: SkeletonLayout;\n speed?: number;\n baseColor: string;\n}) {\n const shimmer = { speed, baseColor };\n if (layout === \"card\") {\n return (\n <div style={{ display: \"flex\", gap: 14, alignItems: \"center\" }}>\n {}\n <SkeletonBlock\n width={48}\n height={48}\n radius={24}\n flexShrink={0}\n {...shimmer}\n />\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 10 }}>\n <SkeletonBlock width={180} height={14} {...shimmer} />\n <SkeletonBlock width={120} height={14} {...shimmer} />\n </div>\n </div>\n );\n }\n return (\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 10 }}>\n <SkeletonBlock width={260} height={14} {...shimmer} />\n <SkeletonBlock width={240} height={14} {...shimmer} />\n <SkeletonBlock width={160} height={14} {...shimmer} />\n </div>\n );\n}\n\nexport function Skeleton({\n state = \"loading\",\n style,\n children,\n placeholder,\n layout = \"lines\",\n speed,\n theme: themeOverride,\n className,\n}: SkeletonProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const v = style ?? skeletonStyle(state);\n\n const placeholderLayer = placeholder ?? (\n <LayoutPlaceholder layout={layout} speed={speed} baseColor={theme.muted} />\n );\n\n return (\n <div\n className={className}\n style={{\n position: \"relative\",\n display: \"inline-block\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {}\n <div style={{ opacity: v.contentOpacity }}>{children}</div>\n {}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n opacity: v.skeletonOpacity,\n pointerEvents: \"none\",\n }}\n >\n {placeholderLayer}\n </div>\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { SkeletonBlock } from \"@/components/remocn/skeleton-block\";\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type SkeletonState = \"loading\" | \"loaded\";\n\nexport type SkeletonLayout = \"lines\" | \"card\";\n\nexport interface SkeletonProps {\n state?: SkeletonState;\n style?: SkeletonStyle;\n children?: ReactNode;\n placeholder?: ReactNode;\n layout?: SkeletonLayout;\n speed?: number;\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nexport interface SkeletonStyle {\n skeletonOpacity: number;\n contentOpacity: number;\n}\n\nexport function skeletonStyle(state: SkeletonState): SkeletonStyle {\n switch (state) {\n case \"loaded\":\n return { skeletonOpacity: 0, contentOpacity: 1 };\n default:\n return { skeletonOpacity: 1, contentOpacity: 0 };\n }\n}\n\nfunction LayoutPlaceholder({\n layout,\n speed,\n baseColor,\n}: {\n layout: SkeletonLayout;\n speed?: number;\n baseColor: string;\n}) {\n const shimmer = { speed, baseColor };\n if (layout === \"card\") {\n return (\n <div style={{ display: \"flex\", gap: 14, alignItems: \"center\" }}>\n {}\n <SkeletonBlock\n width={48}\n height={48}\n radius={24}\n flexShrink={0}\n {...shimmer}\n />\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 10 }}>\n <SkeletonBlock width={180} height={14} {...shimmer} />\n <SkeletonBlock width={120} height={14} {...shimmer} />\n </div>\n </div>\n );\n }\n return (\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 10 }}>\n <SkeletonBlock width={260} height={14} {...shimmer} />\n <SkeletonBlock width={240} height={14} {...shimmer} />\n <SkeletonBlock width={160} height={14} {...shimmer} />\n </div>\n );\n}\n\nexport function Skeleton({\n state = \"loading\",\n style,\n children,\n placeholder,\n layout = \"lines\",\n speed,\n theme: themeOverride,\n className,\n}: SkeletonProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const v = style ?? skeletonStyle(state);\n\n const placeholderLayer = placeholder ?? (\n <LayoutPlaceholder layout={layout} speed={speed} baseColor={theme.muted} />\n );\n\n return (\n <div\n className={className}\n style={{\n position: \"relative\",\n display: \"inline-block\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {}\n <div style={{ opacity: v.contentOpacity }}>{children}</div>\n {}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n opacity: v.skeletonOpacity,\n pointerEvents: \"none\",\n }}\n >\n {placeholderLayer}\n </div>\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/skeleton.tsx"},{"path": "registry/remocn-ui/skeleton/use-skeleton-transition.ts",- "content": "\"use client\";\n\nimport {\n easings,\n type Step,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\nimport {\n skeletonStyle,\n type SkeletonState,\n type SkeletonStyle,\n} from \"@/components/remocn/skeleton\";\n\nexport const DEFAULT_DURATION = 12;\n\nexport function tweenSkeletonStyle(\n a: SkeletonStyle,\n b: SkeletonStyle,\n t: number,\n): SkeletonStyle {\n return {\n skeletonOpacity:\n a.skeletonOpacity + (b.skeletonOpacity - a.skeletonOpacity) * t,\n contentOpacity:\n a.contentOpacity + (b.contentOpacity - a.contentOpacity) * t,\n };\n}\n\nexport interface SkeletonTransitionOptions {\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useSkeletonTransition(\n steps: Step<SkeletonState>[],\n opts: SkeletonTransitionOptions = {},\n): SkeletonStyle {\n const { speed = 1, defaultDuration = DEFAULT_DURATION } = opts;\n const { from, to, progress } = useStateTransition(\n steps,\n \"loading\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenSkeletonStyle(skeletonStyle(from), skeletonStyle(to), t);\n}\n",+ "content": "\"use client\";\n\nimport {\n type SkeletonState,\n type SkeletonStyle,\n skeletonStyle,\n} from \"@/components/remocn/skeleton\";\nimport { easings, type Step, useStateTransition } from \"@/lib/remocn-ui\";\n\nexport const DEFAULT_DURATION = 12;\n\nexport function tweenSkeletonStyle(\n a: SkeletonStyle,\n b: SkeletonStyle,\n t: number,\n): SkeletonStyle {\n return {\n skeletonOpacity:\n a.skeletonOpacity + (b.skeletonOpacity - a.skeletonOpacity) * t,\n contentOpacity:\n a.contentOpacity + (b.contentOpacity - a.contentOpacity) * t,\n };\n}\n\nexport interface SkeletonTransitionOptions {\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useSkeletonTransition(\n steps: Step<SkeletonState>[],\n opts: SkeletonTransitionOptions = {},\n): SkeletonStyle {\n const { speed = 1, defaultDuration = DEFAULT_DURATION } = opts;\n const { from, to, progress } = useStateTransition(\n steps,\n \"loading\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenSkeletonStyle(skeletonStyle(from), skeletonStyle(to), t);\n}\n","type": "registry:component","target": "components/remocn/use-skeleton-transition.ts"}diff --git a/public/r/slider.json b/public/r/slider.jsonindex a607b706..7964f0e4 100644--- a/public/r/slider.json+++ b/public/r/slider.json@@ -8,13 +8,13 @@"files": [{"path": "registry/remocn-ui/slider/index.tsx",- "content": "\"use client\";\n\nimport { clamp01, mixOklch, type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type SliderThumbState = \"idle\" | \"hover\" | \"press\";\n\nexport interface SliderStyle {\n value: number;\n thumbScale: number;\n ringOpacity: number;\n}\n\nexport interface SliderProps {\n value?: number;\n thumbState?: SliderThumbState;\n style?: SliderStyle;\n width?: number;\n showValue?: boolean;\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nconst TRACK_HEIGHT = 8;\nconst THUMB_HEIGHT = 16;\nconst THUMB_WIDTH = 24;\nconst THUMB_RADIUS = THUMB_HEIGHT / 2;\nconst RING_WIDTH = 4;\n\nfunction clampValue(value: number): number {\n return clamp01(value / 100) * 100;\n}\n\nexport function sliderThumbStyle(thumbState: SliderThumbState): {\n thumbScale: number;\n ringOpacity: number;\n} {\n switch (thumbState) {\n case \"hover\":\n return { thumbScale: 1.1, ringOpacity: 1 };\n case \"press\":\n return { thumbScale: 1.15, ringOpacity: 1 };\n default:\n return { thumbScale: 1, ringOpacity: 0 };\n }\n}\n\nexport interface SliderStyleContext {\n track: string;\n range: string;\n thumbBg: string;\n thumbRing: string;\n ring: string;\n valueText: string;\n}\n\nexport function sliderStyleContext(theme: RemocnTheme): SliderStyleContext {\n return {\n track: mixOklch(theme.input, theme.background, 0.1),\n range: theme.primary,\n thumbBg: \"oklch(1 0 0)\",\n thumbRing: \"rgba(0, 0, 0, 0.1)\",\n ring: mixOklch(theme.ring, theme.background, 0.7),\n valueText: theme.foreground,\n };\n}\n\nexport function Slider({\n value = 0,\n thumbState = \"idle\",\n style,\n width = 320,\n showValue = false,\n theme: themeOverride,\n className,\n}: SliderProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const ctx = sliderStyleContext(theme);\n\n const thumb = sliderThumbStyle(thumbState);\n const v: SliderStyle = style ?? {\n value,\n thumbScale: thumb.thumbScale,\n ringOpacity: thumb.ringOpacity,\n };\n const pct = clampValue(v.value);\n\n return (\n <div\n className={className}\n style={{\n position: \"relative\",\n display: \"inline-flex\",\n alignItems: \"center\",\n width,\n height: THUMB_HEIGHT,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {}\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: TRACK_HEIGHT,\n borderRadius: TRACK_HEIGHT / 2,\n background: ctx.track,\n }}\n >\n {}\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n bottom: 0,\n width: `${pct}%`,\n borderRadius: TRACK_HEIGHT / 2,\n background: ctx.range,\n }}\n />\n </div>\n {}\n <div\n style={{\n position: \"absolute\",\n left: `${pct}%`,\n top: \"50%\",\n transform: `translate(-50%, -50%) scale(${v.thumbScale})`,\n }}\n >\n {}\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: THUMB_WIDTH + RING_WIDTH * 2,\n height: THUMB_HEIGHT + RING_WIDTH * 2,\n transform: \"translate(-50%, -50%)\",\n borderRadius: THUMB_RADIUS + RING_WIDTH,\n background: ctx.ring,\n opacity: v.ringOpacity,\n }}\n />\n {}\n <div\n style={{\n position: \"relative\",\n width: THUMB_WIDTH,\n height: THUMB_HEIGHT,\n borderRadius: THUMB_RADIUS,\n background: ctx.thumbBg,\n boxShadow: `0 0 0 1px ${ctx.thumbRing}, 0 2px 4px rgba(0,0,0,0.18)`,\n }}\n />\n {showValue && (\n <span\n style={{\n position: \"absolute\",\n left: \"50%\",\n bottom: \"100%\",\n marginBottom: 8,\n transform: \"translateX(-50%)\",\n fontSize: 12,\n fontWeight: 500,\n fontVariantNumeric: \"tabular-nums\",\n color: ctx.valueText,\n }}\n >\n {Math.round(pct)}\n </span>\n )}\n </div>\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport {\n clamp01,\n mixOklch,\n type RemocnTheme,\n useRemocnTheme,\n} from \"@/lib/remocn-ui\";\n\nexport type SliderThumbState = \"idle\" | \"hover\" | \"press\";\n\nexport interface SliderStyle {\n value: number;\n thumbScale: number;\n ringOpacity: number;\n}\n\nexport interface SliderProps {\n value?: number;\n thumbState?: SliderThumbState;\n style?: SliderStyle;\n width?: number;\n showValue?: boolean;\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nconst TRACK_HEIGHT = 8;\nconst THUMB_HEIGHT = 16;\nconst THUMB_WIDTH = 24;\nconst THUMB_RADIUS = THUMB_HEIGHT / 2;\nconst RING_WIDTH = 4;\n\nfunction clampValue(value: number): number {\n return clamp01(value / 100) * 100;\n}\n\nexport function sliderThumbStyle(thumbState: SliderThumbState): {\n thumbScale: number;\n ringOpacity: number;\n} {\n switch (thumbState) {\n case \"hover\":\n return { thumbScale: 1.1, ringOpacity: 1 };\n case \"press\":\n return { thumbScale: 1.15, ringOpacity: 1 };\n default:\n return { thumbScale: 1, ringOpacity: 0 };\n }\n}\n\nexport interface SliderStyleContext {\n track: string;\n range: string;\n thumbBg: string;\n thumbRing: string;\n ring: string;\n valueText: string;\n}\n\nexport function sliderStyleContext(theme: RemocnTheme): SliderStyleContext {\n return {\n track: mixOklch(theme.input, theme.background, 0.1),\n range: theme.primary,\n thumbBg: \"oklch(1 0 0)\",\n thumbRing: \"rgba(0, 0, 0, 0.1)\",\n ring: mixOklch(theme.ring, theme.background, 0.7),\n valueText: theme.foreground,\n };\n}\n\nexport function Slider({\n value = 0,\n thumbState = \"idle\",\n style,\n width = 320,\n showValue = false,\n theme: themeOverride,\n className,\n}: SliderProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const ctx = sliderStyleContext(theme);\n\n const thumb = sliderThumbStyle(thumbState);\n const v: SliderStyle = style ?? {\n value,\n thumbScale: thumb.thumbScale,\n ringOpacity: thumb.ringOpacity,\n };\n const pct = clampValue(v.value);\n\n return (\n <div\n className={className}\n style={{\n position: \"relative\",\n display: \"inline-flex\",\n alignItems: \"center\",\n width,\n height: THUMB_HEIGHT,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {}\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: TRACK_HEIGHT,\n borderRadius: TRACK_HEIGHT / 2,\n background: ctx.track,\n }}\n >\n {}\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n bottom: 0,\n width: `${pct}%`,\n borderRadius: TRACK_HEIGHT / 2,\n background: ctx.range,\n }}\n />\n </div>\n {}\n <div\n style={{\n position: \"absolute\",\n left: `${pct}%`,\n top: \"50%\",\n transform: `translate(-50%, -50%) scale(${v.thumbScale})`,\n }}\n >\n {}\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: THUMB_WIDTH + RING_WIDTH * 2,\n height: THUMB_HEIGHT + RING_WIDTH * 2,\n transform: \"translate(-50%, -50%)\",\n borderRadius: THUMB_RADIUS + RING_WIDTH,\n background: ctx.ring,\n opacity: v.ringOpacity,\n }}\n />\n {}\n <div\n style={{\n position: \"relative\",\n width: THUMB_WIDTH,\n height: THUMB_HEIGHT,\n borderRadius: THUMB_RADIUS,\n background: ctx.thumbBg,\n boxShadow: `0 0 0 1px ${ctx.thumbRing}, 0 2px 4px rgba(0,0,0,0.18)`,\n }}\n />\n {showValue && (\n <span\n style={{\n position: \"absolute\",\n left: \"50%\",\n bottom: \"100%\",\n marginBottom: 8,\n transform: \"translateX(-50%)\",\n fontSize: 12,\n fontWeight: 500,\n fontVariantNumeric: \"tabular-nums\",\n color: ctx.valueText,\n }}\n >\n {Math.round(pct)}\n </span>\n )}\n </div>\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/slider.tsx"},{"path": "registry/remocn-ui/slider/use-slider-transition.ts",- "content": "\"use client\";\n\nimport { useCurrentFrame } from \"remotion\";\nimport { clamp01, type EasingName, easings } from \"@/lib/remocn-ui\";\nimport {\n sliderThumbStyle,\n type SliderStyle,\n type SliderThumbState,\n} from \"@/components/remocn/slider\";\n\nexport interface SliderStep {\n at: number;\n value?: number;\n thumbState?: SliderThumbState;\n duration?: number;\n easing?: EasingName;\n}\n\nexport const DEFAULT_DURATION = 18;\n\nexport interface SliderTransitionOptions {\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function tweenSliderStyle(\n a: SliderStyle,\n b: SliderStyle,\n t: number,\n): SliderStyle {\n return {\n value: a.value + (b.value - a.value) * t,\n thumbScale: a.thumbScale + (b.thumbScale - a.thumbScale) * t,\n ringOpacity: a.ringOpacity + (b.ringOpacity - a.ringOpacity) * t,\n };\n}\n\nexport function useSliderTransition(\n steps: SliderStep[],\n opts: SliderTransitionOptions = {},\n): SliderStyle {\n const { speed = 1 } = opts;\n const raw = useCurrentFrame() * speed;\n return sliderStyleAt(steps, raw, opts);\n}\n\nfunction valueAt(\n steps: SliderStep[],\n raw: number,\n defaultDuration: number,\n): number {\n const valueSteps = steps.filter(\n (s): s is SliderStep & { value: number } => s.value !== undefined,\n );\n if (valueSteps.length === 0) return 0;\n const first = valueSteps[0];\n if (raw <= first.at) return first.value;\n\n let toIndex = valueSteps.length - 1;\n for (let i = 1; i < valueSteps.length; i++) {\n if (valueSteps[i].at > raw) {\n toIndex = i;\n break;\n }\n }\n const pastLast = raw >= valueSteps[valueSteps.length - 1].at;\n const to = pastLast ? valueSteps[valueSteps.length - 1] : valueSteps[toIndex];\n const from = pastLast\n ? valueSteps[valueSteps.length - 1]\n : valueSteps[toIndex - 1];\n\n const dur = to.duration ?? defaultDuration;\n const ease = easings[to.easing ?? \"out\"];\n const start = to.at - dur;\n const t = pastLast || dur <= 0 ? 1 : ease(clamp01((raw - start) / dur));\n return from.value + (to.value - from.value) * t;\n}\n\nfunction thumbAt(\n steps: SliderStep[],\n raw: number,\n defaultDuration: number,\n): { thumbScale: number; ringOpacity: number } {\n const thumbSteps = steps.filter(\n (s): s is SliderStep & { thumbState: SliderThumbState } =>\n s.thumbState !== undefined,\n );\n if (thumbSteps.length === 0) return sliderThumbStyle(\"idle\");\n const first = thumbSteps[0];\n if (raw <= first.at) return sliderThumbStyle(first.thumbState);\n\n let toIndex = thumbSteps.length - 1;\n for (let i = 1; i < thumbSteps.length; i++) {\n if (thumbSteps[i].at > raw) {\n toIndex = i;\n break;\n }\n }\n const pastLast = raw >= thumbSteps[thumbSteps.length - 1].at;\n const to = pastLast ? thumbSteps[thumbSteps.length - 1] : thumbSteps[toIndex];\n const from = pastLast\n ? thumbSteps[thumbSteps.length - 1]\n : thumbSteps[toIndex - 1];\n\n const dur = to.duration ?? defaultDuration;\n const ease = easings[to.easing ?? \"out\"];\n const start = to.at - dur;\n const t = pastLast || dur <= 0 ? 1 : ease(clamp01((raw - start) / dur));\n\n const a = sliderThumbStyle(from.thumbState);\n const b = sliderThumbStyle(to.thumbState);\n return {\n thumbScale: a.thumbScale + (b.thumbScale - a.thumbScale) * t,\n ringOpacity: a.ringOpacity + (b.ringOpacity - a.ringOpacity) * t,\n };\n}\n\nexport function sliderStyleAt(\n steps: SliderStep[],\n raw: number,\n opts: SliderTransitionOptions = {},\n): SliderStyle {\n const { defaultDuration = DEFAULT_DURATION } = opts;\n const value = valueAt(steps, raw, defaultDuration);\n const thumb = thumbAt(steps, raw, defaultDuration);\n return {\n value,\n thumbScale: thumb.thumbScale,\n ringOpacity: thumb.ringOpacity,\n };\n}\n",+ "content": "\"use client\";\n\nimport { useCurrentFrame } from \"remotion\";\nimport {\n type SliderStyle,\n type SliderThumbState,\n sliderThumbStyle,\n} from \"@/components/remocn/slider\";\nimport { clamp01, type EasingName, easings } from \"@/lib/remocn-ui\";\n\nexport interface SliderStep {\n at: number;\n value?: number;\n thumbState?: SliderThumbState;\n duration?: number;\n easing?: EasingName;\n}\n\nexport const DEFAULT_DURATION = 18;\n\nexport interface SliderTransitionOptions {\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function tweenSliderStyle(\n a: SliderStyle,\n b: SliderStyle,\n t: number,\n): SliderStyle {\n return {\n value: a.value + (b.value - a.value) * t,\n thumbScale: a.thumbScale + (b.thumbScale - a.thumbScale) * t,\n ringOpacity: a.ringOpacity + (b.ringOpacity - a.ringOpacity) * t,\n };\n}\n\nexport function useSliderTransition(\n steps: SliderStep[],\n opts: SliderTransitionOptions = {},\n): SliderStyle {\n const { speed = 1 } = opts;\n const raw = useCurrentFrame() * speed;\n return sliderStyleAt(steps, raw, opts);\n}\n\nfunction valueAt(\n steps: SliderStep[],\n raw: number,\n defaultDuration: number,\n): number {\n const valueSteps = steps.filter(\n (s): s is SliderStep & { value: number } => s.value !== undefined,\n );\n if (valueSteps.length === 0) return 0;\n const first = valueSteps[0];\n if (raw <= first.at) return first.value;\n\n let toIndex = valueSteps.length - 1;\n for (let i = 1; i < valueSteps.length; i++) {\n if (valueSteps[i].at > raw) {\n toIndex = i;\n break;\n }\n }\n const pastLast = raw >= valueSteps[valueSteps.length - 1].at;\n const to = pastLast ? valueSteps[valueSteps.length - 1] : valueSteps[toIndex];\n const from = pastLast\n ? valueSteps[valueSteps.length - 1]\n : valueSteps[toIndex - 1];\n\n const dur = to.duration ?? defaultDuration;\n const ease = easings[to.easing ?? \"out\"];\n const start = to.at - dur;\n const t = pastLast || dur <= 0 ? 1 : ease(clamp01((raw - start) / dur));\n return from.value + (to.value - from.value) * t;\n}\n\nfunction thumbAt(\n steps: SliderStep[],\n raw: number,\n defaultDuration: number,\n): { thumbScale: number; ringOpacity: number } {\n const thumbSteps = steps.filter(\n (s): s is SliderStep & { thumbState: SliderThumbState } =>\n s.thumbState !== undefined,\n );\n if (thumbSteps.length === 0) return sliderThumbStyle(\"idle\");\n const first = thumbSteps[0];\n if (raw <= first.at) return sliderThumbStyle(first.thumbState);\n\n let toIndex = thumbSteps.length - 1;\n for (let i = 1; i < thumbSteps.length; i++) {\n if (thumbSteps[i].at > raw) {\n toIndex = i;\n break;\n }\n }\n const pastLast = raw >= thumbSteps[thumbSteps.length - 1].at;\n const to = pastLast ? thumbSteps[thumbSteps.length - 1] : thumbSteps[toIndex];\n const from = pastLast\n ? thumbSteps[thumbSteps.length - 1]\n : thumbSteps[toIndex - 1];\n\n const dur = to.duration ?? defaultDuration;\n const ease = easings[to.easing ?? \"out\"];\n const start = to.at - dur;\n const t = pastLast || dur <= 0 ? 1 : ease(clamp01((raw - start) / dur));\n\n const a = sliderThumbStyle(from.thumbState);\n const b = sliderThumbStyle(to.thumbState);\n return {\n thumbScale: a.thumbScale + (b.thumbScale - a.thumbScale) * t,\n ringOpacity: a.ringOpacity + (b.ringOpacity - a.ringOpacity) * t,\n };\n}\n\nexport function sliderStyleAt(\n steps: SliderStep[],\n raw: number,\n opts: SliderTransitionOptions = {},\n): SliderStyle {\n const { defaultDuration = DEFAULT_DURATION } = opts;\n const value = valueAt(steps, raw, defaultDuration);\n const thumb = thumbAt(steps, raw, defaultDuration);\n return {\n value,\n thumbScale: thumb.thumbScale,\n ringOpacity: thumb.ringOpacity,\n };\n}\n","type": "registry:component","target": "components/remocn/use-slider-transition.ts"}diff --git a/public/r/smoke-dissolve.json b/public/r/smoke-dissolve.jsonindex ce0dfa79..4847a3f2 100644--- a/public/r/smoke-dissolve.json+++ b/public/r/smoke-dissolve.json@@ -8,7 +8,7 @@"files": [{"path": "registry/remocn/smoke-dissolve/index.tsx",- "content": "\"use client\";\n\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport { ShaderSmokeRing } from \"@/components/remocn/shader-smoke-ring\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst DEFAULT_COLORS = [\"#8f88ae\"];\n\nexport type SmokeDissolveProps = {\n colorBack?: string;\n colors?: string[];\n speed?: number;\n};\n\nconst SmokeDissolvePresentation: React.FC<\n TransitionPresentationComponentProps<SmokeDissolveProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n colorBack = \"#141318\",\n colors = DEFAULT_COLORS,\n speed = 1,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n const radius = interpolate(p, [0, 1], [0, 1], clampOpts);\n const scale = interpolate(p, [0, 1], [1, 2], clampOpts);\n const thickness = interpolate(p, [0, 1], [1, 1.5], clampOpts);\n\n const childStyle: React.CSSProperties = entering\n ? {\n opacity: interpolate(p, [0.55, 0.68], [0, 1], clampOpts),\n transform: `scale(${interpolate(p, [0.55, 1], [0.3, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.55, 0.75], [10, 0], clampOpts)}px)`,\n }\n : { opacity: interpolate(p, [0.06, 0.13], [1, 0], clampOpts) };\n\n return (\n <AbsoluteFill>\n {entering ? (\n <AbsoluteFill style={{ pointerEvents: \"none\" }}>\n <ShaderSmokeRing\n speed={speed}\n colorBack={colorBack}\n colors={colors}\n radius={radius}\n scale={scale}\n thickness={thickness}\n />\n </AbsoluteFill>\n ) : null}\n <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>\n </AbsoluteFill>\n );\n};\n\nexport function smokeDissolve(\n props: SmokeDissolveProps = {},\n): TransitionPresentation<SmokeDissolveProps> {\n return {\n component: SmokeDissolvePresentation,\n props,\n };\n}\n",+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport { ShaderSmokeRing } from \"@/components/remocn/shader-smoke-ring\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst DEFAULT_COLORS = [\"#8f88ae\"];\n\nexport type SmokeDissolveProps = {\n colorBack?: string;\n colors?: string[];\n speed?: number;\n};\n\nconst SmokeDissolvePresentation: React.FC<\n TransitionPresentationComponentProps<SmokeDissolveProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n colorBack = \"#141318\",\n colors = DEFAULT_COLORS,\n speed = 1,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n const radius = interpolate(p, [0, 1], [0, 1], clampOpts);\n const scale = interpolate(p, [0, 1], [1, 2], clampOpts);\n const thickness = interpolate(p, [0, 1], [1, 1.5], clampOpts);\n\n const childStyle: React.CSSProperties = entering\n ? {\n opacity: interpolate(p, [0.55, 0.68], [0, 1], clampOpts),\n transform: `scale(${interpolate(p, [0.55, 1], [0.3, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.55, 0.75], [10, 0], clampOpts)}px)`,\n }\n : { opacity: interpolate(p, [0.06, 0.13], [1, 0], clampOpts) };\n\n return (\n <AbsoluteFill>\n {entering ? (\n <AbsoluteFill style={{ pointerEvents: \"none\" }}>\n <ShaderSmokeRing\n speed={speed}\n colorBack={colorBack}\n colors={colors}\n radius={radius}\n scale={scale}\n thickness={thickness}\n />\n </AbsoluteFill>\n ) : null}\n <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>\n </AbsoluteFill>\n );\n};\n\nexport function smokeDissolve(\n props: SmokeDissolveProps = {},\n): TransitionPresentation<SmokeDissolveProps> {\n return {\n component: SmokeDissolvePresentation,\n props,\n };\n}\n","type": "registry:component","target": "components/remocn/smoke-dissolve.tsx"}diff --git a/public/r/soft-blur-in.json b/public/r/soft-blur-in.jsonindex a4a772fd..0073e78f 100644--- a/public/r/soft-blur-in.json+++ b/public/r/soft-blur-in.json@@ -7,7 +7,7 @@"files": [{"path": "registry/remocn/soft-blur-in/index.tsx",- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface SoftBlurInProps {\n text: string;\n blur?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function SoftBlurIn({\n text,\n blur = 12,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: SoftBlurInProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 27;\n const staggerFrames = 1;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerFrames;\n const easing = Easing.bezier(0.22, 1, 0.36, 1);\n const opacity = interpolate(\n local,\n [0, charDurationFrames],\n [0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\", easing },\n );\n const y = interpolate(\n local,\n [0, charDurationFrames],\n [16, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\", easing },\n );\n const blurAmount = interpolate(\n local,\n [0, charDurationFrames],\n [blur, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\", easing },\n );\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n filter: `blur(${blurAmount}px)`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface SoftBlurInProps {\n text: string;\n blur?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function SoftBlurIn({\n text,\n blur = 12,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: SoftBlurInProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 27;\n const staggerFrames = 1;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerFrames;\n const easing = Easing.bezier(0.22, 1, 0.36, 1);\n const opacity = interpolate(local, [0, charDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const y = interpolate(local, [0, charDurationFrames], [16, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const blurAmount = interpolate(\n local,\n [0, charDurationFrames],\n [blur, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\", easing },\n );\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n filter: `blur(${blurAmount}px)`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/soft-blur-in.tsx"}diff --git a/public/r/spring-scale-in.json b/public/r/spring-scale-in.jsonindex dc80d328..5a0e3fe4 100644--- a/public/r/spring-scale-in.json+++ b/public/r/spring-scale-in.json@@ -7,7 +7,7 @@"files": [{"path": "registry/remocn/spring-scale-in/index.tsx",- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface SpringScaleInProps {\n text: string;\n staggerDelay?: number;\n scaleFrom?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function SpringScaleIn({\n text,\n staggerDelay = 3,\n scaleFrom = 0.7,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: SpringScaleInProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.split(\" \");\n const wordDurationFrames = 11;\n const easing = Easing.bezier(0.34, 1.56, 0.64, 1);\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {words.map((word, i) => {\n const local = frame - i * staggerDelay;\n const opacity = interpolate(local, [0, wordDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const scale = interpolate(local, [0, wordDurationFrames], [scaleFrom, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n transformOrigin: \"50% 50%\",\n opacity,\n transform: `scale(${scale})`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface SpringScaleInProps {\n text: string;\n staggerDelay?: number;\n scaleFrom?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function SpringScaleIn({\n text,\n staggerDelay = 3,\n scaleFrom = 0.7,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: SpringScaleInProps) {\n const frame = useCurrentFrame() * speed;\n\n const words = text.split(\" \");\n const wordDurationFrames = 11;\n const easing = Easing.bezier(0.34, 1.56, 0.64, 1);\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {words.map((word, i) => {\n const local = frame - i * staggerDelay;\n const opacity = interpolate(local, [0, wordDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const scale = interpolate(\n local,\n [0, wordDurationFrames],\n [scaleFrom, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n },\n );\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n marginRight: \"0.25em\",\n transformOrigin: \"50% 50%\",\n opacity,\n transform: `scale(${scale})`,\n }}\n >\n {word}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/spring-scale-in.tsx"}diff --git a/public/r/stepper.json b/public/r/stepper.jsonindex 6ed4d211..8909a0d7 100644--- a/public/r/stepper.json+++ b/public/r/stepper.json@@ -8,13 +8,13 @@"files": [{"path": "registry/remocn-ui/stepper/index.tsx",- "content": "\"use client\";\n\nimport { clamp01, mixOklch, type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport interface StepperStyle {\n position: number;\n}\n\nexport type StepperOrientation = \"horizontal\" | \"vertical\";\n\nexport interface StepperProps {\n steps?: string[];\n activeIndex?: number;\n style?: StepperStyle;\n orientation?: StepperOrientation;\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nconst DEFAULT_STEPS = [\"Account\", \"Plan\", \"Done\"];\n\nconst CIRCLE = 36;\nconst CHECK_PATH_LENGTH = 14;\n\nexport interface StepperStyleContext {\n primary: string;\n primaryFg: string;\n mutedBg: string;\n border: string;\n mutedFg: string;\n foreground: string;\n}\n\nexport function stepperStyleContext(theme: RemocnTheme): StepperStyleContext {\n return {\n primary: theme.primary,\n primaryFg: theme.primaryForeground,\n mutedBg: theme.muted,\n border: theme.border,\n mutedFg: theme.mutedForeground,\n foreground: theme.foreground,\n };\n}\n\nexport function stepperStyle(activeIndex: number): StepperStyle {\n return { position: activeIndex };\n}\n\nexport function stepCircleAt(i: number, position: number): {\n fill: number;\n checkDraw: number;\n active: boolean;\n} {\n const fill = clamp01(position - i);\n const checkDraw = fill;\n const active = Math.floor(position) === i && fill < 1;\n return { fill, checkDraw, active };\n}\n\nexport function connectorFillAt(i: number, position: number): number {\n return clamp01(position - i);\n}\n\nexport function Stepper({\n steps = DEFAULT_STEPS,\n activeIndex = 0,\n style,\n orientation: _orientation = \"horizontal\",\n theme: themeOverride,\n className,\n}: StepperProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const ctx = stepperStyleContext(theme);\n const v = style ?? stepperStyle(activeIndex);\n const position = v.position;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div style={{ display: \"flex\", alignItems: \"flex-start\" }}>\n {steps.map((label, i) => {\n const { fill, checkDraw, active } = stepCircleAt(i, position);\n const completed = fill >= 1;\n const circleBg = mixOklch(ctx.mutedBg, ctx.primary, fill);\n const circleBorder = mixOklch(ctx.border, ctx.primary, fill);\n const numberOpacity = 1 - checkDraw;\n const numberColor = active || completed ? ctx.foreground : ctx.mutedFg;\n const isLast = i === steps.length - 1;\n return (\n <div\n key={label}\n style={{ display: \"flex\", alignItems: \"flex-start\" }}\n >\n {}\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: 8,\n width: CIRCLE + 24,\n }}\n >\n <div\n style={{\n position: \"relative\",\n width: CIRCLE,\n height: CIRCLE,\n borderRadius: \"50%\",\n background: circleBg,\n border: `2px solid ${active ? ctx.primary : circleBorder}`,\n boxSizing: \"border-box\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n {}\n <span\n style={{\n position: \"absolute\",\n fontSize: 14,\n fontWeight: 600,\n color: numberColor,\n opacity: numberOpacity,\n }}\n >\n {i + 1}\n </span>\n {}\n <svg width={CIRCLE} height={CIRCLE} viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d=\"M5 12.5l4.5 4.5L19 7\"\n stroke={ctx.primaryFg}\n strokeWidth=\"2.6\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n pathLength={CHECK_PATH_LENGTH}\n strokeDasharray={CHECK_PATH_LENGTH}\n strokeDashoffset={CHECK_PATH_LENGTH * (1 - checkDraw)}\n />\n </svg>\n </div>\n <span\n style={{\n fontSize: 13,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n color: active || completed ? ctx.foreground : ctx.mutedFg,\n whiteSpace: \"nowrap\",\n }}\n >\n {label}\n </span>\n </div>\n {}\n {!isLast && (\n <div\n style={{\n position: \"relative\",\n width: 64,\n height: 2,\n marginTop: CIRCLE / 2 - 1,\n background: ctx.border,\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n bottom: 0,\n width: `${connectorFillAt(i, position) * 100}%`,\n background: ctx.primary,\n }}\n />\n </div>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport {\n clamp01,\n mixOklch,\n type RemocnTheme,\n useRemocnTheme,\n} from \"@/lib/remocn-ui\";\n\nexport interface StepperStyle {\n position: number;\n}\n\nexport type StepperOrientation = \"horizontal\" | \"vertical\";\n\nexport interface StepperProps {\n steps?: string[];\n activeIndex?: number;\n style?: StepperStyle;\n orientation?: StepperOrientation;\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nconst DEFAULT_STEPS = [\"Account\", \"Plan\", \"Done\"];\n\nconst CIRCLE = 36;\nconst CHECK_PATH_LENGTH = 14;\n\nexport interface StepperStyleContext {\n primary: string;\n primaryFg: string;\n mutedBg: string;\n border: string;\n mutedFg: string;\n foreground: string;\n}\n\nexport function stepperStyleContext(theme: RemocnTheme): StepperStyleContext {\n return {\n primary: theme.primary,\n primaryFg: theme.primaryForeground,\n mutedBg: theme.muted,\n border: theme.border,\n mutedFg: theme.mutedForeground,\n foreground: theme.foreground,\n };\n}\n\nexport function stepperStyle(activeIndex: number): StepperStyle {\n return { position: activeIndex };\n}\n\nexport function stepCircleAt(\n i: number,\n position: number,\n): {\n fill: number;\n checkDraw: number;\n active: boolean;\n} {\n const fill = clamp01(position - i);\n const checkDraw = fill;\n const active = Math.floor(position) === i && fill < 1;\n return { fill, checkDraw, active };\n}\n\nexport function connectorFillAt(i: number, position: number): number {\n return clamp01(position - i);\n}\n\nexport function Stepper({\n steps = DEFAULT_STEPS,\n activeIndex = 0,\n style,\n orientation: _orientation = \"horizontal\",\n theme: themeOverride,\n className,\n}: StepperProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const ctx = stepperStyleContext(theme);\n const v = style ?? stepperStyle(activeIndex);\n const position = v.position;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div style={{ display: \"flex\", alignItems: \"flex-start\" }}>\n {steps.map((label, i) => {\n const { fill, checkDraw, active } = stepCircleAt(i, position);\n const completed = fill >= 1;\n const circleBg = mixOklch(ctx.mutedBg, ctx.primary, fill);\n const circleBorder = mixOklch(ctx.border, ctx.primary, fill);\n const numberOpacity = 1 - checkDraw;\n const numberColor =\n active || completed ? ctx.foreground : ctx.mutedFg;\n const isLast = i === steps.length - 1;\n return (\n <div\n key={label}\n style={{ display: \"flex\", alignItems: \"flex-start\" }}\n >\n {}\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: 8,\n width: CIRCLE + 24,\n }}\n >\n <div\n style={{\n position: \"relative\",\n width: CIRCLE,\n height: CIRCLE,\n borderRadius: \"50%\",\n background: circleBg,\n border: `2px solid ${active ? ctx.primary : circleBorder}`,\n boxSizing: \"border-box\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n {}\n <span\n style={{\n position: \"absolute\",\n fontSize: 14,\n fontWeight: 600,\n color: numberColor,\n opacity: numberOpacity,\n }}\n >\n {i + 1}\n </span>\n {}\n <svg\n width={CIRCLE}\n height={CIRCLE}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n >\n <path\n d=\"M5 12.5l4.5 4.5L19 7\"\n stroke={ctx.primaryFg}\n strokeWidth=\"2.6\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n pathLength={CHECK_PATH_LENGTH}\n strokeDasharray={CHECK_PATH_LENGTH}\n strokeDashoffset={CHECK_PATH_LENGTH * (1 - checkDraw)}\n />\n </svg>\n </div>\n <span\n style={{\n fontSize: 13,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n color: active || completed ? ctx.foreground : ctx.mutedFg,\n whiteSpace: \"nowrap\",\n }}\n >\n {label}\n </span>\n </div>\n {}\n {!isLast && (\n <div\n style={{\n position: \"relative\",\n width: 64,\n height: 2,\n marginTop: CIRCLE / 2 - 1,\n background: ctx.border,\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n bottom: 0,\n width: `${connectorFillAt(i, position) * 100}%`,\n background: ctx.primary,\n }}\n />\n </div>\n )}\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/stepper.tsx"},{"path": "registry/remocn-ui/stepper/use-stepper-transition.ts",- "content": "\"use client\";\n\nimport { useCurrentFrame } from \"remotion\";\nimport { clamp01, type EasingName, easings } from \"@/lib/remocn-ui\";\nimport type { StepperStyle } from \"@/components/remocn/stepper\";\n\nexport interface StepperStep {\n at: number;\n index: number;\n duration?: number;\n easing?: EasingName;\n}\n\nexport const DEFAULT_DURATION = 24;\n\nexport interface StepperTransitionOptions {\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function tweenStepperStyle(\n a: StepperStyle,\n b: StepperStyle,\n t: number,\n): StepperStyle {\n return { position: a.position + (b.position - a.position) * t };\n}\n\nexport function useStepperTransition(\n steps: StepperStep[],\n opts: StepperTransitionOptions = {},\n): StepperStyle {\n const { speed = 1 } = opts;\n const raw = useCurrentFrame() * speed;\n return stepperStyleAt(steps, raw, opts);\n}\n\nexport function stepperStyleAt(\n steps: StepperStep[],\n raw: number,\n opts: StepperTransitionOptions = {},\n): StepperStyle {\n const { defaultDuration = DEFAULT_DURATION } = opts;\n\n if (steps.length === 0) return { position: 0 };\n\n const first = steps[0];\n\n if (raw <= first.at) return { position: first.index };\n\n let toIndex = steps.length - 1;\n for (let i = 1; i < steps.length; i++) {\n if (steps[i].at > raw) {\n toIndex = i;\n break;\n }\n }\n const pastLast = raw >= steps[steps.length - 1].at;\n const to = pastLast ? steps[steps.length - 1] : steps[toIndex];\n const from = pastLast ? steps[steps.length - 1] : steps[toIndex - 1];\n\n const dur = to.duration ?? defaultDuration;\n const ease = easings[to.easing ?? \"out\"];\n const start = to.at - dur;\n const t = pastLast || dur <= 0 ? 1 : ease(clamp01((raw - start) / dur));\n const position = from.index + (to.index - from.index) * t;\n\n return { position };\n}\n",+ "content": "\"use client\";\n\nimport { useCurrentFrame } from \"remotion\";\nimport type { StepperStyle } from \"@/components/remocn/stepper\";\nimport { clamp01, type EasingName, easings } from \"@/lib/remocn-ui\";\n\nexport interface StepperStep {\n at: number;\n index: number;\n duration?: number;\n easing?: EasingName;\n}\n\nexport const DEFAULT_DURATION = 24;\n\nexport interface StepperTransitionOptions {\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function tweenStepperStyle(\n a: StepperStyle,\n b: StepperStyle,\n t: number,\n): StepperStyle {\n return { position: a.position + (b.position - a.position) * t };\n}\n\nexport function useStepperTransition(\n steps: StepperStep[],\n opts: StepperTransitionOptions = {},\n): StepperStyle {\n const { speed = 1 } = opts;\n const raw = useCurrentFrame() * speed;\n return stepperStyleAt(steps, raw, opts);\n}\n\nexport function stepperStyleAt(\n steps: StepperStep[],\n raw: number,\n opts: StepperTransitionOptions = {},\n): StepperStyle {\n const { defaultDuration = DEFAULT_DURATION } = opts;\n\n if (steps.length === 0) return { position: 0 };\n\n const first = steps[0];\n\n if (raw <= first.at) return { position: first.index };\n\n let toIndex = steps.length - 1;\n for (let i = 1; i < steps.length; i++) {\n if (steps[i].at > raw) {\n toIndex = i;\n break;\n }\n }\n const pastLast = raw >= steps[steps.length - 1].at;\n const to = pastLast ? steps[steps.length - 1] : steps[toIndex];\n const from = pastLast ? steps[steps.length - 1] : steps[toIndex - 1];\n\n const dur = to.duration ?? defaultDuration;\n const ease = easings[to.easing ?? \"out\"];\n const start = to.at - dur;\n const t = pastLast || dur <= 0 ? 1 : ease(clamp01((raw - start) / dur));\n const position = from.index + (to.index - from.index) * t;\n\n return { position };\n}\n","type": "registry:component","target": "components/remocn/use-stepper-transition.ts"}diff --git a/public/r/swirl-dissolve.json b/public/r/swirl-dissolve.jsonindex 6c325e88..486b6a0b 100644--- a/public/r/swirl-dissolve.json+++ b/public/r/swirl-dissolve.json@@ -8,7 +8,7 @@"files": [{"path": "registry/remocn/swirl-dissolve/index.tsx",- "content": "\"use client\";\n\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport { ShaderSwirl } from \"@/components/remocn/shader-swirl\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst DEFAULT_COLORS = [\"#1f1d29\", \"#413d56\", \"#8f88ae\"];\n\nexport type SwirlDissolveProps = {\n colors?: string[];\n colorBack?: string;\n bandCount?: number;\n softness?: number;\n speed?: number;\n};\n\nconst SwirlDissolvePresentation: React.FC<\n TransitionPresentationComponentProps<SwirlDissolveProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n colors = DEFAULT_COLORS,\n colorBack = \"#141318\",\n bandCount = 10,\n softness = 0.35,\n speed = 1,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n const twist = interpolate(p, [0.1, 0.42, 0.64, 1], [1, 0, 0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n\n const childStyle: React.CSSProperties = entering\n ? {\n opacity: interpolate(p, [0.77, 0.87], [0, 1], clampOpts),\n transform: `scale(${interpolate(p, [0.77, 1], [0.3, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.77, 0.93], [10, 0], clampOpts)}px)`,\n }\n : { opacity: interpolate(p, [0.06, 0.13], [1, 0], clampOpts) };\n\n return (\n <AbsoluteFill>\n {entering ? (\n <AbsoluteFill style={{ pointerEvents: \"none\" }}>\n <ShaderSwirl\n speed={speed}\n twist={twist}\n colors={colors}\n colorBack={colorBack}\n bandCount={bandCount}\n softness={softness}\n />\n </AbsoluteFill>\n ) : null}\n <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>\n </AbsoluteFill>\n );\n};\n\nexport function swirlDissolve(\n props: SwirlDissolveProps = {},\n): TransitionPresentation<SwirlDissolveProps> {\n return {\n component: SwirlDissolvePresentation,\n props,\n };\n}\n",+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport { ShaderSwirl } from \"@/components/remocn/shader-swirl\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst DEFAULT_COLORS = [\"#1f1d29\", \"#413d56\", \"#8f88ae\"];\n\nexport type SwirlDissolveProps = {\n colors?: string[];\n colorBack?: string;\n bandCount?: number;\n softness?: number;\n speed?: number;\n};\n\nconst SwirlDissolvePresentation: React.FC<\n TransitionPresentationComponentProps<SwirlDissolveProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n colors = DEFAULT_COLORS,\n colorBack = \"#141318\",\n bandCount = 10,\n softness = 0.35,\n speed = 1,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n const twist = interpolate(p, [0.1, 0.42, 0.64, 1], [1, 0, 0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n\n const childStyle: React.CSSProperties = entering\n ? {\n opacity: interpolate(p, [0.77, 0.87], [0, 1], clampOpts),\n transform: `scale(${interpolate(p, [0.77, 1], [0.3, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.77, 0.93], [10, 0], clampOpts)}px)`,\n }\n : { opacity: interpolate(p, [0.06, 0.13], [1, 0], clampOpts) };\n\n return (\n <AbsoluteFill>\n {entering ? (\n <AbsoluteFill style={{ pointerEvents: \"none\" }}>\n <ShaderSwirl\n speed={speed}\n twist={twist}\n colors={colors}\n colorBack={colorBack}\n bandCount={bandCount}\n softness={softness}\n />\n </AbsoluteFill>\n ) : null}\n <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>\n </AbsoluteFill>\n );\n};\n\nexport function swirlDissolve(\n props: SwirlDissolveProps = {},\n): TransitionPresentation<SwirlDissolveProps> {\n return {\n component: SwirlDissolvePresentation,\n props,\n };\n}\n","type": "registry:component","target": "components/remocn/swirl-dissolve.tsx"}diff --git a/public/r/switch.json b/public/r/switch.jsonindex 8460b326..a1d552cd 100644--- a/public/r/switch.json+++ b/public/r/switch.json@@ -8,13 +8,13 @@"files": [{"path": "registry/remocn-ui/switch/index.tsx",- "content": "\"use client\";\n\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type SwitchState = \"unchecked\" | \"checked\";\n\ntype SwitchSize = \"sm\" | \"default\" | \"lg\";\n\nexport interface SwitchProps {\n state?: SwitchState;\n style?: SwitchStyle;\n label?: string;\n size?: SwitchSize;\n theme?: Partial<RemocnTheme>;\n primary?: string;\n className?: string;\n}\n\nconst SIZE_STYLES: Record<\n SwitchSize,\n { trackW: number; trackH: number; thumb: number; pad: number; fontSize: number; gap: number }\n> = {\n sm: { trackW: 36, trackH: 20, thumb: 16, pad: 2, fontSize: 13, gap: 8 },\n default: { trackW: 44, trackH: 24, thumb: 20, pad: 2, fontSize: 15, gap: 10 },\n lg: { trackW: 52, trackH: 28, thumb: 24, pad: 2, fontSize: 17, gap: 12 },\n};\n\nexport interface SwitchStyle {\n trackBackground: string;\n thumbOffset: number;\n}\n\nexport interface SwitchStyleContext {\n uncheckedTrack: string;\n checkedTrack: string;\n thumbColor: string;\n}\n\nexport function switchStyleContext(theme: RemocnTheme): SwitchStyleContext {\n return {\n uncheckedTrack: theme.input,\n checkedTrack: theme.primary,\n thumbColor: theme.background,\n };\n}\n\nexport function switchStyle(\n state: SwitchState,\n ctx: SwitchStyleContext,\n): SwitchStyle {\n switch (state) {\n case \"checked\":\n return {\n trackBackground: ctx.checkedTrack,\n thumbOffset: 1,\n };\n default:\n return {\n trackBackground: ctx.uncheckedTrack,\n thumbOffset: 0,\n };\n }\n}\n\nexport function Switch({\n state = \"unchecked\",\n style,\n label,\n size = \"default\",\n theme: themeOverride,\n primary,\n className,\n}: SwitchProps) {\n const theme = useRemocnTheme(\n { ...themeOverride, ...(primary ? { primary } : {}) },\n \"light\",\n );\n\n const sizeStyle = SIZE_STYLES[size];\n const ctx = switchStyleContext(theme);\n const v = style ?? switchStyle(state, ctx);\n\n const travel = sizeStyle.trackW - sizeStyle.thumb - sizeStyle.pad * 2;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <span\n className={className}\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: sizeStyle.gap,\n }}\n >\n {}\n <span\n style={{\n position: \"relative\",\n display: \"flex\",\n alignItems: \"center\",\n width: sizeStyle.trackW,\n height: sizeStyle.trackH,\n borderRadius: sizeStyle.trackH / 2,\n background: v.trackBackground,\n }}\n >\n {}\n <span\n style={{\n position: \"absolute\",\n left: sizeStyle.pad,\n width: sizeStyle.thumb,\n height: sizeStyle.thumb,\n borderRadius: \"50%\",\n background: ctx.thumbColor,\n boxShadow: \"0 1px 2px rgba(0,0,0,0.15)\",\n transform: `translateX(${v.thumbOffset * travel}px)`,\n }}\n />\n </span>\n {label !== undefined && (\n <span\n style={{\n fontSize: sizeStyle.fontSize,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n color: theme.foreground,\n }}\n >\n {label}\n </span>\n )}\n </span>\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type SwitchState = \"unchecked\" | \"checked\";\n\ntype SwitchSize = \"sm\" | \"default\" | \"lg\";\n\nexport interface SwitchProps {\n state?: SwitchState;\n style?: SwitchStyle;\n label?: string;\n size?: SwitchSize;\n theme?: Partial<RemocnTheme>;\n primary?: string;\n className?: string;\n}\n\nconst SIZE_STYLES: Record<\n SwitchSize,\n {\n trackW: number;\n trackH: number;\n thumb: number;\n pad: number;\n fontSize: number;\n gap: number;\n }\n> = {\n sm: { trackW: 36, trackH: 20, thumb: 16, pad: 2, fontSize: 13, gap: 8 },\n default: { trackW: 44, trackH: 24, thumb: 20, pad: 2, fontSize: 15, gap: 10 },\n lg: { trackW: 52, trackH: 28, thumb: 24, pad: 2, fontSize: 17, gap: 12 },\n};\n\nexport interface SwitchStyle {\n trackBackground: string;\n thumbOffset: number;\n}\n\nexport interface SwitchStyleContext {\n uncheckedTrack: string;\n checkedTrack: string;\n thumbColor: string;\n}\n\nexport function switchStyleContext(theme: RemocnTheme): SwitchStyleContext {\n return {\n uncheckedTrack: theme.input,\n checkedTrack: theme.primary,\n thumbColor: theme.background,\n };\n}\n\nexport function switchStyle(\n state: SwitchState,\n ctx: SwitchStyleContext,\n): SwitchStyle {\n switch (state) {\n case \"checked\":\n return {\n trackBackground: ctx.checkedTrack,\n thumbOffset: 1,\n };\n default:\n return {\n trackBackground: ctx.uncheckedTrack,\n thumbOffset: 0,\n };\n }\n}\n\nexport function Switch({\n state = \"unchecked\",\n style,\n label,\n size = \"default\",\n theme: themeOverride,\n primary,\n className,\n}: SwitchProps) {\n const theme = useRemocnTheme(\n { ...themeOverride, ...(primary ? { primary } : {}) },\n \"light\",\n );\n\n const sizeStyle = SIZE_STYLES[size];\n const ctx = switchStyleContext(theme);\n const v = style ?? switchStyle(state, ctx);\n\n const travel = sizeStyle.trackW - sizeStyle.thumb - sizeStyle.pad * 2;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <span\n className={className}\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: sizeStyle.gap,\n }}\n >\n {}\n <span\n style={{\n position: \"relative\",\n display: \"flex\",\n alignItems: \"center\",\n width: sizeStyle.trackW,\n height: sizeStyle.trackH,\n borderRadius: sizeStyle.trackH / 2,\n background: v.trackBackground,\n }}\n >\n {}\n <span\n style={{\n position: \"absolute\",\n left: sizeStyle.pad,\n width: sizeStyle.thumb,\n height: sizeStyle.thumb,\n borderRadius: \"50%\",\n background: ctx.thumbColor,\n boxShadow: \"0 1px 2px rgba(0,0,0,0.15)\",\n transform: `translateX(${v.thumbOffset * travel}px)`,\n }}\n />\n </span>\n {label !== undefined && (\n <span\n style={{\n fontSize: sizeStyle.fontSize,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n color: theme.foreground,\n }}\n >\n {label}\n </span>\n )}\n </span>\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/switch.tsx"},{"path": "registry/remocn-ui/switch/use-switch-transition.ts",- "content": "\"use client\";\n\nimport {\n easings,\n mixOklch,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\nimport {\n switchStyle,\n switchStyleContext,\n type SwitchState,\n type SwitchStyle,\n} from \"@/components/remocn/switch\";\n\nexport const DEFAULT_DURATION = 10;\n\nexport function tweenSwitchStyle(\n a: SwitchStyle,\n b: SwitchStyle,\n t: number,\n): SwitchStyle {\n return {\n trackBackground: mixOklch(a.trackBackground, b.trackBackground, t),\n thumbOffset: a.thumbOffset + (b.thumbOffset - a.thumbOffset) * t,\n };\n}\n\nexport interface SwitchTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n primary?: string;\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useSwitchTransition(\n steps: Step<SwitchState>[],\n opts: SwitchTransitionOptions = {},\n): SwitchStyle {\n const {\n theme: themeOverride,\n mode,\n primary,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(\n { ...themeOverride, ...(primary ? { primary } : {}) },\n mode,\n );\n const ctx = switchStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"unchecked\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenSwitchStyle(switchStyle(from, ctx), switchStyle(to, ctx), t);\n}\n",+ "content": "\"use client\";\n\nimport {\n type SwitchState,\n type SwitchStyle,\n switchStyle,\n switchStyleContext,\n} from \"@/components/remocn/switch\";\nimport {\n easings,\n mixOklch,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\n\nexport const DEFAULT_DURATION = 10;\n\nexport function tweenSwitchStyle(\n a: SwitchStyle,\n b: SwitchStyle,\n t: number,\n): SwitchStyle {\n return {\n trackBackground: mixOklch(a.trackBackground, b.trackBackground, t),\n thumbOffset: a.thumbOffset + (b.thumbOffset - a.thumbOffset) * t,\n };\n}\n\nexport interface SwitchTransitionOptions {\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n primary?: string;\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useSwitchTransition(\n steps: Step<SwitchState>[],\n opts: SwitchTransitionOptions = {},\n): SwitchStyle {\n const {\n theme: themeOverride,\n mode,\n primary,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(\n { ...themeOverride, ...(primary ? { primary } : {}) },\n mode,\n );\n const ctx = switchStyleContext(theme);\n const { from, to, progress } = useStateTransition(\n steps,\n \"unchecked\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenSwitchStyle(switchStyle(from, ctx), switchStyle(to, ctx), t);\n}\n","type": "registry:component","target": "components/remocn/use-switch-transition.ts"}diff --git a/public/r/tabs.json b/public/r/tabs.jsonindex d291d352..c0f39447 100644--- a/public/r/tabs.json+++ b/public/r/tabs.json@@ -14,7 +14,7 @@},{"path": "registry/remocn-ui/tabs/use-tabs-transition.ts",- "content": "\"use client\";\n\nimport {\n easings,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\nimport {\n tabsStyle,\n tabsStyleContext,\n type TabsState,\n type TabsStyle,\n} from \"@/components/remocn/tabs\";\n\nconst DEFAULT_ITEMS = [\"Account\", \"Password\", \"Settings\"];\n\nexport const DEFAULT_DURATION = 14;\n\nexport function tweenTabsStyle(\n a: TabsStyle,\n b: TabsStyle,\n t: number,\n): TabsStyle {\n return {\n indicatorOffset:\n a.indicatorOffset + (b.indicatorOffset - a.indicatorOffset) * t,\n };\n}\n\nexport interface TabsTransitionOptions {\n items?: string[];\n variant?: \"pill\" | \"underline\";\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useTabsTransition(\n steps: Step<TabsState>[],\n opts: TabsTransitionOptions = {},\n): TabsStyle {\n const {\n items = DEFAULT_ITEMS,\n variant = \"pill\",\n theme: themeOverride,\n mode,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = tabsStyleContext(items, variant, theme);\n const { from, to, progress } = useStateTransition(\n steps,\n items[0],\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenTabsStyle(tabsStyle(from, ctx), tabsStyle(to, ctx), t);\n}\n",+ "content": "\"use client\";\n\nimport {\n type TabsState,\n type TabsStyle,\n tabsStyle,\n tabsStyleContext,\n} from \"@/components/remocn/tabs\";\nimport {\n easings,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\n\nconst DEFAULT_ITEMS = [\"Account\", \"Password\", \"Settings\"];\n\nexport const DEFAULT_DURATION = 14;\n\nexport function tweenTabsStyle(\n a: TabsStyle,\n b: TabsStyle,\n t: number,\n): TabsStyle {\n return {\n indicatorOffset:\n a.indicatorOffset + (b.indicatorOffset - a.indicatorOffset) * t,\n };\n}\n\nexport interface TabsTransitionOptions {\n items?: string[];\n variant?: \"pill\" | \"underline\";\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useTabsTransition(\n steps: Step<TabsState>[],\n opts: TabsTransitionOptions = {},\n): TabsStyle {\n const {\n items = DEFAULT_ITEMS,\n variant = \"pill\",\n theme: themeOverride,\n mode,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = tabsStyleContext(items, variant, theme);\n const { from, to, progress } = useStateTransition(\n steps,\n items[0],\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenTabsStyle(tabsStyle(from, ctx), tabsStyle(to, ctx), t);\n}\n","type": "registry:component","target": "components/remocn/use-tabs-transition.ts"}diff --git a/public/r/telegram-chat-flow.json b/public/r/telegram-chat-flow.jsonindex 33c58763..15abd71d 100644--- a/public/r/telegram-chat-flow.json+++ b/public/r/telegram-chat-flow.json@@ -8,7 +8,7 @@"files": [{"path": "registry/remocn-ui/telegram-chat-flow/index.tsx",- "content": "\"use client\";\n\nimport {\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { type RemocnTheme, revealedText } from \"@/lib/remocn-ui\";\nimport { Caret } from \"@/components/remocn/caret\";\n\nexport interface TelegramMessage {\n from: \"me\" | \"them\";\n text: string;\n reaction?: string;\n time?: string;\n}\n\nexport interface TelegramContact {\n name: string;\n avatar?: string;\n}\n\nexport interface TelegramChatFlowProps {\n messages?: TelegramMessage[];\n contact?: TelegramContact;\n accentColor?: string;\n speed?: number;\n theme?: Partial<RemocnTheme>;\n}\n\nconst MOBILE_WIDTH = 460;\nconst LEAD_IN = 12;\nconst FRAMES_PER_CHAR = 2.2;\nconst MIN_TYPE = 18;\nconst MAX_TYPE = 86;\nconst SEND_GAP = 10;\nconst REVEAL = 14;\nconst REACT_DELAY = 8;\nconst REACT_DUR = 14;\nconst MSG_GAP = 16;\nconst TYPING_MIN = 34;\nconst TYPING_MAX = 70;\nconst TAIL = 28;\nconst PRESS_WINDOW = 7;\n\nconst TELEGRAM_BLUE = \"#3390ec\";\nconst INCOMING_BG = \"#ffffff\";\nconst INCOMING_FG = \"#0f1419\";\nconst INCOMING_META = \"#8a99a5\";\nconst OUTGOING_FG = \"#ffffff\";\nconst OUTGOING_META = \"rgba(255,255,255,0.82)\";\n\nconst DEFAULT_MESSAGES: TelegramMessage[] = [\n { from: \"me\", text: \"Hey — ready for the demo?\", time: \"9:40\" },\n { from: \"them\", text: \"Yep, pushing it live now\", reaction: \"🔥\", time: \"9:41\" },\n { from: \"me\", text: \"Perfect, sending the link over\", reaction: \"👍\", time: \"9:41\" },\n];\n\nfunction clamp(value: number, lo: number, hi: number): number {\n return Math.max(lo, Math.min(hi, value));\n}\n\nexport interface ScheduledMessage {\n index: number;\n from: \"me\" | \"them\";\n text: string;\n reaction?: string;\n time?: string;\n presenceStart: number;\n typeStart?: number;\n sendAt?: number;\n typingStart?: number;\n revealAt: number;\n reactAt?: number;\n}\n\nexport interface TelegramChatFlowSchedule {\n items: ScheduledMessage[];\n duration: number;\n}\n\nexport function telegramChatFlowSchedule(\n messages: TelegramMessage[],\n): TelegramChatFlowSchedule {\n const items: ScheduledMessage[] = [];\n let cursor = LEAD_IN;\n\n messages.forEach((message, index) => {\n const hasReaction = message.reaction !== undefined && message.reaction !== \"\";\n if (message.from === \"me\") {\n const typeStart = cursor;\n const typeDur = clamp(\n Math.round(message.text.length * FRAMES_PER_CHAR),\n MIN_TYPE,\n MAX_TYPE,\n );\n const sendAt = typeStart + typeDur + SEND_GAP;\n const revealAt = sendAt;\n const reactAt = hasReaction ? revealAt + REVEAL + REACT_DELAY : undefined;\n items.push({\n index,\n from: \"me\",\n text: message.text,\n reaction: hasReaction ? message.reaction : undefined,\n time: message.time,\n presenceStart: sendAt - 2,\n typeStart,\n sendAt,\n revealAt,\n reactAt,\n });\n cursor =\n revealAt + REVEAL + (hasReaction ? REACT_DELAY + REACT_DUR : 0) + MSG_GAP;\n } else {\n const typingStart = cursor;\n const typingDur = clamp(\n Math.round(message.text.length * FRAMES_PER_CHAR),\n TYPING_MIN,\n TYPING_MAX,\n );\n const revealAt = typingStart + typingDur;\n const reactAt = hasReaction ? revealAt + REVEAL + REACT_DELAY : undefined;\n items.push({\n index,\n from: \"them\",\n text: message.text,\n reaction: hasReaction ? message.reaction : undefined,\n time: message.time,\n presenceStart: revealAt,\n typingStart,\n revealAt,\n reactAt,\n });\n cursor =\n revealAt + REVEAL + (hasReaction ? REACT_DELAY + REACT_DUR : 0) + MSG_GAP;\n }\n });\n\n const duration = Math.max(cursor - MSG_GAP + TAIL, LEAD_IN + TAIL);\n return { items, duration };\n}\n\nexport function telegramChatFlowDuration(\n messages: TelegramMessage[] = DEFAULT_MESSAGES,\n speed = 1,\n): number {\n const raw = telegramChatFlowSchedule(messages).duration;\n return Math.ceil(raw / (speed <= 0 ? 1 : speed));\n}\n\nexport function sendPulse(items: ScheduledMessage[], eff: number): number {\n let best = 0;\n for (const item of items) {\n if (item.sendAt === undefined) continue;\n const distance = Math.abs(eff - item.sendAt);\n if (distance <= PRESS_WINDOW) {\n best = Math.max(best, 1 - distance / PRESS_WINDOW);\n }\n }\n return best;\n}\n\nfunction Avatar({ contact, size }: { contact: TelegramContact; size: number }) {\n const initial = contact.name.trim().charAt(0).toUpperCase();\n return (\n <div\n style={{\n flexShrink: 0,\n width: size,\n height: size,\n minWidth: size,\n borderRadius: \"50%\",\n overflow: \"hidden\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: `linear-gradient(180deg, #72d5fd 0%, ${TELEGRAM_BLUE} 100%)`,\n color: \"#ffffff\",\n fontSize: size * 0.42,\n fontWeight: 600,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {contact.avatar !== undefined ? (\n <img\n src={contact.avatar}\n alt={contact.name}\n style={{ width: \"100%\", height: \"100%\", objectFit: \"cover\" }}\n />\n ) : (\n initial\n )}\n </div>\n );\n}\n\nfunction DoubleCheck({ color }: { color: string }) {\n return (\n <svg\n width={16}\n height={16}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M18 6 7 17l-5-5\" />\n <path d=\"m22 10-7.5 7.5L13 16\" />\n </svg>\n );\n}\n\nfunction PaperPlane({ color }: { color: string }) {\n return (\n <svg\n width={20}\n height={20}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z\" />\n <path d=\"m21.854 2.147-10.94 10.939\" />\n </svg>\n );\n}\n\nfunction MicIcon({ color }: { color: string }) {\n return (\n <svg\n width={22}\n height={22}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M12 19v3\" />\n <path d=\"M19 10v2a7 7 0 0 1-14 0v-2\" />\n <rect x={9} y={2} width={6} height={13} rx={3} />\n </svg>\n );\n}\n\nfunction SmileIcon({ color }: { color: string }) {\n return (\n <svg\n width={22}\n height={22}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx={12} cy={12} r={10} />\n <path d=\"M8 14s1.5 2 4 2 4-2 4-2\" />\n <line x1={9} x2={9.01} y1={9} y2={9} />\n <line x1={15} x2={15.01} y1={9} y2={9} />\n </svg>\n );\n}\n\nfunction AttachIcon({ color }: { color: string }) {\n return (\n <svg\n width={22}\n height={22}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551\" />\n </svg>\n );\n}\n\nfunction PhoneIcon({ color }: { color: string }) {\n return (\n <svg\n width={22}\n height={22}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384\" />\n </svg>\n );\n}\n\nfunction MoreIcon({ color }: { color: string }) {\n return (\n <svg\n width={22}\n height={22}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx={12} cy={12} r={1} />\n <circle cx={12} cy={5} r={1} />\n <circle cx={12} cy={19} r={1} />\n </svg>\n );\n}\n\nfunction BubbleTail({ side, color }: { side: \"left\" | \"right\"; color: string }) {\n const path =\n side === \"right\"\n ? \"M0 0 H4 C4 7 7 12 13 13 C6 13 0 9 0 0 Z\"\n : \"M13 0 H9 C9 7 6 12 0 13 C7 13 13 9 13 0 Z\";\n return (\n <svg\n width={13}\n height={13}\n viewBox=\"0 0 13 13\"\n style={{\n position: \"absolute\",\n bottom: 0,\n left: side === \"left\" ? -6 : undefined,\n right: side === \"right\" ? -6 : undefined,\n }}\n >\n <path d={path} fill={color} />\n </svg>\n );\n}\n\nexport function TelegramChatFlow({\n messages = DEFAULT_MESSAGES,\n contact,\n accentColor,\n speed = 1,\n}: TelegramChatFlowProps) {\n const frame = useCurrentFrame();\n const eff = frame * speed;\n const accent = accentColor ?? TELEGRAM_BLUE;\n\n const { items } = telegramChatFlowSchedule(messages);\n\n const activeMe = items.find(\n (item) =>\n item.from === \"me\" &&\n item.typeStart !== undefined &&\n item.sendAt !== undefined &&\n eff >= item.typeStart &&\n eff < item.sendAt,\n );\n let composerText = \"\";\n let typing = false;\n if (\n activeMe &&\n activeMe.typeStart !== undefined &&\n activeMe.sendAt !== undefined\n ) {\n const typeDur = Math.max(activeMe.sendAt - SEND_GAP - activeMe.typeStart, 1);\n const progress = clamp((eff - activeMe.typeStart) / typeDur, 0, 1);\n composerText = revealedText(\n activeMe.text,\n Math.floor(progress * activeMe.text.length),\n );\n typing = true;\n }\n\n const themTyping = items.some(\n (item) =>\n item.from === \"them\" &&\n item.typingStart !== undefined &&\n eff >= item.typingStart &&\n eff < item.revealAt,\n );\n\n const sendActive = composerText.length > 0;\n const sendScale = 1 - 0.16 * sendPulse(items, eff);\n const present = items.filter((item) => eff >= item.presenceStart);\n\n return (\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n justifyContent: \"center\",\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n width: \"100%\",\n maxWidth: MOBILE_WIDTH,\n height: \"100%\",\n boxSizing: \"border-box\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 12,\n padding: \"12px 14px\",\n background: \"#ffffff\",\n boxShadow: \"0 1px 0 rgba(0,0,0,0.06)\",\n }}\n >\n {contact !== undefined && (\n <Avatar contact={contact} size={38} />\n )}\n <div style={{ display: \"flex\", flexDirection: \"column\", gap: 0, flex: 1 }}>\n <span\n style={{\n fontSize: 15,\n fontWeight: 600,\n lineHeight: 1.2,\n letterSpacing: \"-0.01em\",\n color: \"#0f1419\",\n }}\n >\n {contact?.name ?? \"Chat\"}\n </span>\n <span\n style={{\n fontSize: 13,\n lineHeight: 1.15,\n color: accent,\n fontStyle: themTyping ? \"italic\" : \"normal\",\n }}\n >\n {themTyping ? \"typing…\" : \"online\"}\n </span>\n </div>\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 18 }}>\n <PhoneIcon color=\"#8a99a5\" />\n <MoreIcon color=\"#8a99a5\" />\n </div>\n </div>\n\n <div\n style={{\n position: \"relative\",\n flex: 1,\n minHeight: 0,\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flex-end\",\n gap: 4,\n minHeight: \"100%\",\n padding: \"16px 12px 14px\",\n }}\n >\n <div style={{ display: \"flex\", justifyContent: \"center\", marginBottom: 8 }}>\n <span\n style={{\n padding: \"3px 11px\",\n borderRadius: 14,\n background: \"rgba(0,0,0,0.18)\",\n color: \"#ffffff\",\n fontSize: 12,\n fontWeight: 500,\n }}\n >\n Today\n </span>\n </div>\n {present.map((item) => (\n <TelegramRow\n key={item.index}\n item={item}\n eff={eff}\n contact={contact}\n accent={accent}\n />\n ))}\n </div>\n </div>\n\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-end\",\n gap: 8,\n padding: \"8px 10px 12px\",\n background: \"#ffffff\",\n boxShadow: \"0 -1px 0 rgba(0,0,0,0.06)\",\n }}\n >\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n minHeight: 44,\n padding: \"0 12px\",\n borderRadius: 22,\n background: \"#f1f3f5\",\n }}\n >\n <SmileIcon color=\"#8a99a5\" />\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n fontSize: 15,\n color: sendActive ? \"#0f1419\" : \"#8a99a5\",\n }}\n >\n <span style={{ whiteSpace: \"pre-wrap\", wordBreak: \"break-word\" }}>\n {sendActive ? composerText : \"Message\"}\n </span>\n {typing && (\n <Caret\n color={accent}\n height={18}\n radius={1}\n blink\n marginLeft={composerText.length > 0 ? 2 : 0}\n />\n )}\n </div>\n <AttachIcon color=\"#8a99a5\" />\n </div>\n <div\n style={{\n flexShrink: 0,\n width: 46,\n height: 46,\n borderRadius: \"50%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: accent,\n transform: `scale(${sendScale})`,\n }}\n >\n {sendActive ? (\n <PaperPlane color=\"#ffffff\" />\n ) : (\n <MicIcon color=\"#ffffff\" />\n )}\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nfunction TelegramRow({\n item,\n eff,\n contact,\n accent,\n}: {\n item: ScheduledMessage;\n eff: number;\n contact?: TelegramContact;\n accent: string;\n}) {\n const { fps } = useVideoConfig();\n const outgoing = item.from === \"me\";\n\n const enter = spring({\n fps,\n frame: eff - item.revealAt,\n config: { damping: 16, stiffness: 200, mass: 0.7 },\n });\n const opacity = interpolate(enter, [0, 1], [0, 1]);\n const translateY = interpolate(enter, [0, 1], [10, 0]);\n const scale = interpolate(enter, [0, 1], [0.92, 1]);\n\n let reactionScale = 0;\n let reactionOpacity = 0;\n if (item.reactAt !== undefined) {\n reactionScale = spring({\n fps,\n frame: eff - item.reactAt,\n config: { damping: 11, stiffness: 220, mass: 0.6 },\n });\n reactionOpacity = interpolate(eff, [item.reactAt, item.reactAt + 5], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n }\n\n const bg = outgoing ? accent : INCOMING_BG;\n const fg = outgoing ? OUTGOING_FG : INCOMING_FG;\n const metaColor = outgoing ? OUTGOING_META : INCOMING_META;\n const tailColor = outgoing ? accent : INCOMING_BG;\n\n const bubble = (\n <div\n style={{\n position: \"relative\",\n maxWidth: \"76%\",\n padding: \"6px 11px 7px\",\n background: bg,\n color: fg,\n borderRadius: 16,\n borderBottomRightRadius: outgoing ? 6 : 16,\n borderBottomLeftRadius: outgoing ? 16 : 6,\n boxShadow: outgoing ? \"none\" : \"0 1px 1px rgba(0,0,0,0.1)\",\n fontSize: 15,\n lineHeight: 1.35,\n }}\n >\n <span style={{ wordBreak: \"break-word\", overflowWrap: \"break-word\" }}>\n {item.text}\n </span>\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: item.reaction !== undefined ? \"space-between\" : \"flex-end\",\n gap: 8,\n marginTop: 2,\n }}\n >\n {item.reaction !== undefined && (\n <span\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 4,\n padding: \"1px 7px\",\n borderRadius: 11,\n background: outgoing ? \"rgba(255,255,255,0.22)\" : \"rgba(51,144,236,0.12)\",\n color: outgoing ? \"#ffffff\" : accent,\n fontSize: 13,\n fontWeight: 600,\n opacity: reactionOpacity,\n transform: `scale(${reactionScale})`,\n transformOrigin: \"left center\",\n }}\n >\n {item.reaction} 1\n </span>\n )}\n <span\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 3,\n fontSize: 12,\n color: metaColor,\n whiteSpace: \"nowrap\",\n }}\n >\n {item.time ?? \"9:41\"}\n {outgoing && <DoubleCheck color={metaColor} />}\n </span>\n </div>\n <BubbleTail side={outgoing ? \"right\" : \"left\"} color={tailColor} />\n </div>\n );\n\n return (\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-end\",\n justifyContent: outgoing ? \"flex-end\" : \"flex-start\",\n gap: 7,\n width: \"100%\",\n opacity,\n transform: `translateY(${translateY}px) scale(${scale})`,\n transformOrigin: outgoing ? \"bottom right\" : \"bottom left\",\n }}\n >\n {!outgoing && contact !== undefined && (\n <Avatar contact={contact} size={30} />\n )}\n {bubble}\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport { interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\nimport { Caret } from \"@/components/remocn/caret\";\nimport { type RemocnTheme, revealedText } from \"@/lib/remocn-ui\";\n\nexport interface TelegramMessage {\n from: \"me\" | \"them\";\n text: string;\n reaction?: string;\n time?: string;\n}\n\nexport interface TelegramContact {\n name: string;\n avatar?: string;\n}\n\nexport interface TelegramChatFlowProps {\n messages?: TelegramMessage[];\n contact?: TelegramContact;\n accentColor?: string;\n speed?: number;\n theme?: Partial<RemocnTheme>;\n}\n\nconst MOBILE_WIDTH = 460;\nconst LEAD_IN = 12;\nconst FRAMES_PER_CHAR = 2.2;\nconst MIN_TYPE = 18;\nconst MAX_TYPE = 86;\nconst SEND_GAP = 10;\nconst REVEAL = 14;\nconst REACT_DELAY = 8;\nconst REACT_DUR = 14;\nconst MSG_GAP = 16;\nconst TYPING_MIN = 34;\nconst TYPING_MAX = 70;\nconst TAIL = 28;\nconst PRESS_WINDOW = 7;\n\nconst TELEGRAM_BLUE = \"#3390ec\";\nconst INCOMING_BG = \"#ffffff\";\nconst INCOMING_FG = \"#0f1419\";\nconst INCOMING_META = \"#8a99a5\";\nconst OUTGOING_FG = \"#ffffff\";\nconst OUTGOING_META = \"rgba(255,255,255,0.82)\";\n\nconst DEFAULT_MESSAGES: TelegramMessage[] = [\n { from: \"me\", text: \"Hey — ready for the demo?\", time: \"9:40\" },\n {\n from: \"them\",\n text: \"Yep, pushing it live now\",\n reaction: \"🔥\",\n time: \"9:41\",\n },\n {\n from: \"me\",\n text: \"Perfect, sending the link over\",\n reaction: \"👍\",\n time: \"9:41\",\n },\n];\n\nfunction clamp(value: number, lo: number, hi: number): number {\n return Math.max(lo, Math.min(hi, value));\n}\n\nexport interface ScheduledMessage {\n index: number;\n from: \"me\" | \"them\";\n text: string;\n reaction?: string;\n time?: string;\n presenceStart: number;\n typeStart?: number;\n sendAt?: number;\n typingStart?: number;\n revealAt: number;\n reactAt?: number;\n}\n\nexport interface TelegramChatFlowSchedule {\n items: ScheduledMessage[];\n duration: number;\n}\n\nexport function telegramChatFlowSchedule(\n messages: TelegramMessage[],\n): TelegramChatFlowSchedule {\n const items: ScheduledMessage[] = [];\n let cursor = LEAD_IN;\n\n messages.forEach((message, index) => {\n const hasReaction =\n message.reaction !== undefined && message.reaction !== \"\";\n if (message.from === \"me\") {\n const typeStart = cursor;\n const typeDur = clamp(\n Math.round(message.text.length * FRAMES_PER_CHAR),\n MIN_TYPE,\n MAX_TYPE,\n );\n const sendAt = typeStart + typeDur + SEND_GAP;\n const revealAt = sendAt;\n const reactAt = hasReaction ? revealAt + REVEAL + REACT_DELAY : undefined;\n items.push({\n index,\n from: \"me\",\n text: message.text,\n reaction: hasReaction ? message.reaction : undefined,\n time: message.time,\n presenceStart: sendAt - 2,\n typeStart,\n sendAt,\n revealAt,\n reactAt,\n });\n cursor =\n revealAt +\n REVEAL +\n (hasReaction ? REACT_DELAY + REACT_DUR : 0) +\n MSG_GAP;\n } else {\n const typingStart = cursor;\n const typingDur = clamp(\n Math.round(message.text.length * FRAMES_PER_CHAR),\n TYPING_MIN,\n TYPING_MAX,\n );\n const revealAt = typingStart + typingDur;\n const reactAt = hasReaction ? revealAt + REVEAL + REACT_DELAY : undefined;\n items.push({\n index,\n from: \"them\",\n text: message.text,\n reaction: hasReaction ? message.reaction : undefined,\n time: message.time,\n presenceStart: revealAt,\n typingStart,\n revealAt,\n reactAt,\n });\n cursor =\n revealAt +\n REVEAL +\n (hasReaction ? REACT_DELAY + REACT_DUR : 0) +\n MSG_GAP;\n }\n });\n\n const duration = Math.max(cursor - MSG_GAP + TAIL, LEAD_IN + TAIL);\n return { items, duration };\n}\n\nexport function telegramChatFlowDuration(\n messages: TelegramMessage[] = DEFAULT_MESSAGES,\n speed = 1,\n): number {\n const raw = telegramChatFlowSchedule(messages).duration;\n return Math.ceil(raw / (speed <= 0 ? 1 : speed));\n}\n\nexport function sendPulse(items: ScheduledMessage[], eff: number): number {\n let best = 0;\n for (const item of items) {\n if (item.sendAt === undefined) continue;\n const distance = Math.abs(eff - item.sendAt);\n if (distance <= PRESS_WINDOW) {\n best = Math.max(best, 1 - distance / PRESS_WINDOW);\n }\n }\n return best;\n}\n\nfunction Avatar({ contact, size }: { contact: TelegramContact; size: number }) {\n const initial = contact.name.trim().charAt(0).toUpperCase();\n return (\n <div\n style={{\n flexShrink: 0,\n width: size,\n height: size,\n minWidth: size,\n borderRadius: \"50%\",\n overflow: \"hidden\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: `linear-gradient(180deg, #72d5fd 0%, ${TELEGRAM_BLUE} 100%)`,\n color: \"#ffffff\",\n fontSize: size * 0.42,\n fontWeight: 600,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {contact.avatar !== undefined ? (\n // biome-ignore lint/performance/noImgElement: Remotion output, not a Next.js app — next/image isn't available where this component ships\n <img\n src={contact.avatar}\n alt={contact.name}\n style={{ width: \"100%\", height: \"100%\", objectFit: \"cover\" }}\n />\n ) : (\n initial\n )}\n </div>\n );\n}\n\nfunction DoubleCheck({ color }: { color: string }) {\n return (\n <svg\n width={16}\n height={16}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M18 6 7 17l-5-5\" />\n <path d=\"m22 10-7.5 7.5L13 16\" />\n </svg>\n );\n}\n\nfunction PaperPlane({ color }: { color: string }) {\n return (\n <svg\n width={20}\n height={20}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z\" />\n <path d=\"m21.854 2.147-10.94 10.939\" />\n </svg>\n );\n}\n\nfunction MicIcon({ color }: { color: string }) {\n return (\n <svg\n width={22}\n height={22}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M12 19v3\" />\n <path d=\"M19 10v2a7 7 0 0 1-14 0v-2\" />\n <rect x={9} y={2} width={6} height={13} rx={3} />\n </svg>\n );\n}\n\nfunction SmileIcon({ color }: { color: string }) {\n return (\n <svg\n width={22}\n height={22}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx={12} cy={12} r={10} />\n <path d=\"M8 14s1.5 2 4 2 4-2 4-2\" />\n <line x1={9} x2={9.01} y1={9} y2={9} />\n <line x1={15} x2={15.01} y1={9} y2={9} />\n </svg>\n );\n}\n\nfunction AttachIcon({ color }: { color: string }) {\n return (\n <svg\n width={22}\n height={22}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551\" />\n </svg>\n );\n}\n\nfunction PhoneIcon({ color }: { color: string }) {\n return (\n <svg\n width={22}\n height={22}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <path d=\"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384\" />\n </svg>\n );\n}\n\nfunction MoreIcon({ color }: { color: string }) {\n return (\n <svg\n width={22}\n height={22}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n >\n <circle cx={12} cy={12} r={1} />\n <circle cx={12} cy={5} r={1} />\n <circle cx={12} cy={19} r={1} />\n </svg>\n );\n}\n\nfunction BubbleTail({\n side,\n color,\n}: {\n side: \"left\" | \"right\";\n color: string;\n}) {\n const path =\n side === \"right\"\n ? \"M0 0 H4 C4 7 7 12 13 13 C6 13 0 9 0 0 Z\"\n : \"M13 0 H9 C9 7 6 12 0 13 C7 13 13 9 13 0 Z\";\n return (\n <svg\n width={13}\n height={13}\n viewBox=\"0 0 13 13\"\n style={{\n position: \"absolute\",\n bottom: 0,\n left: side === \"left\" ? -6 : undefined,\n right: side === \"right\" ? -6 : undefined,\n }}\n >\n <path d={path} fill={color} />\n </svg>\n );\n}\n\nexport function TelegramChatFlow({\n messages = DEFAULT_MESSAGES,\n contact,\n accentColor,\n speed = 1,\n}: TelegramChatFlowProps) {\n const frame = useCurrentFrame();\n const eff = frame * speed;\n const accent = accentColor ?? TELEGRAM_BLUE;\n\n const { items } = telegramChatFlowSchedule(messages);\n\n const activeMe = items.find(\n (item) =>\n item.from === \"me\" &&\n item.typeStart !== undefined &&\n item.sendAt !== undefined &&\n eff >= item.typeStart &&\n eff < item.sendAt,\n );\n let composerText = \"\";\n let typing = false;\n if (\n activeMe &&\n activeMe.typeStart !== undefined &&\n activeMe.sendAt !== undefined\n ) {\n const typeDur = Math.max(\n activeMe.sendAt - SEND_GAP - activeMe.typeStart,\n 1,\n );\n const progress = clamp((eff - activeMe.typeStart) / typeDur, 0, 1);\n composerText = revealedText(\n activeMe.text,\n Math.floor(progress * activeMe.text.length),\n );\n typing = true;\n }\n\n const themTyping = items.some(\n (item) =>\n item.from === \"them\" &&\n item.typingStart !== undefined &&\n eff >= item.typingStart &&\n eff < item.revealAt,\n );\n\n const sendActive = composerText.length > 0;\n const sendScale = 1 - 0.16 * sendPulse(items, eff);\n const present = items.filter((item) => eff >= item.presenceStart);\n\n return (\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n justifyContent: \"center\",\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n width: \"100%\",\n maxWidth: MOBILE_WIDTH,\n height: \"100%\",\n boxSizing: \"border-box\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 12,\n padding: \"12px 14px\",\n background: \"#ffffff\",\n boxShadow: \"0 1px 0 rgba(0,0,0,0.06)\",\n }}\n >\n {contact !== undefined && <Avatar contact={contact} size={38} />}\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 0,\n flex: 1,\n }}\n >\n <span\n style={{\n fontSize: 15,\n fontWeight: 600,\n lineHeight: 1.2,\n letterSpacing: \"-0.01em\",\n color: \"#0f1419\",\n }}\n >\n {contact?.name ?? \"Chat\"}\n </span>\n <span\n style={{\n fontSize: 13,\n lineHeight: 1.15,\n color: accent,\n fontStyle: themTyping ? \"italic\" : \"normal\",\n }}\n >\n {themTyping ? \"typing…\" : \"online\"}\n </span>\n </div>\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 18 }}>\n <PhoneIcon color=\"#8a99a5\" />\n <MoreIcon color=\"#8a99a5\" />\n </div>\n </div>\n\n <div\n style={{\n position: \"relative\",\n flex: 1,\n minHeight: 0,\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n justifyContent: \"flex-end\",\n gap: 4,\n minHeight: \"100%\",\n padding: \"16px 12px 14px\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n justifyContent: \"center\",\n marginBottom: 8,\n }}\n >\n <span\n style={{\n padding: \"3px 11px\",\n borderRadius: 14,\n background: \"rgba(0,0,0,0.18)\",\n color: \"#ffffff\",\n fontSize: 12,\n fontWeight: 500,\n }}\n >\n Today\n </span>\n </div>\n {present.map((item) => (\n <TelegramRow\n key={item.index}\n item={item}\n eff={eff}\n contact={contact}\n accent={accent}\n />\n ))}\n </div>\n </div>\n\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-end\",\n gap: 8,\n padding: \"8px 10px 12px\",\n background: \"#ffffff\",\n boxShadow: \"0 -1px 0 rgba(0,0,0,0.06)\",\n }}\n >\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n minHeight: 44,\n padding: \"0 12px\",\n borderRadius: 22,\n background: \"#f1f3f5\",\n }}\n >\n <SmileIcon color=\"#8a99a5\" />\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n fontSize: 15,\n color: sendActive ? \"#0f1419\" : \"#8a99a5\",\n }}\n >\n <span style={{ whiteSpace: \"pre-wrap\", wordBreak: \"break-word\" }}>\n {sendActive ? composerText : \"Message\"}\n </span>\n {typing && (\n <Caret\n color={accent}\n height={18}\n radius={1}\n blink\n marginLeft={composerText.length > 0 ? 2 : 0}\n />\n )}\n </div>\n <AttachIcon color=\"#8a99a5\" />\n </div>\n <div\n style={{\n flexShrink: 0,\n width: 46,\n height: 46,\n borderRadius: \"50%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: accent,\n transform: `scale(${sendScale})`,\n }}\n >\n {sendActive ? (\n <PaperPlane color=\"#ffffff\" />\n ) : (\n <MicIcon color=\"#ffffff\" />\n )}\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nfunction TelegramRow({\n item,\n eff,\n contact,\n accent,\n}: {\n item: ScheduledMessage;\n eff: number;\n contact?: TelegramContact;\n accent: string;\n}) {\n const { fps } = useVideoConfig();\n const outgoing = item.from === \"me\";\n\n const enter = spring({\n fps,\n frame: eff - item.revealAt,\n config: { damping: 16, stiffness: 200, mass: 0.7 },\n });\n const opacity = interpolate(enter, [0, 1], [0, 1]);\n const translateY = interpolate(enter, [0, 1], [10, 0]);\n const scale = interpolate(enter, [0, 1], [0.92, 1]);\n\n let reactionScale = 0;\n let reactionOpacity = 0;\n if (item.reactAt !== undefined) {\n reactionScale = spring({\n fps,\n frame: eff - item.reactAt,\n config: { damping: 11, stiffness: 220, mass: 0.6 },\n });\n reactionOpacity = interpolate(\n eff,\n [item.reactAt, item.reactAt + 5],\n [0, 1],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n },\n );\n }\n\n const bg = outgoing ? accent : INCOMING_BG;\n const fg = outgoing ? OUTGOING_FG : INCOMING_FG;\n const metaColor = outgoing ? OUTGOING_META : INCOMING_META;\n const tailColor = outgoing ? accent : INCOMING_BG;\n\n const bubble = (\n <div\n style={{\n position: \"relative\",\n maxWidth: \"76%\",\n padding: \"6px 11px 7px\",\n background: bg,\n color: fg,\n borderRadius: 16,\n borderBottomRightRadius: outgoing ? 6 : 16,\n borderBottomLeftRadius: outgoing ? 16 : 6,\n boxShadow: outgoing ? \"none\" : \"0 1px 1px rgba(0,0,0,0.1)\",\n fontSize: 15,\n lineHeight: 1.35,\n }}\n >\n <span style={{ wordBreak: \"break-word\", overflowWrap: \"break-word\" }}>\n {item.text}\n </span>\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent:\n item.reaction !== undefined ? \"space-between\" : \"flex-end\",\n gap: 8,\n marginTop: 2,\n }}\n >\n {item.reaction !== undefined && (\n <span\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 4,\n padding: \"1px 7px\",\n borderRadius: 11,\n background: outgoing\n ? \"rgba(255,255,255,0.22)\"\n : \"rgba(51,144,236,0.12)\",\n color: outgoing ? \"#ffffff\" : accent,\n fontSize: 13,\n fontWeight: 600,\n opacity: reactionOpacity,\n transform: `scale(${reactionScale})`,\n transformOrigin: \"left center\",\n }}\n >\n {item.reaction} 1\n </span>\n )}\n <span\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 3,\n fontSize: 12,\n color: metaColor,\n whiteSpace: \"nowrap\",\n }}\n >\n {item.time ?? \"9:41\"}\n {outgoing && <DoubleCheck color={metaColor} />}\n </span>\n </div>\n <BubbleTail side={outgoing ? \"right\" : \"left\"} color={tailColor} />\n </div>\n );\n\n return (\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-end\",\n justifyContent: outgoing ? \"flex-end\" : \"flex-start\",\n gap: 7,\n width: \"100%\",\n opacity,\n transform: `translateY(${translateY}px) scale(${scale})`,\n transformOrigin: outgoing ? \"bottom right\" : \"bottom left\",\n }}\n >\n {!outgoing && contact !== undefined && (\n <Avatar contact={contact} size={30} />\n )}\n {bubble}\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/telegram-chat-flow.tsx"}diff --git a/public/r/terminal-cursor-zoom.json b/public/r/terminal-cursor-zoom.jsonindex 77dae215..569f283f 100644--- a/public/r/terminal-cursor-zoom.json+++ b/public/r/terminal-cursor-zoom.json@@ -8,7 +8,7 @@"files": [{"path": "registry/remocn/terminal-cursor-zoom/index.tsx",- "content": "\"use client\";\n\nimport { AbsoluteFill, interpolate, useCurrentFrame } from \"remotion\";\n\nimport { TerminalSimulator } from \"@/components/remocn/terminal-simulator\";\n\nexport interface TerminalCursorZoomProps {\n command?: string;\n zoom?: number;\n fontSize?: number;\n prompt?: string;\n title?: string;\n charsPerFrame?: number;\n chunkSize?: number;\n speed?: number;\n className?: string;\n}\n\nconst STAGE_WIDTH = 1280;\nconst STAGE_HEIGHT = 720;\nconst WINDOW_WIDTH = 900;\nconst WINDOW_HEIGHT = 480;\nconst CONTENT_PADDING = 20;\nconst CHROME_HEIGHT = 40;\nconst PROMPT_GAP = 8;\nconst FIRST_LINE_FRAME = 10;\n\nexport function TerminalCursorZoom({\n command = \"npx shadcn add @remocn/terminal-cursor-zoom\",\n zoom = 2.8,\n fontSize = 20,\n prompt = \"$\",\n title = \"~/code/remocn-demo\",\n charsPerFrame = 1,\n chunkSize = 1,\n speed = 1,\n className,\n}: TerminalCursorZoomProps) {\n const frame = useCurrentFrame();\n\n const charWidth = fontSize * 0.6;\n const windowLeft = (STAGE_WIDTH - WINDOW_WIDTH) / 2;\n const windowTop = (STAGE_HEIGHT - WINDOW_HEIGHT) / 2;\n const textStartX =\n windowLeft + CONTENT_PADDING + prompt.length * charWidth + PROMPT_GAP;\n const lineHeight = Math.round(fontSize * 1.6);\n const cursorY = windowTop + CHROME_HEIGHT + CONTENT_PADDING + lineHeight / 2;\n\n const lineStart = Math.round(FIRST_LINE_FRAME / speed);\n const localFrame = (frame - lineStart) * speed;\n const linearRevealed = Math.floor(\n interpolate(localFrame, [0, command.length / charsPerFrame], [0, command.length], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n }),\n );\n const revealed = Math.min(\n command.length,\n Math.ceil(linearRevealed / chunkSize) * chunkSize,\n );\n\n const cursorX = textStartX + revealed * charWidth;\n const tx = STAGE_WIDTH / 2 - zoom * cursorX;\n const ty = STAGE_HEIGHT / 2 - zoom * cursorY;\n\n return (\n <AbsoluteFill className={className} style={{ overflow: \"hidden\" }}>\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n width: STAGE_WIDTH,\n height: STAGE_HEIGHT,\n transform: `translate(${tx}px, ${ty}px) scale(${zoom})`,\n transformOrigin: \"0 0\",\n }}\n >\n <TerminalSimulator\n lines={[{ text: command, type: \"command\", delay: 0 }]}\n prompt={prompt}\n title={title}\n fontSize={fontSize}\n charsPerFrame={charsPerFrame}\n chunkSize={chunkSize}\n speed={speed}\n />\n </div>\n </AbsoluteFill>\n );\n}\n",+ "content": "\"use client\";\n\nimport { AbsoluteFill, interpolate, useCurrentFrame } from \"remotion\";\n\nimport { TerminalSimulator } from \"@/components/remocn/terminal-simulator\";\n\nexport interface TerminalCursorZoomProps {\n command?: string;\n zoom?: number;\n fontSize?: number;\n prompt?: string;\n title?: string;\n charsPerFrame?: number;\n chunkSize?: number;\n speed?: number;\n className?: string;\n}\n\nconst STAGE_WIDTH = 1280;\nconst STAGE_HEIGHT = 720;\nconst WINDOW_WIDTH = 900;\nconst WINDOW_HEIGHT = 480;\nconst CONTENT_PADDING = 20;\nconst CHROME_HEIGHT = 40;\nconst PROMPT_GAP = 8;\nconst FIRST_LINE_FRAME = 10;\n\nexport function TerminalCursorZoom({\n command = \"npx shadcn add @remocn/terminal-cursor-zoom\",\n zoom = 2.8,\n fontSize = 20,\n prompt = \"$\",\n title = \"~/code/remocn-demo\",\n charsPerFrame = 1,\n chunkSize = 1,\n speed = 1,\n className,\n}: TerminalCursorZoomProps) {\n const frame = useCurrentFrame();\n\n const charWidth = fontSize * 0.6;\n const windowLeft = (STAGE_WIDTH - WINDOW_WIDTH) / 2;\n const windowTop = (STAGE_HEIGHT - WINDOW_HEIGHT) / 2;\n const textStartX =\n windowLeft + CONTENT_PADDING + prompt.length * charWidth + PROMPT_GAP;\n const lineHeight = Math.round(fontSize * 1.6);\n const cursorY = windowTop + CHROME_HEIGHT + CONTENT_PADDING + lineHeight / 2;\n\n const lineStart = Math.round(FIRST_LINE_FRAME / speed);\n const localFrame = (frame - lineStart) * speed;\n const linearRevealed = Math.floor(\n interpolate(\n localFrame,\n [0, command.length / charsPerFrame],\n [0, command.length],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n },\n ),\n );\n const revealed = Math.min(\n command.length,\n Math.ceil(linearRevealed / chunkSize) * chunkSize,\n );\n\n const cursorX = textStartX + revealed * charWidth;\n const tx = STAGE_WIDTH / 2 - zoom * cursorX;\n const ty = STAGE_HEIGHT / 2 - zoom * cursorY;\n\n return (\n <AbsoluteFill className={className} style={{ overflow: \"hidden\" }}>\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n width: STAGE_WIDTH,\n height: STAGE_HEIGHT,\n transform: `translate(${tx}px, ${ty}px) scale(${zoom})`,\n transformOrigin: \"0 0\",\n }}\n >\n <TerminalSimulator\n lines={[{ text: command, type: \"command\", delay: 0 }]}\n prompt={prompt}\n title={title}\n fontSize={fontSize}\n charsPerFrame={charsPerFrame}\n chunkSize={chunkSize}\n speed={speed}\n />\n </div>\n </AbsoluteFill>\n );\n}\n","type": "registry:component","target": "components/remocn/terminal-cursor-zoom.tsx"}diff --git a/public/r/terminal-simulator.json b/public/r/terminal-simulator.jsonindex 65703976..f12f0d51 100644--- a/public/r/terminal-simulator.json+++ b/public/r/terminal-simulator.json@@ -7,7 +7,7 @@"files": [{"path": "registry/remocn/terminal-simulator/index.tsx",- "content": "\"use client\";\n\nimport {\n Sequence,\n interpolate,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type TerminalLineType = \"command\" | \"log\" | \"success\" | \"error\";\n\nexport interface TerminalLine {\n text: string;\n type: TerminalLineType;\n delay?: number;\n /**\n * Extra freeze-frame pause AFTER this line finishes typing, in frames.\n * Use this to build dramatic tension before the next batch of logs.\n * If omitted, lines whose text ends in \"...\" auto-freeze for 18 frames.\n */\n pause?: number;\n}\n\nexport interface TerminalSimulatorProps {\n lines?: TerminalLine[];\n prompt?: string;\n title?: string;\n background?: string;\n chromeColor?: string;\n fontSize?: number;\n /**\n * Reveal speed. Despite the name, the reveal is now CHUNKED — each\n * `1 / charsPerFrame` frames bumps the cursor by `chunkSize` characters,\n * so output appears in bursts instead of dripping char-by-char.\n */\n charsPerFrame?: number;\n /** Characters revealed per step. */\n chunkSize?: number;\n speed?: number;\n className?: string;\n}\n\nconst DEFAULT_LINES: TerminalLine[] = [\n { text: \"npm run build\", type: \"command\", delay: 0 },\n { text: \"Resolving dependencies...\", type: \"log\", delay: 6 },\n { text: \"> [email protected] build\", type: \"log\", delay: 4 },\n { text: \"> next build\", type: \"log\", delay: 4 },\n { text: \"Compiling...\", type: \"log\", delay: 12 },\n { text: \"Compiled successfully in 4.2s\", type: \"success\", delay: 14 },\n { text: \"Generating static pages (24/24)\", type: \"log\", delay: 10 },\n { text: \"Build completed without errors\", type: \"success\", delay: 12 },\n];\n\nconst TYPE_COLORS: Record<TerminalLineType, string> = {\n command: \"#fafafa\",\n log: \"#a1a1aa\",\n success: \"#22c55e\",\n error: \"#ef4444\",\n};\n\n/** Auto freeze-frame heuristic: any line ending in \"...\" holds the camera. */\nfunction autoPause(line: TerminalLine): number {\n if (line.pause !== undefined) return line.pause;\n if (line.text.trimEnd().endsWith(\"...\")) return 18;\n return 0;\n}\n\nexport function TerminalSimulator({\n lines = DEFAULT_LINES,\n prompt = \"$\",\n title = \"~/projects/remocn\",\n background = \"#0a0a0a\",\n chromeColor = \"#1a1a1a\",\n fontSize = 18,\n charsPerFrame = 1,\n chunkSize = 1,\n speed = 1,\n className,\n}: TerminalSimulatorProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const lineHeight = Math.round(fontSize * 1.6);\n const visibleLines = 8;\n const windowWidth = 900;\n const windowHeight = 480;\n\n // Compute cumulative start frames for each line, including auto/explicit\n // pauses AFTER a line finishes typing.\n const starts: number[] = [];\n let acc = 10;\n for (let i = 0; i < lines.length; i++) {\n const delay = lines[i].delay ?? 8;\n acc += delay;\n starts.push(acc);\n // Approximate typing duration (in frames) for chunked output.\n const typingFrames = Math.ceil(\n lines[i].text.length / (chunkSize * charsPerFrame),\n );\n acc += typingFrames + autoPause(lines[i]);\n }\n\n // STEP-FUNCTION scroll. Each overflowing line snaps the buffer up by\n // exactly one lineHeight on the frame it begins. No interpolation, no\n // easing — terminals do not glide.\n let translateY = 0;\n for (let i = visibleLines; i < lines.length; i++) {\n if (frame >= starts[i]) {\n translateY -= lineHeight;\n }\n }\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: windowWidth,\n height: windowHeight,\n background,\n borderRadius: 12,\n overflow: \"hidden\",\n boxShadow:\n \"0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.06)\",\n display: \"flex\",\n flexDirection: \"column\",\n fontFamily:\n \"var(--font-geist-mono), ui-monospace, SFMono-Regular, monospace\",\n }}\n >\n {/* Chrome */}\n <div\n style={{\n height: 40,\n background: chromeColor,\n display: \"flex\",\n alignItems: \"center\",\n padding: \"0 16px\",\n gap: 8,\n borderBottom: \"1px solid rgba(255,255,255,0.06)\",\n }}\n >\n <Light color=\"#ff5f57\" />\n <Light color=\"#febc2e\" />\n <Light color=\"#28c840\" />\n <div\n style={{\n flex: 1,\n textAlign: \"center\",\n color: \"#71717a\",\n fontSize: 13,\n }}\n >\n {title}\n </div>\n </div>\n\n {/* Content */}\n <div\n style={{\n flex: 1,\n padding: 20,\n overflow: \"hidden\",\n position: \"relative\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 20,\n right: 20,\n top: 20,\n transform: `translateY(${translateY}px)`,\n }}\n >\n {lines.map((line, index) => (\n <Sequence\n key={index}\n from={Math.round(starts[index] / speed)}\n layout=\"none\"\n >\n <TerminalLineRow\n line={line}\n prompt={prompt}\n fontSize={fontSize}\n lineHeight={lineHeight}\n charsPerFrame={charsPerFrame}\n chunkSize={chunkSize}\n fps={fps}\n speed={speed}\n />\n </Sequence>\n ))}\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nfunction Light({ color }: { color: string }) {\n return (\n <div\n style={{\n width: 12,\n height: 12,\n borderRadius: \"50%\",\n background: color,\n opacity: 0.85,\n }}\n />\n );\n}\n\nfunction TerminalLineRow({\n line,\n prompt,\n fontSize,\n lineHeight,\n charsPerFrame,\n chunkSize,\n fps,\n speed,\n}: {\n line: TerminalLine;\n prompt: string;\n fontSize: number;\n lineHeight: number;\n charsPerFrame: number;\n chunkSize: number;\n fps: number;\n speed: number;\n}) {\n const localFrame = useCurrentFrame() * speed;\n const totalChars = line.text.length;\n\n // Chunked reveal: Math.floor of an interpolated count, then snapped to the\n // nearest multiple of `chunkSize`. This is what gives the bursty terminal\n // feel — text doesn't drip, it lurches.\n const linearRevealed = Math.floor(\n interpolate(localFrame, [0, totalChars / charsPerFrame], [0, totalChars], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n }),\n );\n const revealed = Math.min(\n totalChars,\n Math.ceil(linearRevealed / chunkSize) * chunkSize,\n );\n const visible = line.text.substring(0, revealed);\n const typingDone = revealed >= totalChars;\n // 2 Hz blink at any framerate.\n const cursorVisible = Math.floor((localFrame / fps) * 2) % 2 === 0;\n\n return (\n <div\n style={{\n height: lineHeight,\n fontSize,\n color: TYPE_COLORS[line.type],\n display: \"flex\",\n alignItems: \"center\",\n whiteSpace: \"pre\",\n }}\n >\n {line.type === \"command\" && (\n <span style={{ color: \"#22c55e\", marginRight: 8 }}>{prompt}</span>\n )}\n <span>{visible}</span>\n {!typingDone && cursorVisible && (\n <span\n style={{\n display: \"inline-block\",\n width: fontSize * 0.55,\n height: fontSize,\n background: TYPE_COLORS[line.type],\n marginLeft: 2,\n }}\n />\n )}\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport {\n interpolate,\n Sequence,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport type TerminalLineType = \"command\" | \"log\" | \"success\" | \"error\";\n\nexport interface TerminalLine {\n text: string;\n type: TerminalLineType;\n delay?: number;\n /**\n * Extra freeze-frame pause AFTER this line finishes typing, in frames.\n * Use this to build dramatic tension before the next batch of logs.\n * If omitted, lines whose text ends in \"...\" auto-freeze for 18 frames.\n */\n pause?: number;\n}\n\nexport interface TerminalSimulatorProps {\n lines?: TerminalLine[];\n prompt?: string;\n title?: string;\n background?: string;\n chromeColor?: string;\n fontSize?: number;\n /**\n * Reveal speed. Despite the name, the reveal is now CHUNKED — each\n * `1 / charsPerFrame` frames bumps the cursor by `chunkSize` characters,\n * so output appears in bursts instead of dripping char-by-char.\n */\n charsPerFrame?: number;\n /** Characters revealed per step. */\n chunkSize?: number;\n speed?: number;\n className?: string;\n}\n\nconst DEFAULT_LINES: TerminalLine[] = [\n { text: \"npm run build\", type: \"command\", delay: 0 },\n { text: \"Resolving dependencies...\", type: \"log\", delay: 6 },\n { text: \"> [email protected] build\", type: \"log\", delay: 4 },\n { text: \"> next build\", type: \"log\", delay: 4 },\n { text: \"Compiling...\", type: \"log\", delay: 12 },\n { text: \"Compiled successfully in 4.2s\", type: \"success\", delay: 14 },\n { text: \"Generating static pages (24/24)\", type: \"log\", delay: 10 },\n { text: \"Build completed without errors\", type: \"success\", delay: 12 },\n];\n\nconst TYPE_COLORS: Record<TerminalLineType, string> = {\n command: \"#fafafa\",\n log: \"#a1a1aa\",\n success: \"#22c55e\",\n error: \"#ef4444\",\n};\n\n/** Auto freeze-frame heuristic: any line ending in \"...\" holds the camera. */\nfunction autoPause(line: TerminalLine): number {\n if (line.pause !== undefined) return line.pause;\n if (line.text.trimEnd().endsWith(\"...\")) return 18;\n return 0;\n}\n\nexport function TerminalSimulator({\n lines = DEFAULT_LINES,\n prompt = \"$\",\n title = \"~/projects/remocn\",\n background = \"#0a0a0a\",\n chromeColor = \"#1a1a1a\",\n fontSize = 18,\n charsPerFrame = 1,\n chunkSize = 1,\n speed = 1,\n className,\n}: TerminalSimulatorProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const lineHeight = Math.round(fontSize * 1.6);\n const visibleLines = 8;\n const windowWidth = 900;\n const windowHeight = 480;\n\n // Compute cumulative start frames for each line, including auto/explicit\n // pauses AFTER a line finishes typing.\n const starts: number[] = [];\n let acc = 10;\n for (let i = 0; i < lines.length; i++) {\n const delay = lines[i].delay ?? 8;\n acc += delay;\n starts.push(acc);\n // Approximate typing duration (in frames) for chunked output.\n const typingFrames = Math.ceil(\n lines[i].text.length / (chunkSize * charsPerFrame),\n );\n acc += typingFrames + autoPause(lines[i]);\n }\n\n // STEP-FUNCTION scroll. Each overflowing line snaps the buffer up by\n // exactly one lineHeight on the frame it begins. No interpolation, no\n // easing — terminals do not glide.\n let translateY = 0;\n for (let i = visibleLines; i < lines.length; i++) {\n if (frame >= starts[i]) {\n translateY -= lineHeight;\n }\n }\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: windowWidth,\n height: windowHeight,\n background,\n borderRadius: 12,\n overflow: \"hidden\",\n boxShadow:\n \"0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.06)\",\n display: \"flex\",\n flexDirection: \"column\",\n fontFamily:\n \"var(--font-geist-mono), ui-monospace, SFMono-Regular, monospace\",\n }}\n >\n {/* Chrome */}\n <div\n style={{\n height: 40,\n background: chromeColor,\n display: \"flex\",\n alignItems: \"center\",\n padding: \"0 16px\",\n gap: 8,\n borderBottom: \"1px solid rgba(255,255,255,0.06)\",\n }}\n >\n <Light color=\"#ff5f57\" />\n <Light color=\"#febc2e\" />\n <Light color=\"#28c840\" />\n <div\n style={{\n flex: 1,\n textAlign: \"center\",\n color: \"#71717a\",\n fontSize: 13,\n }}\n >\n {title}\n </div>\n </div>\n\n {/* Content */}\n <div\n style={{\n flex: 1,\n padding: 20,\n overflow: \"hidden\",\n position: \"relative\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 20,\n right: 20,\n top: 20,\n transform: `translateY(${translateY}px)`,\n }}\n >\n {lines.map((line, index) => (\n <Sequence\n key={index}\n from={Math.round(starts[index] / speed)}\n layout=\"none\"\n >\n <TerminalLineRow\n line={line}\n prompt={prompt}\n fontSize={fontSize}\n lineHeight={lineHeight}\n charsPerFrame={charsPerFrame}\n chunkSize={chunkSize}\n fps={fps}\n speed={speed}\n />\n </Sequence>\n ))}\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nfunction Light({ color }: { color: string }) {\n return (\n <div\n style={{\n width: 12,\n height: 12,\n borderRadius: \"50%\",\n background: color,\n opacity: 0.85,\n }}\n />\n );\n}\n\nfunction TerminalLineRow({\n line,\n prompt,\n fontSize,\n lineHeight,\n charsPerFrame,\n chunkSize,\n fps,\n speed,\n}: {\n line: TerminalLine;\n prompt: string;\n fontSize: number;\n lineHeight: number;\n charsPerFrame: number;\n chunkSize: number;\n fps: number;\n speed: number;\n}) {\n const localFrame = useCurrentFrame() * speed;\n const totalChars = line.text.length;\n\n // Chunked reveal: Math.floor of an interpolated count, then snapped to the\n // nearest multiple of `chunkSize`. This is what gives the bursty terminal\n // feel — text doesn't drip, it lurches.\n const linearRevealed = Math.floor(\n interpolate(localFrame, [0, totalChars / charsPerFrame], [0, totalChars], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n }),\n );\n const revealed = Math.min(\n totalChars,\n Math.ceil(linearRevealed / chunkSize) * chunkSize,\n );\n const visible = line.text.substring(0, revealed);\n const typingDone = revealed >= totalChars;\n // 2 Hz blink at any framerate.\n const cursorVisible = Math.floor((localFrame / fps) * 2) % 2 === 0;\n\n return (\n <div\n style={{\n height: lineHeight,\n fontSize,\n color: TYPE_COLORS[line.type],\n display: \"flex\",\n alignItems: \"center\",\n whiteSpace: \"pre\",\n }}\n >\n {line.type === \"command\" && (\n <span style={{ color: \"#22c55e\", marginRight: 8 }}>{prompt}</span>\n )}\n <span>{visible}</span>\n {!typingDone && cursorVisible && (\n <span\n style={{\n display: \"inline-block\",\n width: fontSize * 0.55,\n height: fontSize,\n background: TYPE_COLORS[line.type],\n marginLeft: 2,\n }}\n />\n )}\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/terminal-simulator.tsx"}diff --git a/public/r/toast.json b/public/r/toast.jsonindex b526d220..b6623c06 100644--- a/public/r/toast.json+++ b/public/r/toast.json@@ -14,7 +14,7 @@},{"path": "registry/remocn-ui/toast/use-toast-transition.ts",- "content": "\"use client\";\n\nimport {\n easings,\n type Step,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\nimport {\n toastStyle,\n type ToastState,\n type ToastStyle,\n} from \"@/components/remocn/toast\";\n\nexport const DEFAULT_DURATION = 12;\n\nexport function tweenToastStyle(\n a: ToastStyle,\n b: ToastStyle,\n t: number,\n): ToastStyle {\n return {\n opacity: a.opacity + (b.opacity - a.opacity) * t,\n translateY: a.translateY + (b.translateY - a.translateY) * t,\n scale: a.scale + (b.scale - a.scale) * t,\n };\n}\n\nexport interface ToastTransitionOptions {\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useToastTransition(\n steps: Step<ToastState>[],\n opts: ToastTransitionOptions = {},\n): ToastStyle {\n const { speed = 1, defaultDuration = DEFAULT_DURATION } = opts;\n const { from, to, progress } = useStateTransition(\n steps,\n \"hidden\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenToastStyle(toastStyle(from), toastStyle(to), t);\n}\n",+ "content": "\"use client\";\n\nimport {\n type ToastState,\n type ToastStyle,\n toastStyle,\n} from \"@/components/remocn/toast\";\nimport { easings, type Step, useStateTransition } from \"@/lib/remocn-ui\";\n\nexport const DEFAULT_DURATION = 12;\n\nexport function tweenToastStyle(\n a: ToastStyle,\n b: ToastStyle,\n t: number,\n): ToastStyle {\n return {\n opacity: a.opacity + (b.opacity - a.opacity) * t,\n translateY: a.translateY + (b.translateY - a.translateY) * t,\n scale: a.scale + (b.scale - a.scale) * t,\n };\n}\n\nexport interface ToastTransitionOptions {\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useToastTransition(\n steps: Step<ToastState>[],\n opts: ToastTransitionOptions = {},\n): ToastStyle {\n const { speed = 1, defaultDuration = DEFAULT_DURATION } = opts;\n const { from, to, progress } = useStateTransition(\n steps,\n \"hidden\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenToastStyle(toastStyle(from), toastStyle(to), t);\n}\n","type": "registry:component","target": "components/remocn/use-toast-transition.ts"}diff --git a/public/r/toggle-group.json b/public/r/toggle-group.jsonindex 0968dc65..547b49e1 100644--- a/public/r/toggle-group.json+++ b/public/r/toggle-group.json@@ -8,13 +8,13 @@"files": [{"path": "registry/remocn-ui/toggle-group/index.tsx",- "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { mixOklch, type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type ToggleGroupState = string;\n\nexport type ToggleGroupSize = \"default\" | \"sm\";\n\nexport interface ToggleGroupItem {\n value: string;\n label: string;\n icon?: ReactNode;\n}\n\nexport interface ToggleGroupProps {\n state?: ToggleGroupState;\n style?: ToggleGroupStyle;\n items?: ToggleGroupItem[];\n size?: ToggleGroupSize;\n theme?: Partial<RemocnTheme>;\n align?: \"start\" | \"center\" | \"end\";\n className?: string;\n}\n\nfunction justify(align: \"start\" | \"center\" | \"end\"): string {\n return align === \"start\"\n ? \"flex-start\"\n : align === \"end\"\n ? \"flex-end\"\n : \"center\";\n}\n\nconst DEFAULT_ITEMS: ToggleGroupItem[] = [\n { value: \"Monthly\", label: \"Monthly\" },\n { value: \"Yearly\", label: \"Yearly\" },\n];\n\nconst SIZE_STYLES: Record<\n ToggleGroupSize,\n { height: number; segMinWidth: number; fontSize: number; pad: number; gap: number }\n> = {\n sm: { height: 32, segMinWidth: 72, fontSize: 13, pad: 3, gap: 6 },\n default: { height: 36, segMinWidth: 88, fontSize: 14, pad: 4, gap: 8 },\n};\n\nexport interface ToggleGroupStyle {\n indicatorOffset: number;\n}\n\nexport interface ToggleGroupStyleContext {\n items: ToggleGroupItem[];\n trackBg: string;\n thumbBg: string;\n activeFg: string;\n inactiveFg: string;\n radius: number;\n}\n\nexport function toggleGroupStyleContext(\n items: ToggleGroupItem[],\n theme: RemocnTheme,\n): ToggleGroupStyleContext {\n return {\n items,\n trackBg: theme.muted,\n thumbBg: theme.background,\n activeFg: theme.foreground,\n inactiveFg: theme.mutedForeground,\n radius: theme.radius,\n };\n}\n\nexport function toggleGroupStyle(\n state: ToggleGroupState,\n ctx: ToggleGroupStyleContext,\n): ToggleGroupStyle {\n const i = ctx.items.findIndex((it) => it.value === state);\n return { indicatorOffset: i < 0 ? 0 : i };\n}\n\nexport function ToggleGroup({\n state = DEFAULT_ITEMS[0].value,\n style,\n items = DEFAULT_ITEMS,\n size = \"default\",\n theme: themeOverride,\n align = \"center\",\n className,\n}: ToggleGroupProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const ctx = toggleGroupStyleContext(items, theme);\n const v = style ?? toggleGroupStyle(state, ctx);\n\n const sizeStyle = SIZE_STYLES[size];\n const { pad } = sizeStyle;\n const segmentWidth = sizeStyle.segMinWidth;\n const thumbX = pad + v.indicatorOffset * segmentWidth;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: justify(align),\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div\n style={{\n position: \"relative\",\n display: \"flex\",\n height: sizeStyle.height,\n padding: pad,\n boxSizing: \"border-box\",\n background: ctx.trackBg,\n borderRadius: ctx.radius,\n }}\n >\n {}\n <div\n style={{\n position: \"absolute\",\n top: pad,\n left: thumbX,\n width: segmentWidth,\n height: sizeStyle.height - pad * 2,\n background: ctx.thumbBg,\n borderRadius: Math.max(2, ctx.radius - 3),\n boxShadow: \"0 1px 2px rgba(0,0,0,0.1)\",\n }}\n />\n {}\n {items.map((item, i) => {\n const proximity = Math.max(0, 1 - Math.abs(i - v.indicatorOffset));\n return (\n <span\n key={item.value}\n style={{\n position: \"relative\",\n width: segmentWidth,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: sizeStyle.gap,\n fontSize: sizeStyle.fontSize,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n color: mixOklch(ctx.inactiveFg, ctx.activeFg, proximity),\n }}\n >\n {item.icon}\n {item.label}\n </span>\n );\n })}\n </div>\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { mixOklch, type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type ToggleGroupState = string;\n\nexport type ToggleGroupSize = \"default\" | \"sm\";\n\nexport interface ToggleGroupItem {\n value: string;\n label: string;\n icon?: ReactNode;\n}\n\nexport interface ToggleGroupProps {\n state?: ToggleGroupState;\n style?: ToggleGroupStyle;\n items?: ToggleGroupItem[];\n size?: ToggleGroupSize;\n theme?: Partial<RemocnTheme>;\n align?: \"start\" | \"center\" | \"end\";\n className?: string;\n}\n\nfunction justify(align: \"start\" | \"center\" | \"end\"): string {\n return align === \"start\"\n ? \"flex-start\"\n : align === \"end\"\n ? \"flex-end\"\n : \"center\";\n}\n\nconst DEFAULT_ITEMS: ToggleGroupItem[] = [\n { value: \"Monthly\", label: \"Monthly\" },\n { value: \"Yearly\", label: \"Yearly\" },\n];\n\nconst SIZE_STYLES: Record<\n ToggleGroupSize,\n {\n height: number;\n segMinWidth: number;\n fontSize: number;\n pad: number;\n gap: number;\n }\n> = {\n sm: { height: 32, segMinWidth: 72, fontSize: 13, pad: 3, gap: 6 },\n default: { height: 36, segMinWidth: 88, fontSize: 14, pad: 4, gap: 8 },\n};\n\nexport interface ToggleGroupStyle {\n indicatorOffset: number;\n}\n\nexport interface ToggleGroupStyleContext {\n items: ToggleGroupItem[];\n trackBg: string;\n thumbBg: string;\n activeFg: string;\n inactiveFg: string;\n radius: number;\n}\n\nexport function toggleGroupStyleContext(\n items: ToggleGroupItem[],\n theme: RemocnTheme,\n): ToggleGroupStyleContext {\n return {\n items,\n trackBg: theme.muted,\n thumbBg: theme.background,\n activeFg: theme.foreground,\n inactiveFg: theme.mutedForeground,\n radius: theme.radius,\n };\n}\n\nexport function toggleGroupStyle(\n state: ToggleGroupState,\n ctx: ToggleGroupStyleContext,\n): ToggleGroupStyle {\n const i = ctx.items.findIndex((it) => it.value === state);\n return { indicatorOffset: i < 0 ? 0 : i };\n}\n\nexport function ToggleGroup({\n state = DEFAULT_ITEMS[0].value,\n style,\n items = DEFAULT_ITEMS,\n size = \"default\",\n theme: themeOverride,\n align = \"center\",\n className,\n}: ToggleGroupProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const ctx = toggleGroupStyleContext(items, theme);\n const v = style ?? toggleGroupStyle(state, ctx);\n\n const sizeStyle = SIZE_STYLES[size];\n const { pad } = sizeStyle;\n const segmentWidth = sizeStyle.segMinWidth;\n const thumbX = pad + v.indicatorOffset * segmentWidth;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: justify(align),\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div\n style={{\n position: \"relative\",\n display: \"flex\",\n height: sizeStyle.height,\n padding: pad,\n boxSizing: \"border-box\",\n background: ctx.trackBg,\n borderRadius: ctx.radius,\n }}\n >\n {}\n <div\n style={{\n position: \"absolute\",\n top: pad,\n left: thumbX,\n width: segmentWidth,\n height: sizeStyle.height - pad * 2,\n background: ctx.thumbBg,\n borderRadius: Math.max(2, ctx.radius - 3),\n boxShadow: \"0 1px 2px rgba(0,0,0,0.1)\",\n }}\n />\n {}\n {items.map((item, i) => {\n const proximity = Math.max(0, 1 - Math.abs(i - v.indicatorOffset));\n return (\n <span\n key={item.value}\n style={{\n position: \"relative\",\n width: segmentWidth,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: sizeStyle.gap,\n fontSize: sizeStyle.fontSize,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n color: mixOklch(ctx.inactiveFg, ctx.activeFg, proximity),\n }}\n >\n {item.icon}\n {item.label}\n </span>\n );\n })}\n </div>\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/toggle-group.tsx"},{"path": "registry/remocn-ui/toggle-group/use-toggle-group-transition.ts",- "content": "\"use client\";\n\nimport {\n easings,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\nimport {\n toggleGroupStyle,\n toggleGroupStyleContext,\n type ToggleGroupItem,\n type ToggleGroupState,\n type ToggleGroupStyle,\n} from \"@/components/remocn/toggle-group\";\n\nconst DEFAULT_ITEMS: ToggleGroupItem[] = [\n { value: \"Monthly\", label: \"Monthly\" },\n { value: \"Yearly\", label: \"Yearly\" },\n];\n\nexport const DEFAULT_DURATION = 14;\n\nexport function tweenToggleGroupStyle(\n a: ToggleGroupStyle,\n b: ToggleGroupStyle,\n t: number,\n): ToggleGroupStyle {\n return {\n indicatorOffset:\n a.indicatorOffset + (b.indicatorOffset - a.indicatorOffset) * t,\n };\n}\n\nexport interface ToggleGroupTransitionOptions {\n items?: ToggleGroupItem[];\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useToggleGroupTransition(\n steps: Step<ToggleGroupState>[],\n opts: ToggleGroupTransitionOptions = {},\n): ToggleGroupStyle {\n const {\n items = DEFAULT_ITEMS,\n theme: themeOverride,\n mode,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = toggleGroupStyleContext(items, theme);\n const { from, to, progress } = useStateTransition(\n steps,\n items[0].value,\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenToggleGroupStyle(\n toggleGroupStyle(from, ctx),\n toggleGroupStyle(to, ctx),\n t,\n );\n}\n",+ "content": "\"use client\";\n\nimport {\n type ToggleGroupItem,\n type ToggleGroupState,\n type ToggleGroupStyle,\n toggleGroupStyle,\n toggleGroupStyleContext,\n} from \"@/components/remocn/toggle-group\";\nimport {\n easings,\n type RemocnTheme,\n type Step,\n useRemocnTheme,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\n\nconst DEFAULT_ITEMS: ToggleGroupItem[] = [\n { value: \"Monthly\", label: \"Monthly\" },\n { value: \"Yearly\", label: \"Yearly\" },\n];\n\nexport const DEFAULT_DURATION = 14;\n\nexport function tweenToggleGroupStyle(\n a: ToggleGroupStyle,\n b: ToggleGroupStyle,\n t: number,\n): ToggleGroupStyle {\n return {\n indicatorOffset:\n a.indicatorOffset + (b.indicatorOffset - a.indicatorOffset) * t,\n };\n}\n\nexport interface ToggleGroupTransitionOptions {\n items?: ToggleGroupItem[];\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useToggleGroupTransition(\n steps: Step<ToggleGroupState>[],\n opts: ToggleGroupTransitionOptions = {},\n): ToggleGroupStyle {\n const {\n items = DEFAULT_ITEMS,\n theme: themeOverride,\n mode,\n speed = 1,\n defaultDuration = DEFAULT_DURATION,\n } = opts;\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = toggleGroupStyleContext(items, theme);\n const { from, to, progress } = useStateTransition(\n steps,\n items[0].value,\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenToggleGroupStyle(\n toggleGroupStyle(from, ctx),\n toggleGroupStyle(to, ctx),\n t,\n );\n}\n","type": "registry:component","target": "components/remocn/use-toggle-group-transition.ts"}diff --git a/public/r/tooltip.json b/public/r/tooltip.jsonindex 610d5501..b28f2f02 100644--- a/public/r/tooltip.json+++ b/public/r/tooltip.json@@ -14,7 +14,7 @@},{"path": "registry/remocn-ui/tooltip/use-tooltip-transition.ts",- "content": "\"use client\";\n\nimport {\n easings,\n type Step,\n useStateTransition,\n} from \"@/lib/remocn-ui\";\nimport {\n tooltipStyle,\n type TooltipState,\n type TooltipStyle,\n} from \"@/components/remocn/tooltip\";\n\nexport const DEFAULT_DURATION = 8;\n\nexport function tweenTooltipStyle(\n a: TooltipStyle,\n b: TooltipStyle,\n t: number,\n): TooltipStyle {\n return {\n opacity: a.opacity + (b.opacity - a.opacity) * t,\n scale: a.scale + (b.scale - a.scale) * t,\n translate: a.translate + (b.translate - a.translate) * t,\n };\n}\n\nexport interface TooltipTransitionOptions {\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useTooltipTransition(\n steps: Step<TooltipState>[],\n opts: TooltipTransitionOptions = {},\n): TooltipStyle {\n const { speed = 1, defaultDuration = DEFAULT_DURATION } = opts;\n const { from, to, progress } = useStateTransition(\n steps,\n \"hidden\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenTooltipStyle(tooltipStyle(from), tooltipStyle(to), t);\n}\n",+ "content": "\"use client\";\n\nimport {\n type TooltipState,\n type TooltipStyle,\n tooltipStyle,\n} from \"@/components/remocn/tooltip\";\nimport { easings, type Step, useStateTransition } from \"@/lib/remocn-ui\";\n\nexport const DEFAULT_DURATION = 8;\n\nexport function tweenTooltipStyle(\n a: TooltipStyle,\n b: TooltipStyle,\n t: number,\n): TooltipStyle {\n return {\n opacity: a.opacity + (b.opacity - a.opacity) * t,\n scale: a.scale + (b.scale - a.scale) * t,\n translate: a.translate + (b.translate - a.translate) * t,\n };\n}\n\nexport interface TooltipTransitionOptions {\n mode?: \"light\" | \"dark\";\n speed?: number;\n defaultDuration?: number;\n}\n\nexport function useTooltipTransition(\n steps: Step<TooltipState>[],\n opts: TooltipTransitionOptions = {},\n): TooltipStyle {\n const { speed = 1, defaultDuration = DEFAULT_DURATION } = opts;\n const { from, to, progress } = useStateTransition(\n steps,\n \"hidden\",\n speed,\n defaultDuration,\n );\n const t = easings.out(progress);\n return tweenTooltipStyle(tooltipStyle(from), tooltipStyle(to), t);\n}\n","type": "registry:component","target": "components/remocn/use-tooltip-transition.ts"}diff --git a/public/r/top-down-letters.json b/public/r/top-down-letters.jsonindex ac1b82d1..5a43e2a0 100644--- a/public/r/top-down-letters.json+++ b/public/r/top-down-letters.json@@ -7,7 +7,7 @@"files": [{"path": "registry/remocn/top-down-letters/index.tsx",- "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface TopDownLettersProps {\n text: string;\n staggerDelay?: number;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function TopDownLetters({\n text,\n staggerDelay = 3,\n distance = 46,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: TopDownLettersProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 12;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerDelay;\n const easing = Easing.bezier(0.18, 1, 0.32, 1);\n const opacity = interpolate(\n local,\n [0, charDurationFrames],\n [0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\", easing },\n );\n const y = interpolate(\n local,\n [0, charDurationFrames],\n [-distance, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\", easing },\n );\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\nexport interface TopDownLettersProps {\n text: string;\n staggerDelay?: number;\n distance?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function TopDownLetters({\n text,\n staggerDelay = 3,\n distance = 46,\n fontSize = 72,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n className,\n}: TopDownLettersProps) {\n const frame = useCurrentFrame() * speed;\n\n const chars = Array.from(text);\n const charDurationFrames = 12;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.05em\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {chars.map((char, i) => {\n const local = frame - i * staggerDelay;\n const easing = Easing.bezier(0.18, 1, 0.32, 1);\n const opacity = interpolate(local, [0, charDurationFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing,\n });\n const y = interpolate(\n local,\n [0, charDurationFrames],\n [-distance, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\", easing },\n );\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n whiteSpace: \"pre\",\n backfaceVisibility: \"hidden\",\n transformOrigin: \"50% 55%\",\n opacity,\n transform: `translateY(${y}px)`,\n }}\n >\n {char}\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/top-down-letters.tsx"}diff --git a/public/r/tracking-in.json b/public/r/tracking-in.jsonindex dd3d2080..42390124 100644--- a/public/r/tracking-in.json+++ b/public/r/tracking-in.json@@ -7,7 +7,7 @@"files": [{"path": "registry/remocn/tracking-in/index.tsx",- "content": "\"use client\";\n\nimport { interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface TrackingInProps {\n text: string;\n startTracking?: number;\n startBlur?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function TrackingIn({\n text,\n startTracking = 0.5,\n startBlur = 12,\n fontSize = 96,\n color = \"#171717\",\n fontWeight = 700,\n speed = 1,\n className,\n}: TrackingInProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const t = spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 90 },\n });\n\n const letterSpacing = interpolate(t, [0, 1], [startTracking, -0.03]) + \"em\";\n const blurAmount = interpolate(t, [0, 1], [startBlur, 0]);\n const opacity = interpolate(frame, [0, 15], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing,\n opacity,\n filter: `blur(${blurAmount}px)`,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n whiteSpace: \"nowrap\",\n }}\n >\n {text}\n </span>\n </div>\n );\n}\n",+ "content": "\"use client\";\n\nimport { interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface TrackingInProps {\n text: string;\n startTracking?: number;\n startBlur?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n className?: string;\n}\n\nexport function TrackingIn({\n text,\n startTracking = 0.5,\n startBlur = 12,\n fontSize = 96,\n color = \"#171717\",\n fontWeight = 700,\n speed = 1,\n className,\n}: TrackingInProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const t = spring({\n frame,\n fps,\n config: { damping: 18, stiffness: 90 },\n });\n\n const letterSpacing = `${interpolate(t, [0, 1], [startTracking, -0.03])}em`;\n const blurAmount = interpolate(t, [0, 1], [startBlur, 0]);\n const opacity = interpolate(frame, [0, 15], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"white\",\n }}\n >\n <span\n className={className}\n style={{\n fontSize,\n fontWeight,\n color,\n letterSpacing,\n opacity,\n filter: `blur(${blurAmount}px)`,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n whiteSpace: \"nowrap\",\n }}\n >\n {text}\n </span>\n </div>\n );\n}\n","type": "registry:component","target": "components/remocn/tracking-in.tsx"}diff --git a/public/r/v0.json b/public/r/v0.jsonindex e8291e4d..a92777f6 100644--- a/public/r/v0.json+++ b/public/r/v0.json@@ -8,7 +8,7 @@"files": [{"path": "registry/remocn/v0/index.tsx",- "content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/Inter\";\nimport {\n AbsoluteFill,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Caret } from \"@/components/remocn/caret\";\nimport { useTypewriter } from \"@/lib/remocn-ui\";\n\nconst { fontFamily: SANS_FAMILY } = loadFont();\n\nexport interface V0Props {\n greeting?: string;\n placeholder?: string;\n prompt?: string;\n modelName?: string;\n projectName?: string;\n speed?: number;\n}\n\ninterface Theme {\n page: string;\n boxBg: string;\n boxBorder: string;\n fg: string;\n fgMuted: string;\n iconColor: string;\n btnBg: string;\n btnFg: string;\n}\n\nexport const THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n page: \"#FFFFFF\",\n boxBg: \"#FFFFFF\",\n boxBorder: \"#E3E3E3\",\n fg: \"#0D0D0D\",\n fgMuted: \"#8A8A8A\",\n iconColor: \"#5D5D5D\",\n btnBg: \"#0D0D0D\",\n btnFg: \"#FFFFFF\",\n },\n dark: {\n page: \"#000000\",\n boxBg: \"#0A0A0A\",\n boxBorder: \"#2A2A2A\",\n fg: \"#EDEDED\",\n fgMuted: \"#8A8A8A\",\n iconColor: \"#A0A0A0\",\n btnBg: \"#FFFFFF\",\n btnFg: \"#0A0A0A\",\n },\n};\n\nexport const TYPING_START_FRAME = 42;\n\nexport const TYPING_CPS = 22;\n\nexport function morphProgressAt(\n frame: number,\n opts: { startFrame?: number; fps: number; speed: number },\n): number {\n const startFrame = opts.startFrame ?? TYPING_START_FRAME;\n const value = spring({\n fps: opts.fps,\n frame: frame * opts.speed - startFrame,\n config: { damping: 14, stiffness: 200, mass: 0.6 },\n });\n return Math.max(0, Math.min(value, 1));\n}\n\nfunction introBounceIn(\n frame: number,\n fps: number,\n): { translateY: number; scale: number } {\n const s = spring({\n fps,\n frame,\n config: { damping: 14, stiffness: 110, mass: 0.7 },\n });\n const translateY = interpolate(s, [0, 1], [28, 0]);\n const scale = interpolate(s, [0, 1], [0.97, 1]);\n return { translateY, scale };\n}\n\nfunction fadeUpAt(\n frame: number,\n range: [number, number],\n): { opacity: number; translateY: number } {\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n return {\n opacity: interpolate(frame, range, [0, 1], opts),\n translateY: interpolate(frame, range, [12, 0], opts),\n };\n}\n\nfunction PlusIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Add</title>\n <path\n d=\"M12 5v14M5 12h14\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n />\n </svg>\n );\n}\n\nfunction V0LogoIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>v0</title>\n <rect\n x={2.5}\n y={2.5}\n width={19}\n height={19}\n rx={5}\n stroke={color}\n strokeWidth={1.8}\n />\n <rect\n x={7.5}\n y={7.5}\n width={9}\n height={9}\n rx={2.5}\n stroke={color}\n strokeWidth={1.8}\n />\n </svg>\n );\n}\n\nfunction ChevronDownIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Expand</title>\n <path\n d=\"M6 9l6 6 6-6\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction MicIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Voice input</title>\n <rect\n x={9}\n y={3}\n width={6}\n height={11}\n rx={3}\n stroke={color}\n strokeWidth={1.8}\n />\n <path\n d=\"M5.5 11a6.5 6.5 0 0013 0M12 17.5V21M9 21h6\"\n stroke={color}\n strokeWidth={1.8}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction ArrowUpIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Send</title>\n <path\n d=\"M12 19V6M12 6l-6 6M12 6l6 6\"\n stroke={color}\n strokeWidth={2.2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nexport function V0({\n greeting = \"What do you want to create?\",\n placeholder = \"Ask v0 to build…\",\n prompt = \"a landing page for my SaaS with pricing and testimonials\",\n modelName = \"v0 Max\",\n projectName = \"Project\",\n speed = 1,\n}: V0Props) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = THEMES.dark;\n\n const refW = 1280;\n const refH = 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const tw = useTypewriter(prompt, {\n cps: TYPING_CPS,\n speed,\n startFrame: TYPING_START_FRAME,\n });\n const visibleText = tw.text;\n const showText = tw.count > 0;\n const morph = morphProgressAt(frame, { fps, speed });\n\n const intro = introBounceIn(frame * speed, fps);\n const headingFade = fadeUpAt(frame * speed, [4, 20]);\n const boxFade = fadeUpAt(frame * speed, [10, 26]);\n\n\n const boxWidth = 880;\n const boxLeft = (refW - boxWidth) / 2;\n const boxTop = 270;\n const boxHeight = 150;\n const btnSize = 40;\n\n return (\n <AbsoluteFill style={{ background: \"transparent\" }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n transform: `translate(-50%, -50%) scale(${stageScale})`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 150,\n width: refW,\n textAlign: \"center\",\n fontFamily: SANS_FAMILY,\n fontSize: 44,\n fontWeight: 700,\n color: t.fg,\n opacity: headingFade.opacity,\n transform: `translateY(${headingFade.translateY + intro.translateY * 0.4}px)`,\n }}\n >\n {greeting}\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: boxLeft,\n top: boxTop,\n width: boxWidth,\n height: boxHeight,\n background: t.boxBg,\n border: `1px solid ${t.boxBorder}`,\n borderRadius: 16,\n boxShadow: \"0 8px 40px -16px rgba(0,0,0,0.8)\",\n opacity: boxFade.opacity,\n transform: `translateY(${boxFade.translateY + intro.translateY * 0.6}px) scale(${intro.scale})`,\n transformOrigin: \"center top\",\n display: \"flex\",\n flexDirection: \"column\",\n boxSizing: \"border-box\",\n }}\n >\n <div\n style={{\n flex: 1,\n padding: \"18px 20px\",\n fontFamily: SANS_FAMILY,\n fontSize: 18,\n color: t.fg,\n display: \"flex\",\n alignItems: \"flex-start\",\n overflow: \"hidden\",\n }}\n >\n {showText ? (\n <span\n style={{\n color: t.fg,\n whiteSpace: \"pre-wrap\",\n }}\n >\n {visibleText}\n <Caret\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n height={20}\n marginLeft={2}\n />\n </span>\n ) : (\n <span\n style={{\n color: t.fgMuted,\n display: \"inline-flex\",\n alignItems: \"center\",\n }}\n >\n <Caret color={t.fg} blink={!tw.typing} speed={speed} height={20} />\n <span style={{ marginLeft: 6 }}>{placeholder}</span>\n </span>\n )}\n </div>\n\n <div\n style={{\n padding: \"12px 16px\",\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n }}\n >\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 10 }}>\n <PlusIcon size={20} color={t.iconColor} />\n <div\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 7,\n }}\n >\n <V0LogoIcon size={18} color={t.fg} />\n <span\n style={{\n fontFamily: SANS_FAMILY,\n fontSize: 15,\n fontWeight: 500,\n color: t.fg,\n }}\n >\n {modelName}\n </span>\n <ChevronDownIcon size={14} color={t.fgMuted} />\n </div>\n </div>\n\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 12 }}>\n <div\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 4,\n }}\n >\n <span\n style={{\n fontFamily: SANS_FAMILY,\n fontSize: 15,\n color: t.fgMuted,\n }}\n >\n {projectName}\n </span>\n <ChevronDownIcon size={14} color={t.fgMuted} />\n </div>\n\n <div\n style={{\n position: \"relative\",\n width: btnSize,\n height: btnSize,\n borderRadius: 10,\n background: t.btnBg,\n flexShrink: 0,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: 1 - morph,\n transform: `scale(${1 - 0.08 * morph})`,\n }}\n >\n <MicIcon size={20} color={t.btnFg} />\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: morph,\n transform: `scale(${0.85 + 0.15 * morph})`,\n }}\n >\n <ArrowUpIcon size={20} color={t.btnFg} />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n",+ "content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/Inter\";\nimport {\n AbsoluteFill,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Caret } from \"@/components/remocn/caret\";\nimport { useTypewriter } from \"@/lib/remocn-ui\";\n\nconst { fontFamily: SANS_FAMILY } = loadFont();\n\nexport interface V0Props {\n greeting?: string;\n placeholder?: string;\n prompt?: string;\n modelName?: string;\n projectName?: string;\n speed?: number;\n}\n\ninterface Theme {\n page: string;\n boxBg: string;\n boxBorder: string;\n fg: string;\n fgMuted: string;\n iconColor: string;\n btnBg: string;\n btnFg: string;\n}\n\nexport const THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n page: \"#FFFFFF\",\n boxBg: \"#FFFFFF\",\n boxBorder: \"#E3E3E3\",\n fg: \"#0D0D0D\",\n fgMuted: \"#8A8A8A\",\n iconColor: \"#5D5D5D\",\n btnBg: \"#0D0D0D\",\n btnFg: \"#FFFFFF\",\n },\n dark: {\n page: \"#000000\",\n boxBg: \"#0A0A0A\",\n boxBorder: \"#2A2A2A\",\n fg: \"#EDEDED\",\n fgMuted: \"#8A8A8A\",\n iconColor: \"#A0A0A0\",\n btnBg: \"#FFFFFF\",\n btnFg: \"#0A0A0A\",\n },\n};\n\nexport const TYPING_START_FRAME = 42;\n\nexport const TYPING_CPS = 22;\n\nexport function morphProgressAt(\n frame: number,\n opts: { startFrame?: number; fps: number; speed: number },\n): number {\n const startFrame = opts.startFrame ?? TYPING_START_FRAME;\n const value = spring({\n fps: opts.fps,\n frame: frame * opts.speed - startFrame,\n config: { damping: 14, stiffness: 200, mass: 0.6 },\n });\n return Math.max(0, Math.min(value, 1));\n}\n\nfunction introBounceIn(\n frame: number,\n fps: number,\n): { translateY: number; scale: number } {\n const s = spring({\n fps,\n frame,\n config: { damping: 14, stiffness: 110, mass: 0.7 },\n });\n const translateY = interpolate(s, [0, 1], [28, 0]);\n const scale = interpolate(s, [0, 1], [0.97, 1]);\n return { translateY, scale };\n}\n\nfunction fadeUpAt(\n frame: number,\n range: [number, number],\n): { opacity: number; translateY: number } {\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n return {\n opacity: interpolate(frame, range, [0, 1], opts),\n translateY: interpolate(frame, range, [12, 0], opts),\n };\n}\n\nfunction PlusIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Add</title>\n <path\n d=\"M12 5v14M5 12h14\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n />\n </svg>\n );\n}\n\nfunction V0LogoIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>v0</title>\n <rect\n x={2.5}\n y={2.5}\n width={19}\n height={19}\n rx={5}\n stroke={color}\n strokeWidth={1.8}\n />\n <rect\n x={7.5}\n y={7.5}\n width={9}\n height={9}\n rx={2.5}\n stroke={color}\n strokeWidth={1.8}\n />\n </svg>\n );\n}\n\nfunction ChevronDownIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Expand</title>\n <path\n d=\"M6 9l6 6 6-6\"\n stroke={color}\n strokeWidth={2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction MicIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Voice input</title>\n <rect\n x={9}\n y={3}\n width={6}\n height={11}\n rx={3}\n stroke={color}\n strokeWidth={1.8}\n />\n <path\n d=\"M5.5 11a6.5 6.5 0 0013 0M12 17.5V21M9 21h6\"\n stroke={color}\n strokeWidth={1.8}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction ArrowUpIcon({ size, color }: { size: number; color: string }) {\n return (\n <svg width={size} height={size} viewBox=\"0 0 24 24\" fill=\"none\">\n <title>Send</title>\n <path\n d=\"M12 19V6M12 6l-6 6M12 6l6 6\"\n stroke={color}\n strokeWidth={2.2}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nexport function V0({\n greeting = \"What do you want to create?\",\n placeholder = \"Ask v0 to build…\",\n prompt = \"a landing page for my SaaS with pricing and testimonials\",\n modelName = \"v0 Max\",\n projectName = \"Project\",\n speed = 1,\n}: V0Props) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = THEMES.dark;\n\n const refW = 1280;\n const refH = 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const tw = useTypewriter(prompt, {\n cps: TYPING_CPS,\n speed,\n startFrame: TYPING_START_FRAME,\n });\n const visibleText = tw.text;\n const showText = tw.count > 0;\n const morph = morphProgressAt(frame, { fps, speed });\n\n const intro = introBounceIn(frame * speed, fps);\n const headingFade = fadeUpAt(frame * speed, [4, 20]);\n const boxFade = fadeUpAt(frame * speed, [10, 26]);\n\n const boxWidth = 880;\n const boxLeft = (refW - boxWidth) / 2;\n const boxTop = 270;\n const boxHeight = 150;\n const btnSize = 40;\n\n return (\n <AbsoluteFill style={{ background: \"transparent\" }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n transform: `translate(-50%, -50%) scale(${stageScale})`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 150,\n width: refW,\n textAlign: \"center\",\n fontFamily: SANS_FAMILY,\n fontSize: 44,\n fontWeight: 700,\n color: t.fg,\n opacity: headingFade.opacity,\n transform: `translateY(${headingFade.translateY + intro.translateY * 0.4}px)`,\n }}\n >\n {greeting}\n </div>\n\n <div\n style={{\n position: \"absolute\",\n left: boxLeft,\n top: boxTop,\n width: boxWidth,\n height: boxHeight,\n background: t.boxBg,\n border: `1px solid ${t.boxBorder}`,\n borderRadius: 16,\n boxShadow: \"0 8px 40px -16px rgba(0,0,0,0.8)\",\n opacity: boxFade.opacity,\n transform: `translateY(${boxFade.translateY + intro.translateY * 0.6}px) scale(${intro.scale})`,\n transformOrigin: \"center top\",\n display: \"flex\",\n flexDirection: \"column\",\n boxSizing: \"border-box\",\n }}\n >\n <div\n style={{\n flex: 1,\n padding: \"18px 20px\",\n fontFamily: SANS_FAMILY,\n fontSize: 18,\n color: t.fg,\n display: \"flex\",\n alignItems: \"flex-start\",\n overflow: \"hidden\",\n }}\n >\n {showText ? (\n <span\n style={{\n color: t.fg,\n whiteSpace: \"pre-wrap\",\n }}\n >\n {visibleText}\n <Caret\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n height={20}\n marginLeft={2}\n />\n </span>\n ) : (\n <span\n style={{\n color: t.fgMuted,\n display: \"inline-flex\",\n alignItems: \"center\",\n }}\n >\n <Caret\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n height={20}\n />\n <span style={{ marginLeft: 6 }}>{placeholder}</span>\n </span>\n )}\n </div>\n\n <div\n style={{\n padding: \"12px 16px\",\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n }}\n >\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 10 }}>\n <PlusIcon size={20} color={t.iconColor} />\n <div\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 7,\n }}\n >\n <V0LogoIcon size={18} color={t.fg} />\n <span\n style={{\n fontFamily: SANS_FAMILY,\n fontSize: 15,\n fontWeight: 500,\n color: t.fg,\n }}\n >\n {modelName}\n </span>\n <ChevronDownIcon size={14} color={t.fgMuted} />\n </div>\n </div>\n\n <div style={{ display: \"flex\", alignItems: \"center\", gap: 12 }}>\n <div\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 4,\n }}\n >\n <span\n style={{\n fontFamily: SANS_FAMILY,\n fontSize: 15,\n color: t.fgMuted,\n }}\n >\n {projectName}\n </span>\n <ChevronDownIcon size={14} color={t.fgMuted} />\n </div>\n\n <div\n style={{\n position: \"relative\",\n width: btnSize,\n height: btnSize,\n borderRadius: 10,\n background: t.btnBg,\n flexShrink: 0,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: 1 - morph,\n transform: `scale(${1 - 0.08 * morph})`,\n }}\n >\n <MicIcon size={20} color={t.btnFg} />\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: morph,\n transform: `scale(${0.85 + 0.15 * morph})`,\n }}\n >\n <ArrowUpIcon size={20} color={t.btnFg} />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n","type": "registry:component","target": "components/remocn/v0.tsx"}diff --git a/public/r/warp-dissolve.json b/public/r/warp-dissolve.jsonindex 88fc5f26..836e44d2 100644--- a/public/r/warp-dissolve.json+++ b/public/r/warp-dissolve.json@@ -8,7 +8,7 @@"files": [{"path": "registry/remocn/warp-dissolve/index.tsx",- "content": "\"use client\";\n\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport { ShaderWarp } from \"@/components/remocn/shader-warp\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst DEFAULT_COLORS = [\"#141318\", \"#3a3a5c\", \"#1f1d29\", \"#8f88ae\"];\n\nexport type WarpDissolveProps = {\n colors?: string[];\n distortion?: number;\n swirl?: number;\n softness?: number;\n speed?: number;\n};\n\nconst WarpDissolvePresentation: React.FC<\n TransitionPresentationComponentProps<WarpDissolveProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n colors = DEFAULT_COLORS,\n distortion = 0.8,\n swirl = 0.6,\n softness = 1,\n speed = 1,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n if (!entering) {\n const meltStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.2, 0.38], [1, 0], clampOpts),\n transform: `scale(${interpolate(p, [0, 0.38], [1, 1.16], {\n ...clampOpts,\n easing: Easing.in(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.04, 0.38], [0, 18], clampOpts)}px)`,\n };\n return <AbsoluteFill style={meltStyle}>{children}</AbsoluteFill>;\n }\n\n const fieldOpacity = interpolate(p, [0, 0.32], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n const fieldDistortion = interpolate(\n p,\n [0, 0.5, 1],\n [distortion * 0.3, distortion, distortion * 0.4],\n clampOpts,\n );\n\n const childStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.66, 0.82], [0, 1], clampOpts),\n transform: `scale(${interpolate(p, [0.66, 1], [1.18, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.66, 0.92], [16, 0], clampOpts)}px)`,\n };\n\n return (\n <AbsoluteFill>\n <AbsoluteFill style={{ opacity: fieldOpacity, pointerEvents: \"none\" }}>\n <ShaderWarp\n speed={speed}\n colors={colors}\n distortion={fieldDistortion}\n swirl={swirl}\n softness={softness}\n />\n </AbsoluteFill>\n <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>\n </AbsoluteFill>\n );\n};\n\nexport function warpDissolve(\n props: WarpDissolveProps = {},\n): TransitionPresentation<WarpDissolveProps> {\n return {\n component: WarpDissolvePresentation,\n props,\n };\n}\n",+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport { ShaderWarp } from \"@/components/remocn/shader-warp\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst DEFAULT_COLORS = [\"#141318\", \"#3a3a5c\", \"#1f1d29\", \"#8f88ae\"];\n\nexport type WarpDissolveProps = {\n colors?: string[];\n distortion?: number;\n swirl?: number;\n softness?: number;\n speed?: number;\n};\n\nconst WarpDissolvePresentation: React.FC<\n TransitionPresentationComponentProps<WarpDissolveProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n colors = DEFAULT_COLORS,\n distortion = 0.8,\n swirl = 0.6,\n softness = 1,\n speed = 1,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n if (!entering) {\n const meltStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.2, 0.38], [1, 0], clampOpts),\n transform: `scale(${interpolate(p, [0, 0.38], [1, 1.16], {\n ...clampOpts,\n easing: Easing.in(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.04, 0.38], [0, 18], clampOpts)}px)`,\n };\n return <AbsoluteFill style={meltStyle}>{children}</AbsoluteFill>;\n }\n\n const fieldOpacity = interpolate(p, [0, 0.32], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n const fieldDistortion = interpolate(\n p,\n [0, 0.5, 1],\n [distortion * 0.3, distortion, distortion * 0.4],\n clampOpts,\n );\n\n const childStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.66, 0.82], [0, 1], clampOpts),\n transform: `scale(${interpolate(p, [0.66, 1], [1.18, 1], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n })})`,\n filter: `blur(${interpolate(p, [0.66, 0.92], [16, 0], clampOpts)}px)`,\n };\n\n return (\n <AbsoluteFill>\n <AbsoluteFill style={{ opacity: fieldOpacity, pointerEvents: \"none\" }}>\n <ShaderWarp\n speed={speed}\n colors={colors}\n distortion={fieldDistortion}\n swirl={swirl}\n softness={softness}\n />\n </AbsoluteFill>\n <AbsoluteFill style={childStyle}>{children}</AbsoluteFill>\n </AbsoluteFill>\n );\n};\n\nexport function warpDissolve(\n props: WarpDissolveProps = {},\n): TransitionPresentation<WarpDissolveProps> {\n return {\n component: WarpDissolvePresentation,\n props,\n };\n}\n","type": "registry:component","target": "components/remocn/warp-dissolve.tsx"}diff --git a/public/r/wave-wipe.json b/public/r/wave-wipe.jsonindex ebe7b738..16ff4017 100644--- a/public/r/wave-wipe.json+++ b/public/r/wave-wipe.json@@ -8,7 +8,7 @@"files": [{"path": "registry/remocn/wave-wipe/index.tsx",- "content": "\"use client\";\n\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport { ShaderGrainGradient } from \"@/components/remocn/shader-grain-gradient\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst DEFAULT_COLORS = [\"#3a3a52\", \"#4a4a68\", \"#8f88ae\"];\n\nexport type WaveWipeProps = {\n colors?: string[];\n colorBack?: string;\n intensity?: number;\n softness?: number;\n noise?: number;\n zoom?: number;\n speed?: number;\n};\n\nconst WaveWipePresentation: React.FC<\n TransitionPresentationComponentProps<WaveWipeProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n colors = DEFAULT_COLORS,\n colorBack = \"#141318\",\n intensity = 0.2,\n softness = 0.7,\n noise = 0.4,\n zoom = 1.16,\n speed = 1,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n if (!entering) {\n const exitStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.3, 0.5], [1, 0], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n }),\n transform: `translateY(${interpolate(p, [0, 0.7], [0, -70], {\n ...clampOpts,\n easing: Easing.in(Easing.cubic),\n })}%)`,\n };\n return <AbsoluteFill style={exitStyle}>{children}</AbsoluteFill>;\n }\n\n const fieldOpacity = interpolate(p, [0.18, 0.45], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n const drift = interpolate(p, [0, 1], [0, 0.7], {\n ...clampOpts,\n easing: Easing.bezier(0.45, 0, 0.55, 1),\n });\n const rise = interpolate(p, [0.4, 0.82, 1], [100, -3.5, 0], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n });\n\n return (\n <AbsoluteFill>\n <AbsoluteFill style={{ opacity: fieldOpacity, pointerEvents: \"none\" }}>\n <ShaderGrainGradient\n speed={speed}\n shape=\"wave\"\n colors={colors}\n colorBack={colorBack}\n intensity={intensity}\n softness={softness}\n noise={noise}\n scale={zoom}\n offsetY={drift}\n />\n </AbsoluteFill>\n <AbsoluteFill style={{ transform: `translateY(${rise}%)` }}>\n {children}\n </AbsoluteFill>\n </AbsoluteFill>\n );\n};\n\nexport function waveWipe(\n props: WaveWipeProps = {},\n): TransitionPresentation<WaveWipeProps> {\n return {\n component: WaveWipePresentation,\n props,\n };\n}\n",+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport { ShaderGrainGradient } from \"@/components/remocn/shader-grain-gradient\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nconst DEFAULT_COLORS = [\"#3a3a52\", \"#4a4a68\", \"#8f88ae\"];\n\nexport type WaveWipeProps = {\n colors?: string[];\n colorBack?: string;\n intensity?: number;\n softness?: number;\n noise?: number;\n zoom?: number;\n speed?: number;\n};\n\nconst WaveWipePresentation: React.FC<\n TransitionPresentationComponentProps<WaveWipeProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const {\n colors = DEFAULT_COLORS,\n colorBack = \"#141318\",\n intensity = 0.2,\n softness = 0.7,\n noise = 0.4,\n zoom = 1.16,\n speed = 1,\n } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n if (!entering) {\n const exitStyle: React.CSSProperties = {\n opacity: interpolate(p, [0.3, 0.5], [1, 0], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n }),\n transform: `translateY(${interpolate(p, [0, 0.7], [0, -70], {\n ...clampOpts,\n easing: Easing.in(Easing.cubic),\n })}%)`,\n };\n return <AbsoluteFill style={exitStyle}>{children}</AbsoluteFill>;\n }\n\n const fieldOpacity = interpolate(p, [0.18, 0.45], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.42, 0, 0.58, 1),\n });\n const drift = interpolate(p, [0, 1], [0, 0.7], {\n ...clampOpts,\n easing: Easing.bezier(0.45, 0, 0.55, 1),\n });\n const rise = interpolate(p, [0.4, 0.82, 1], [100, -3.5, 0], {\n ...clampOpts,\n easing: Easing.out(Easing.cubic),\n });\n\n return (\n <AbsoluteFill>\n <AbsoluteFill style={{ opacity: fieldOpacity, pointerEvents: \"none\" }}>\n <ShaderGrainGradient\n speed={speed}\n shape=\"wave\"\n colors={colors}\n colorBack={colorBack}\n intensity={intensity}\n softness={softness}\n noise={noise}\n scale={zoom}\n offsetY={drift}\n />\n </AbsoluteFill>\n <AbsoluteFill style={{ transform: `translateY(${rise}%)` }}>\n {children}\n </AbsoluteFill>\n </AbsoluteFill>\n );\n};\n\nexport function waveWipe(\n props: WaveWipeProps = {},\n): TransitionPresentation<WaveWipeProps> {\n return {\n component: WaveWipePresentation,\n props,\n };\n}\n","type": "registry:component","target": "components/remocn/wave-wipe.tsx"}diff --git a/public/r/whip-pan.json b/public/r/whip-pan.jsonindex 245f3a5f..a1162d70 100644--- a/public/r/whip-pan.json+++ b/public/r/whip-pan.json@@ -7,7 +7,7 @@"files": [{"path": "registry/remocn/whip-pan/index.tsx",- "content": "\"use client\";\n\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nexport type WhipPanProps = {\n direction?: \"left\" | \"right\" | \"up\" | \"down\";\n blur?: number;\n};\n\nconst WhipPanPresentation: React.FC<\n TransitionPresentationComponentProps<WhipPanProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const { direction = \"left\", blur = 24 } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n const travel = interpolate(p, [0, 1], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.7, 0, 0.2, 1),\n });\n const velocity = Math.sin(Math.PI * travel);\n\n const axis: \"x\" | \"y\" =\n direction === \"left\" || direction === \"right\" ? \"x\" : \"y\";\n const sign = direction === \"left\" || direction === \"up\" ? -1 : 1;\n\n const offset = entering\n ? (travel - 1) * 110 * sign\n : travel * 110 * sign;\n const stretch = 1 + velocity * 0.12;\n\n const translate =\n axis === \"x\" ? `translateX(${offset}%)` : `translateY(${offset}%)`;\n const smear = axis === \"x\" ? `scaleX(${stretch})` : `scaleY(${stretch})`;\n\n const style: React.CSSProperties = {\n transform: `${translate} ${smear}`,\n filter: `blur(${velocity * blur}px)`,\n };\n\n return <AbsoluteFill style={style}>{children}</AbsoluteFill>;\n};\n\nexport function whipPan(\n props: WhipPanProps = {},\n): TransitionPresentation<WhipPanProps> {\n return {\n component: WhipPanPresentation,\n props,\n };\n}\n",+ "content": "\"use client\";\n\nimport type {\n TransitionPresentation,\n TransitionPresentationComponentProps,\n} from \"@remotion/transitions\";\nimport type React from \"react\";\nimport { AbsoluteFill, Easing, interpolate } from \"remotion\";\n\nconst clampOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nexport type WhipPanProps = {\n direction?: \"left\" | \"right\" | \"up\" | \"down\";\n blur?: number;\n};\n\nconst WhipPanPresentation: React.FC<\n TransitionPresentationComponentProps<WhipPanProps>\n> = ({\n children,\n presentationProgress,\n presentationDirection,\n passedProps,\n}) => {\n const { direction = \"left\", blur = 24 } = passedProps;\n const entering = presentationDirection === \"entering\";\n const p = presentationProgress;\n\n const travel = interpolate(p, [0, 1], [0, 1], {\n ...clampOpts,\n easing: Easing.bezier(0.7, 0, 0.2, 1),\n });\n const velocity = Math.sin(Math.PI * travel);\n\n const axis: \"x\" | \"y\" =\n direction === \"left\" || direction === \"right\" ? \"x\" : \"y\";\n const sign = direction === \"left\" || direction === \"up\" ? -1 : 1;\n\n const offset = entering ? (travel - 1) * 110 * sign : travel * 110 * sign;\n const stretch = 1 + velocity * 0.12;\n\n const translate =\n axis === \"x\" ? `translateX(${offset}%)` : `translateY(${offset}%)`;\n const smear = axis === \"x\" ? `scaleX(${stretch})` : `scaleY(${stretch})`;\n\n const style: React.CSSProperties = {\n transform: `${translate} ${smear}`,\n filter: `blur(${velocity * blur}px)`,\n };\n\n return <AbsoluteFill style={style}>{children}</AbsoluteFill>;\n};\n\nexport function whipPan(\n props: WhipPanProps = {},\n): TransitionPresentation<WhipPanProps> {\n return {\n component: WhipPanPresentation,\n props,\n };\n}\n","type": "registry:component","target": "components/remocn/whip-pan.tsx"}diff --git a/public/r/x-follow-card.json b/public/r/x-follow-card.jsonindex 2473599e..d7e2cb89 100644--- a/public/r/x-follow-card.json+++ b/public/r/x-follow-card.json@@ -8,7 +8,7 @@"files": [{"path": "registry/remocn/x-follow-card/index.tsx",- "content": "\"use client\";\n\nimport { useState } from \"react\";\nimport { loadFont } from \"@remotion/google-fonts/Inter\";\nimport {\n AbsoluteFill,\n Img,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Cursor, type CursorStyle } from \"@/components/remocn/cursor\";\nimport {\n type CursorWaypoint,\n useCursorPath,\n} from \"@/components/remocn/use-cursor-path\";\n\nconst { fontFamily: FONT_FAMILY } = loadFont();\n\nexport interface XFollowCardProps {\n name?: string;\n handle?: string;\n bio?: string;\n avatarUrl?: string;\n coverUrl?: string;\n location?: string;\n website?: string;\n joined?: string;\n verified?: boolean;\n accentColor?: string;\n orientation?: \"horizontal\" | \"vertical\";\n speed?: number;\n}\n\ninterface Theme {\n page: string;\n cardBg: string;\n cardBorder: string;\n fg: string;\n fgMuted: string;\n divider: string;\n}\n\nexport const THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n page: \"#f5f7f9\",\n cardBg: \"#ffffff\",\n cardBorder: \"#e6e9eb\",\n fg: \"#0f1419\",\n fgMuted: \"#536471\",\n divider: \"#eff3f4\",\n },\n dark: {\n page: \"#0a0a0a\",\n cardBg: \"#16181c\",\n cardBorder: \"#2f3336\",\n fg: \"#e7e9ea\",\n fgMuted: \"#71767b\",\n divider: \"#2f3336\",\n },\n};\n\nexport const CLICK_FRAME = 110;\n\nconst BUTTON_LAYOUT: Record<\n \"horizontal\" | \"vertical\",\n { x: number; y: number; w: number; h: number }\n> = {\n horizontal: { x: 800, y: 240, w: 116, h: 40 },\n vertical: { x: 542, y: 336, w: 124, h: 44 },\n};\n\nexport function cardBounceIn(\n frame: number,\n fps: number,\n): { translateY: number; scale: number } {\n const s = spring({\n fps,\n frame,\n config: { damping: 12, stiffness: 120, mass: 0.8 },\n });\n const translateY = interpolate(s, [0, 1], [60, 0]);\n const scale = interpolate(s, [0, 1], [0.9, 1]);\n return { translateY, scale };\n}\n\nexport function blurInSchedule(): {\n group: number;\n start: number;\n end: number;\n}[] {\n return [\n { group: 0, start: 20, end: 26 },\n { group: 1, start: 22, end: 28 },\n { group: 2, start: 24, end: 30 },\n { group: 3, start: 26, end: 32 },\n { group: 4, start: 28, end: 34 },\n { group: 5, start: 30, end: 36 },\n { group: 6, start: 32, end: 38 },\n { group: 7, start: 34, end: 40 },\n { group: 8, start: 36, end: 42 },\n ];\n}\n\nexport function blurInAt(\n step: { start: number; end: number },\n frame: number,\n): { blur: number; opacity: number; translateY: number } {\n const range: [number, number] = [step.start, step.end];\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n return {\n blur: interpolate(frame, range, [8, 0], opts),\n opacity: interpolate(frame, range, [0, 1], opts),\n translateY: interpolate(frame, range, [8, 0], opts),\n };\n}\n\nexport function followStateAt(frame: number, speed: number): boolean {\n return frame * speed >= CLICK_FRAME;\n}\n\nexport function buildFollowWaypoints(args: {\n buttonCenter: { x: number; y: number };\n orientation: \"horizontal\" | \"vertical\";\n}): CursorWaypoint[] {\n const { buttonCenter, orientation } = args;\n const rest =\n orientation === \"vertical\" ? { x: 640, y: 1120 } : { x: 1120, y: 600 };\n return [\n { at: 0, x: rest.x, y: rest.y },\n { at: 75, x: rest.x, y: rest.y },\n {\n at: CLICK_FRAME,\n x: buttonCenter.x,\n y: buttonCenter.y,\n duration: 32,\n click: true,\n easing: \"inOut\",\n },\n { at: CLICK_FRAME + 30, x: buttonCenter.x, y: buttonCenter.y },\n ];\n}\n\nfunction tintGradient(accent: string): string {\n return `linear-gradient(135deg, ${accent} 0%, ${accent}99 55%, ${accent}55 100%)`;\n}\n\nfunction Cover({\n coverUrl,\n accent,\n height,\n}: {\n coverUrl: string;\n accent: string;\n height: number;\n}) {\n const [errored, setErrored] = useState(false);\n const fallback = (\n <div\n style={{\n width: \"100%\",\n height,\n background: tintGradient(accent),\n }}\n />\n );\n if (errored || !coverUrl) return fallback;\n return (\n <Img\n src={coverUrl}\n crossOrigin=\"anonymous\"\n onError={() => setErrored(true)}\n style={{ width: \"100%\", height, objectFit: \"cover\", display: \"block\" }}\n />\n );\n}\n\nfunction Avatar({\n avatarUrl,\n name,\n size,\n accent,\n theme,\n}: {\n avatarUrl: string;\n name: string;\n size: number;\n accent: string;\n theme: Theme;\n}) {\n const [errored, setErrored] = useState(false);\n const ringStyle = {\n width: size,\n height: size,\n borderRadius: \"100%\",\n border: `4px solid ${theme.cardBg}`,\n flexShrink: 0,\n boxSizing: \"border-box\" as const,\n };\n\n if (errored || !avatarUrl) {\n return (\n <div\n style={{\n ...ringStyle,\n background: `${accent}33`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: accent,\n fontSize: size * 0.4,\n fontWeight: 700,\n fontFamily: FONT_FAMILY,\n }}\n >\n {name.charAt(0).toUpperCase()}\n </div>\n );\n }\n\n return (\n <Img\n src={avatarUrl}\n crossOrigin=\"anonymous\"\n onError={() => setErrored(true)}\n style={{ ...ringStyle, objectFit: \"cover\" }}\n />\n );\n}\n\nfunction VerifiedBadge({ accent, size }: { accent: string; size: number }) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 22 22\"\n width={size}\n height={size}\n fill={accent}\n >\n <title>Verified</title>\n <path d=\"M20.396 11c-.018-.646-.215-1.275-.57-1.816-.354-.54-.852-.972-1.438-1.246.223-.607.27-1.264.14-1.897-.131-.634-.437-1.218-.882-1.687-.47-.445-1.053-.75-1.687-.882-.633-.13-1.29-.083-1.897.14-.273-.587-.704-1.086-1.245-1.44S11.647 1.62 11 1.604c-.646.017-1.273.213-1.813.568s-.969.854-1.24 1.44c-.608-.223-1.267-.272-1.902-.14-.635.13-1.22.436-1.69.882-.445.47-.749 1.055-.878 1.688-.13.633-.08 1.29.144 1.896-.587.274-1.087.705-1.443 1.245-.356.54-.555 1.17-.574 1.817.02.647.218 1.276.574 1.817.356.54.856.972 1.443 1.245-.224.606-.274 1.263-.144 1.896.13.634.433 1.218.877 1.688.47.443 1.054.747 1.687.878.633.132 1.29.084 1.897-.136.274.586.705 1.084 1.246 1.439.54.354 1.17.551 1.816.569.647-.016 1.276-.213 1.817-.567s.972-.854 1.245-1.44c.604.239 1.266.296 1.903.164.636-.132 1.22-.447 1.68-.907.46-.46.776-1.044.908-1.681s.075-1.299-.165-1.903c.586-.274 1.084-.705 1.439-1.246.354-.54.551-1.17.569-1.816zM9.662 14.85l-3.429-3.428 1.293-1.302 2.072 2.072 4.4-4.794 1.347 1.246z\" />\n </svg>\n );\n}\n\nfunction ProfileInfo({\n name,\n handle,\n bio,\n verified,\n accent,\n theme,\n isVertical,\n nameStyle,\n handleStyle,\n bioStyle,\n}: {\n name: string;\n handle: string;\n bio: string;\n verified: boolean;\n accent: string;\n theme: Theme;\n isVertical: boolean;\n nameStyle: React.CSSProperties;\n handleStyle: React.CSSProperties;\n bioStyle: React.CSSProperties;\n}) {\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 2,\n marginTop: 12,\n }}\n >\n <div\n style={{ ...nameStyle, display: \"flex\", alignItems: \"center\", gap: 6 }}\n >\n <span\n style={{\n fontSize: isVertical ? 28 : 24,\n fontWeight: 800,\n color: theme.fg,\n fontFamily: FONT_FAMILY,\n lineHeight: 1.2,\n letterSpacing: \"-0.01em\",\n }}\n >\n {name}\n </span>\n {verified && (\n <VerifiedBadge accent={accent} size={isVertical ? 24 : 22} />\n )}\n </div>\n <span\n style={{\n ...handleStyle,\n fontSize: isVertical ? 18 : 16,\n fontWeight: 400,\n color: theme.fgMuted,\n fontFamily: FONT_FAMILY,\n lineHeight: 1.3,\n }}\n >\n @{handle}\n </span>\n <p\n style={{\n ...bioStyle,\n margin: \"8px 0 0\",\n fontSize: isVertical ? 18 : 16,\n fontWeight: 400,\n color: theme.fg,\n fontFamily: FONT_FAMILY,\n lineHeight: 1.4,\n display: \"-webkit-box\",\n WebkitLineClamp: 2,\n WebkitBoxOrient: \"vertical\",\n overflow: \"hidden\",\n }}\n >\n {bio}\n </p>\n </div>\n );\n}\n\nfunction MetaRow({\n location,\n website,\n joined,\n accent,\n theme,\n}: {\n location: string;\n website: string;\n joined: string;\n accent: string;\n theme: Theme;\n}) {\n const itemStyle = {\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n fontSize: 15,\n color: theme.fgMuted,\n fontFamily: FONT_FAMILY,\n } as const;\n return (\n <div\n style={{\n display: \"flex\",\n flexWrap: \"wrap\",\n gap: 16,\n marginTop: 14,\n }}\n >\n <span style={itemStyle}>\n <PinIcon color={theme.fgMuted} />\n {location}\n </span>\n <span style={itemStyle}>\n <LinkIcon color={theme.fgMuted} />\n <span style={{ color: accent }}>{website}</span>\n </span>\n <span style={itemStyle}>\n <CalendarIcon color={theme.fgMuted} />\n {`Joined ${joined}`}\n </span>\n </div>\n );\n}\n\nfunction PinIcon({ color }: { color: string }) {\n return (\n <svg width={16} height={16} viewBox=\"0 0 24 24\" fill={color}>\n <title>Location</title>\n <path d=\"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5a2.5 2.5 0 110-5 2.5 2.5 0 010 5z\" />\n </svg>\n );\n}\n\nfunction LinkIcon({ color }: { color: string }) {\n return (\n <svg width={16} height={16} viewBox=\"0 0 24 24\" fill={color}>\n <title>Website</title>\n <path d=\"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z\" />\n </svg>\n );\n}\n\nfunction CalendarIcon({ color }: { color: string }) {\n return (\n <svg width={16} height={16} viewBox=\"0 0 24 24\" fill={color}>\n <title>Joined</title>\n <path d=\"M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V10h14v10zm0-12H5V6h14v2z\" />\n </svg>\n );\n}\n\nfunction FollowButton({\n frame,\n speed,\n accent,\n theme,\n layout,\n pressScale,\n}: {\n frame: number;\n speed: number;\n accent: string;\n theme: Theme;\n layout: { x: number; y: number; w: number; h: number };\n pressScale: number;\n}) {\n const followed = followStateAt(frame, speed);\n const flip = interpolate(\n frame * speed,\n [CLICK_FRAME, CLICK_FRAME + 10],\n [0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const base = {\n position: \"absolute\" as const,\n left: layout.x,\n top: layout.y,\n width: layout.w,\n height: layout.h,\n borderRadius: layout.h / 2,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontSize: 16,\n fontWeight: 700,\n fontFamily: FONT_FAMILY,\n boxSizing: \"border-box\" as const,\n transform: `scale(${pressScale})`,\n transformOrigin: \"center\",\n };\n\n return (\n <div style={base}>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n borderRadius: layout.h / 2,\n background: accent,\n color: \"#ffffff\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: 1 - flip,\n }}\n >\n Follow\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n borderRadius: layout.h / 2,\n background: theme.cardBg,\n border: `1px solid ${theme.cardBorder}`,\n color: theme.fg,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: flip,\n }}\n >\n Following\n </div>\n </div>\n );\n}\n\nfunction MessageButton({\n layout,\n theme,\n}: {\n layout: { x: number; y: number; size: number };\n theme: Theme;\n}) {\n return (\n <div\n style={{\n position: \"absolute\",\n left: layout.x,\n top: layout.y,\n width: layout.size,\n height: layout.size,\n borderRadius: layout.size / 2,\n border: `1px solid ${theme.cardBorder}`,\n background: theme.cardBg,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <svg width={20} height={20} viewBox=\"0 0 24 24\" fill={theme.fg}>\n <title>Message</title>\n <path d=\"M1.998 5.5c0-1.381 1.119-2.5 2.5-2.5h15c1.381 0 2.5 1.119 2.5 2.5v13c0 1.381-1.119 2.5-2.5 2.5h-15c-1.381 0-2.5-1.119-2.5-2.5v-13zm2.5-.5c-.276 0-.5.224-.5.5v2.764l8 3.638 8-3.638V5.5c0-.276-.224-.5-.5-.5h-15zm15.5 5.463l-8 3.638-8-3.638V18.5c0 .276.224.5.5.5h15c.276 0 .5-.224.5-.5v-8.037z\" />\n </svg>\n </div>\n );\n}\n\nfunction Tabs({\n accent,\n theme,\n isVertical,\n}: {\n accent: string;\n theme: Theme;\n isVertical: boolean;\n}) {\n const tabs = [\"Posts\", \"Replies\", \"Media\", \"Likes\"];\n return (\n <div\n style={{\n display: \"flex\",\n marginTop: 0,\n columnGap: 32,\n borderBottom: `1px solid ${theme.divider}`,\n }}\n >\n {tabs.map((tab, i) => {\n const active = i === 0;\n return (\n <div\n key={tab}\n style={{\n // flex: 1,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n paddingBottom: 12,\n position: \"relative\",\n }}\n >\n <span\n style={{\n fontSize: isVertical ? 17 : 15,\n fontWeight: active ? 700 : 500,\n color: active ? theme.fg : theme.fgMuted,\n fontFamily: FONT_FAMILY,\n }}\n >\n {tab}\n </span>\n {active && (\n <div\n style={{\n position: \"absolute\",\n bottom: -1,\n height: 4,\n width: 56,\n borderRadius: 2,\n background: accent,\n }}\n />\n )}\n </div>\n );\n })}\n </div>\n );\n}\n\nfunction SamplePost({\n name,\n handle,\n avatarUrl,\n accent,\n theme,\n}: {\n name: string;\n handle: string;\n avatarUrl: string;\n accent: string;\n theme: Theme;\n}) {\n return (\n <div\n style={{\n display: \"flex\",\n gap: 12,\n marginTop: 16,\n }}\n >\n <Avatar\n avatarUrl={avatarUrl}\n name={name}\n size={44}\n accent={accent}\n theme={theme}\n />\n <div style={{ flex: 1, minWidth: 0 }}>\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n fontFamily: FONT_FAMILY,\n }}\n >\n <span style={{ fontSize: 15, fontWeight: 700, color: theme.fg }}>\n {name}\n </span>\n <span style={{ fontSize: 15, color: theme.fgMuted }}>\n {`@${handle} · 2d`}\n </span>\n </div>\n <p\n style={{\n margin: \"4px 0 0\",\n fontSize: 15,\n color: theme.fg,\n fontFamily: FONT_FAMILY,\n lineHeight: 1.4,\n }}\n >\n Shipping something new today. Built entirely with Remotion and a lot\n of coffee. More soon.\n </p>\n <div\n style={{\n display: \"flex\",\n gap: 40,\n marginTop: 10,\n color: theme.fgMuted,\n fontFamily: FONT_FAMILY,\n fontSize: 13,\n }}\n >\n <span>12</span>\n <span>48</span>\n <span>312</span>\n </div>\n </div>\n </div>\n );\n}\n\nfunction CursorLayer({\n theme,\n accent,\n style,\n}: {\n theme: \"light\" | \"dark\";\n accent: string;\n style: CursorStyle;\n}) {\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n pointerEvents: \"none\",\n }}\n >\n <Cursor\n variant=\"pointer\"\n rippleColor={accent}\n style={style}\n />\n </div>\n );\n}\n\nexport function XFollowCard({\n name = \"remocn\",\n handle = \"remocn\",\n bio = \"Building the collaborative video toolkit for small teams.\\nShip demos faster with ready-made motion.\",\n avatarUrl = \"/logo.svg\",\n coverUrl = \"\",\n location = \"Tunisia\",\n website = \"remocn.tn\",\n joined = \"January 2024\",\n verified = true,\n accentColor = \"#1d9bf0\",\n orientation = \"horizontal\",\n speed = 1,\n}: XFollowCardProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = THEMES.light;\n const isVertical = orientation === \"vertical\";\n\n const refW = isVertical ? 720 : 1280;\n const refH = isVertical ? 1280 : 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const cardWidth = isVertical ? 660 : 600;\n const cardLeft = (refW - cardWidth) / 2;\n const cardTop = isVertical ? 140 : 70;\n const coverHeight = isVertical ? 180 : 150;\n const avatarSize = isVertical ? 120 : 110;\n\n const bounce = cardBounceIn(frame * speed, fps);\n const schedule = blurInSchedule();\n\n const layout = BUTTON_LAYOUT[orientation];\n const buttonCenter = {\n x: layout.x + layout.w / 2,\n y: layout.y + layout.h / 2,\n };\n\n const cursorStyle = useCursorPath(\n buildFollowWaypoints({ buttonCenter, orientation }),\n { speed },\n );\n const pressScale = 0.9 + 0.1 * (cursorStyle.pressScale ?? 1);\n\n const messageLayout = {\n x: layout.x - layout.h - 8,\n y: layout.y,\n size: layout.h,\n };\n\n const groupStyle = (group: number) => {\n const step = schedule[group];\n const b = blurInAt(step, frame * speed);\n return {\n filter: b.blur > 0 ? `blur(${b.blur}px)` : \"none\",\n opacity: b.opacity,\n transform: `translateY(${b.translateY}px)`,\n };\n };\n\n\n return (\n <AbsoluteFill style={{ background: \"transparent\" }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n transform: `translate(-50%, -50%) scale(${stageScale})`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: cardLeft,\n top: cardTop,\n width: cardWidth,\n background: t.cardBg,\n border: `1px solid ${t.cardBorder}`,\n borderRadius: 24,\n overflow: \"hidden\",\n transform: `translateY(${bounce.translateY}px) scale(${bounce.scale})`,\n transformOrigin: \"center top\",\n boxShadow: \"0 12px 40px -16px rgba(15,20,25,0.18)\",\n }}\n >\n <div style={groupStyle(0)}>\n <Cover\n coverUrl={coverUrl}\n accent={accentColor}\n height={coverHeight}\n />\n </div>\n\n <div style={{ padding: \"0 24px 24px\" }}>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"flex-end\",\n marginTop: -(avatarSize / 2),\n position: \"relative\",\n }}\n >\n <div\n style={{\n width: avatarSize,\n height: avatarSize,\n borderRadius: \"100%\",\n background: t.cardBg,\n flexShrink: 0,\n }}\n >\n <div style={groupStyle(1)}>\n <Avatar\n avatarUrl={avatarUrl}\n name={name}\n size={avatarSize}\n accent={accentColor}\n theme={t}\n />\n </div>\n </div>\n </div>\n\n <ProfileInfo\n name={name}\n handle={handle}\n bio={bio}\n verified={verified}\n accent={accentColor}\n theme={t}\n isVertical={isVertical}\n nameStyle={groupStyle(2)}\n handleStyle={groupStyle(3)}\n bioStyle={groupStyle(4)}\n />\n\n <div style={groupStyle(5)}>\n <MetaRow\n location={location}\n website={website}\n joined={joined}\n accent={accentColor}\n theme={t}\n />\n </div>\n\n <div style={{ height: layout.h - 8 }} aria-hidden=\"true\" />\n\n <div style={groupStyle(7)}>\n <Tabs accent={accentColor} theme={t} isVertical={isVertical} />\n </div>\n\n <div style={groupStyle(8)}>\n <SamplePost\n name={name}\n handle={handle}\n avatarUrl={avatarUrl}\n accent={accentColor}\n theme={t}\n />\n </div>\n </div>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n transform: `translateY(${bounce.translateY}px) scale(${bounce.scale})`,\n transformOrigin: \"center top\",\n }}\n >\n <div style={{ ...groupStyle(6), position: \"absolute\", inset: 0 }}>\n <MessageButton layout={messageLayout} theme={t} />\n <FollowButton\n frame={frame}\n speed={speed}\n accent={accentColor}\n theme={t}\n layout={layout}\n pressScale={pressScale}\n />\n </div>\n </div>\n\n <CursorLayer theme=\"light\" accent={accentColor} style={cursorStyle} />\n </div>\n </AbsoluteFill>\n );\n}\n",+ "content": "\"use client\";\n\nimport { loadFont } from \"@remotion/google-fonts/Inter\";\nimport { useState } from \"react\";\nimport {\n AbsoluteFill,\n Img,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Cursor, type CursorStyle } from \"@/components/remocn/cursor\";\nimport {\n type CursorWaypoint,\n useCursorPath,\n} from \"@/components/remocn/use-cursor-path\";\n\nconst { fontFamily: FONT_FAMILY } = loadFont();\n\nexport interface XFollowCardProps {\n name?: string;\n handle?: string;\n bio?: string;\n avatarUrl?: string;\n coverUrl?: string;\n location?: string;\n website?: string;\n joined?: string;\n verified?: boolean;\n accentColor?: string;\n orientation?: \"horizontal\" | \"vertical\";\n speed?: number;\n}\n\ninterface Theme {\n page: string;\n cardBg: string;\n cardBorder: string;\n fg: string;\n fgMuted: string;\n divider: string;\n}\n\nexport const THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n page: \"#f5f7f9\",\n cardBg: \"#ffffff\",\n cardBorder: \"#e6e9eb\",\n fg: \"#0f1419\",\n fgMuted: \"#536471\",\n divider: \"#eff3f4\",\n },\n dark: {\n page: \"#0a0a0a\",\n cardBg: \"#16181c\",\n cardBorder: \"#2f3336\",\n fg: \"#e7e9ea\",\n fgMuted: \"#71767b\",\n divider: \"#2f3336\",\n },\n};\n\nexport const CLICK_FRAME = 110;\n\nconst BUTTON_LAYOUT: Record<\n \"horizontal\" | \"vertical\",\n { x: number; y: number; w: number; h: number }\n> = {\n horizontal: { x: 800, y: 240, w: 116, h: 40 },\n vertical: { x: 542, y: 336, w: 124, h: 44 },\n};\n\nexport function cardBounceIn(\n frame: number,\n fps: number,\n): { translateY: number; scale: number } {\n const s = spring({\n fps,\n frame,\n config: { damping: 12, stiffness: 120, mass: 0.8 },\n });\n const translateY = interpolate(s, [0, 1], [60, 0]);\n const scale = interpolate(s, [0, 1], [0.9, 1]);\n return { translateY, scale };\n}\n\nexport function blurInSchedule(): {\n group: number;\n start: number;\n end: number;\n}[] {\n return [\n { group: 0, start: 20, end: 26 },\n { group: 1, start: 22, end: 28 },\n { group: 2, start: 24, end: 30 },\n { group: 3, start: 26, end: 32 },\n { group: 4, start: 28, end: 34 },\n { group: 5, start: 30, end: 36 },\n { group: 6, start: 32, end: 38 },\n { group: 7, start: 34, end: 40 },\n { group: 8, start: 36, end: 42 },\n ];\n}\n\nexport function blurInAt(\n step: { start: number; end: number },\n frame: number,\n): { blur: number; opacity: number; translateY: number } {\n const range: [number, number] = [step.start, step.end];\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n return {\n blur: interpolate(frame, range, [8, 0], opts),\n opacity: interpolate(frame, range, [0, 1], opts),\n translateY: interpolate(frame, range, [8, 0], opts),\n };\n}\n\nexport function followStateAt(frame: number, speed: number): boolean {\n return frame * speed >= CLICK_FRAME;\n}\n\nexport function buildFollowWaypoints(args: {\n buttonCenter: { x: number; y: number };\n orientation: \"horizontal\" | \"vertical\";\n}): CursorWaypoint[] {\n const { buttonCenter, orientation } = args;\n const rest =\n orientation === \"vertical\" ? { x: 640, y: 1120 } : { x: 1120, y: 600 };\n return [\n { at: 0, x: rest.x, y: rest.y },\n { at: 75, x: rest.x, y: rest.y },\n {\n at: CLICK_FRAME,\n x: buttonCenter.x,\n y: buttonCenter.y,\n duration: 32,\n click: true,\n easing: \"inOut\",\n },\n { at: CLICK_FRAME + 30, x: buttonCenter.x, y: buttonCenter.y },\n ];\n}\n\nfunction tintGradient(accent: string): string {\n return `linear-gradient(135deg, ${accent} 0%, ${accent}99 55%, ${accent}55 100%)`;\n}\n\nfunction Cover({\n coverUrl,\n accent,\n height,\n}: {\n coverUrl: string;\n accent: string;\n height: number;\n}) {\n const [errored, setErrored] = useState(false);\n const fallback = (\n <div\n style={{\n width: \"100%\",\n height,\n background: tintGradient(accent),\n }}\n />\n );\n if (errored || !coverUrl) return fallback;\n return (\n <Img\n src={coverUrl}\n crossOrigin=\"anonymous\"\n onError={() => setErrored(true)}\n style={{ width: \"100%\", height, objectFit: \"cover\", display: \"block\" }}\n />\n );\n}\n\nfunction Avatar({\n avatarUrl,\n name,\n size,\n accent,\n theme,\n}: {\n avatarUrl: string;\n name: string;\n size: number;\n accent: string;\n theme: Theme;\n}) {\n const [errored, setErrored] = useState(false);\n const ringStyle = {\n width: size,\n height: size,\n borderRadius: \"100%\",\n border: `4px solid ${theme.cardBg}`,\n flexShrink: 0,\n boxSizing: \"border-box\" as const,\n };\n\n if (errored || !avatarUrl) {\n return (\n <div\n style={{\n ...ringStyle,\n background: `${accent}33`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: accent,\n fontSize: size * 0.4,\n fontWeight: 700,\n fontFamily: FONT_FAMILY,\n }}\n >\n {name.charAt(0).toUpperCase()}\n </div>\n );\n }\n\n return (\n <Img\n src={avatarUrl}\n crossOrigin=\"anonymous\"\n onError={() => setErrored(true)}\n style={{ ...ringStyle, objectFit: \"cover\" }}\n />\n );\n}\n\nfunction VerifiedBadge({ accent, size }: { accent: string; size: number }) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 22 22\"\n width={size}\n height={size}\n fill={accent}\n >\n <title>Verified</title>\n <path d=\"M20.396 11c-.018-.646-.215-1.275-.57-1.816-.354-.54-.852-.972-1.438-1.246.223-.607.27-1.264.14-1.897-.131-.634-.437-1.218-.882-1.687-.47-.445-1.053-.75-1.687-.882-.633-.13-1.29-.083-1.897.14-.273-.587-.704-1.086-1.245-1.44S11.647 1.62 11 1.604c-.646.017-1.273.213-1.813.568s-.969.854-1.24 1.44c-.608-.223-1.267-.272-1.902-.14-.635.13-1.22.436-1.69.882-.445.47-.749 1.055-.878 1.688-.13.633-.08 1.29.144 1.896-.587.274-1.087.705-1.443 1.245-.356.54-.555 1.17-.574 1.817.02.647.218 1.276.574 1.817.356.54.856.972 1.443 1.245-.224.606-.274 1.263-.144 1.896.13.634.433 1.218.877 1.688.47.443 1.054.747 1.687.878.633.132 1.29.084 1.897-.136.274.586.705 1.084 1.246 1.439.54.354 1.17.551 1.816.569.647-.016 1.276-.213 1.817-.567s.972-.854 1.245-1.44c.604.239 1.266.296 1.903.164.636-.132 1.22-.447 1.68-.907.46-.46.776-1.044.908-1.681s.075-1.299-.165-1.903c.586-.274 1.084-.705 1.439-1.246.354-.54.551-1.17.569-1.816zM9.662 14.85l-3.429-3.428 1.293-1.302 2.072 2.072 4.4-4.794 1.347 1.246z\" />\n </svg>\n );\n}\n\nfunction ProfileInfo({\n name,\n handle,\n bio,\n verified,\n accent,\n theme,\n isVertical,\n nameStyle,\n handleStyle,\n bioStyle,\n}: {\n name: string;\n handle: string;\n bio: string;\n verified: boolean;\n accent: string;\n theme: Theme;\n isVertical: boolean;\n nameStyle: React.CSSProperties;\n handleStyle: React.CSSProperties;\n bioStyle: React.CSSProperties;\n}) {\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 2,\n marginTop: 12,\n }}\n >\n <div\n style={{ ...nameStyle, display: \"flex\", alignItems: \"center\", gap: 6 }}\n >\n <span\n style={{\n fontSize: isVertical ? 28 : 24,\n fontWeight: 800,\n color: theme.fg,\n fontFamily: FONT_FAMILY,\n lineHeight: 1.2,\n letterSpacing: \"-0.01em\",\n }}\n >\n {name}\n </span>\n {verified && (\n <VerifiedBadge accent={accent} size={isVertical ? 24 : 22} />\n )}\n </div>\n <span\n style={{\n ...handleStyle,\n fontSize: isVertical ? 18 : 16,\n fontWeight: 400,\n color: theme.fgMuted,\n fontFamily: FONT_FAMILY,\n lineHeight: 1.3,\n }}\n >\n @{handle}\n </span>\n <p\n style={{\n ...bioStyle,\n margin: \"8px 0 0\",\n fontSize: isVertical ? 18 : 16,\n fontWeight: 400,\n color: theme.fg,\n fontFamily: FONT_FAMILY,\n lineHeight: 1.4,\n display: \"-webkit-box\",\n WebkitLineClamp: 2,\n WebkitBoxOrient: \"vertical\",\n overflow: \"hidden\",\n }}\n >\n {bio}\n </p>\n </div>\n );\n}\n\nfunction MetaRow({\n location,\n website,\n joined,\n accent,\n theme,\n}: {\n location: string;\n website: string;\n joined: string;\n accent: string;\n theme: Theme;\n}) {\n const itemStyle = {\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n fontSize: 15,\n color: theme.fgMuted,\n fontFamily: FONT_FAMILY,\n } as const;\n return (\n <div\n style={{\n display: \"flex\",\n flexWrap: \"wrap\",\n gap: 16,\n marginTop: 14,\n }}\n >\n <span style={itemStyle}>\n <PinIcon color={theme.fgMuted} />\n {location}\n </span>\n <span style={itemStyle}>\n <LinkIcon color={theme.fgMuted} />\n <span style={{ color: accent }}>{website}</span>\n </span>\n <span style={itemStyle}>\n <CalendarIcon color={theme.fgMuted} />\n {`Joined ${joined}`}\n </span>\n </div>\n );\n}\n\nfunction PinIcon({ color }: { color: string }) {\n return (\n <svg width={16} height={16} viewBox=\"0 0 24 24\" fill={color}>\n <title>Location</title>\n <path d=\"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5a2.5 2.5 0 110-5 2.5 2.5 0 010 5z\" />\n </svg>\n );\n}\n\nfunction LinkIcon({ color }: { color: string }) {\n return (\n <svg width={16} height={16} viewBox=\"0 0 24 24\" fill={color}>\n <title>Website</title>\n <path d=\"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z\" />\n </svg>\n );\n}\n\nfunction CalendarIcon({ color }: { color: string }) {\n return (\n <svg width={16} height={16} viewBox=\"0 0 24 24\" fill={color}>\n <title>Joined</title>\n <path d=\"M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V10h14v10zm0-12H5V6h14v2z\" />\n </svg>\n );\n}\n\nfunction FollowButton({\n frame,\n speed,\n accent,\n theme,\n layout,\n pressScale,\n}: {\n frame: number;\n speed: number;\n accent: string;\n theme: Theme;\n layout: { x: number; y: number; w: number; h: number };\n pressScale: number;\n}) {\n const _followed = followStateAt(frame, speed);\n const flip = interpolate(\n frame * speed,\n [CLICK_FRAME, CLICK_FRAME + 10],\n [0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const base = {\n position: \"absolute\" as const,\n left: layout.x,\n top: layout.y,\n width: layout.w,\n height: layout.h,\n borderRadius: layout.h / 2,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontSize: 16,\n fontWeight: 700,\n fontFamily: FONT_FAMILY,\n boxSizing: \"border-box\" as const,\n transform: `scale(${pressScale})`,\n transformOrigin: \"center\",\n };\n\n return (\n <div style={base}>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n borderRadius: layout.h / 2,\n background: accent,\n color: \"#ffffff\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: 1 - flip,\n }}\n >\n Follow\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n borderRadius: layout.h / 2,\n background: theme.cardBg,\n border: `1px solid ${theme.cardBorder}`,\n color: theme.fg,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: flip,\n }}\n >\n Following\n </div>\n </div>\n );\n}\n\nfunction MessageButton({\n layout,\n theme,\n}: {\n layout: { x: number; y: number; size: number };\n theme: Theme;\n}) {\n return (\n <div\n style={{\n position: \"absolute\",\n left: layout.x,\n top: layout.y,\n width: layout.size,\n height: layout.size,\n borderRadius: layout.size / 2,\n border: `1px solid ${theme.cardBorder}`,\n background: theme.cardBg,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <svg width={20} height={20} viewBox=\"0 0 24 24\" fill={theme.fg}>\n <title>Message</title>\n <path d=\"M1.998 5.5c0-1.381 1.119-2.5 2.5-2.5h15c1.381 0 2.5 1.119 2.5 2.5v13c0 1.381-1.119 2.5-2.5 2.5h-15c-1.381 0-2.5-1.119-2.5-2.5v-13zm2.5-.5c-.276 0-.5.224-.5.5v2.764l8 3.638 8-3.638V5.5c0-.276-.224-.5-.5-.5h-15zm15.5 5.463l-8 3.638-8-3.638V18.5c0 .276.224.5.5.5h15c.276 0 .5-.224.5-.5v-8.037z\" />\n </svg>\n </div>\n );\n}\n\nfunction Tabs({\n accent,\n theme,\n isVertical,\n}: {\n accent: string;\n theme: Theme;\n isVertical: boolean;\n}) {\n const tabs = [\"Posts\", \"Replies\", \"Media\", \"Likes\"];\n return (\n <div\n style={{\n display: \"flex\",\n marginTop: 0,\n columnGap: 32,\n borderBottom: `1px solid ${theme.divider}`,\n }}\n >\n {tabs.map((tab, i) => {\n const active = i === 0;\n return (\n <div\n key={tab}\n style={{\n // flex: 1,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n paddingBottom: 12,\n position: \"relative\",\n }}\n >\n <span\n style={{\n fontSize: isVertical ? 17 : 15,\n fontWeight: active ? 700 : 500,\n color: active ? theme.fg : theme.fgMuted,\n fontFamily: FONT_FAMILY,\n }}\n >\n {tab}\n </span>\n {active && (\n <div\n style={{\n position: \"absolute\",\n bottom: -1,\n height: 4,\n width: 56,\n borderRadius: 2,\n background: accent,\n }}\n />\n )}\n </div>\n );\n })}\n </div>\n );\n}\n\nfunction SamplePost({\n name,\n handle,\n avatarUrl,\n accent,\n theme,\n}: {\n name: string;\n handle: string;\n avatarUrl: string;\n accent: string;\n theme: Theme;\n}) {\n return (\n <div\n style={{\n display: \"flex\",\n gap: 12,\n marginTop: 16,\n }}\n >\n <Avatar\n avatarUrl={avatarUrl}\n name={name}\n size={44}\n accent={accent}\n theme={theme}\n />\n <div style={{ flex: 1, minWidth: 0 }}>\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n fontFamily: FONT_FAMILY,\n }}\n >\n <span style={{ fontSize: 15, fontWeight: 700, color: theme.fg }}>\n {name}\n </span>\n <span style={{ fontSize: 15, color: theme.fgMuted }}>\n {`@${handle} · 2d`}\n </span>\n </div>\n <p\n style={{\n margin: \"4px 0 0\",\n fontSize: 15,\n color: theme.fg,\n fontFamily: FONT_FAMILY,\n lineHeight: 1.4,\n }}\n >\n Shipping something new today. Built entirely with Remotion and a lot\n of coffee. More soon.\n </p>\n <div\n style={{\n display: \"flex\",\n gap: 40,\n marginTop: 10,\n color: theme.fgMuted,\n fontFamily: FONT_FAMILY,\n fontSize: 13,\n }}\n >\n <span>12</span>\n <span>48</span>\n <span>312</span>\n </div>\n </div>\n </div>\n );\n}\n\nfunction CursorLayer({\n accent,\n style,\n}: {\n accent: string;\n style: CursorStyle;\n}) {\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n pointerEvents: \"none\",\n }}\n >\n <Cursor variant=\"pointer\" rippleColor={accent} style={style} />\n </div>\n );\n}\n\nexport function XFollowCard({\n name = \"remocn\",\n handle = \"remocn\",\n bio = \"Building the collaborative video toolkit for small teams.\\nShip demos faster with ready-made motion.\",\n avatarUrl = \"/logo.svg\",\n coverUrl = \"\",\n location = \"Tunisia\",\n website = \"remocn.tn\",\n joined = \"January 2024\",\n verified = true,\n accentColor = \"#1d9bf0\",\n orientation = \"horizontal\",\n speed = 1,\n}: XFollowCardProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = THEMES.light;\n const isVertical = orientation === \"vertical\";\n\n const refW = isVertical ? 720 : 1280;\n const refH = isVertical ? 1280 : 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const cardWidth = isVertical ? 660 : 600;\n const cardLeft = (refW - cardWidth) / 2;\n const cardTop = isVertical ? 140 : 70;\n const coverHeight = isVertical ? 180 : 150;\n const avatarSize = isVertical ? 120 : 110;\n\n const bounce = cardBounceIn(frame * speed, fps);\n const schedule = blurInSchedule();\n\n const layout = BUTTON_LAYOUT[orientation];\n const buttonCenter = {\n x: layout.x + layout.w / 2,\n y: layout.y + layout.h / 2,\n };\n\n const cursorStyle = useCursorPath(\n buildFollowWaypoints({ buttonCenter, orientation }),\n { speed },\n );\n const pressScale = 0.9 + 0.1 * (cursorStyle.pressScale ?? 1);\n\n const messageLayout = {\n x: layout.x - layout.h - 8,\n y: layout.y,\n size: layout.h,\n };\n\n const groupStyle = (group: number) => {\n const step = schedule[group];\n const b = blurInAt(step, frame * speed);\n return {\n filter: b.blur > 0 ? `blur(${b.blur}px)` : \"none\",\n opacity: b.opacity,\n transform: `translateY(${b.translateY}px)`,\n };\n };\n\n return (\n <AbsoluteFill style={{ background: \"transparent\" }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n transform: `translate(-50%, -50%) scale(${stageScale})`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: cardLeft,\n top: cardTop,\n width: cardWidth,\n background: t.cardBg,\n border: `1px solid ${t.cardBorder}`,\n borderRadius: 24,\n overflow: \"hidden\",\n transform: `translateY(${bounce.translateY}px) scale(${bounce.scale})`,\n transformOrigin: \"center top\",\n boxShadow: \"0 12px 40px -16px rgba(15,20,25,0.18)\",\n }}\n >\n <div style={groupStyle(0)}>\n <Cover\n coverUrl={coverUrl}\n accent={accentColor}\n height={coverHeight}\n />\n </div>\n\n <div style={{ padding: \"0 24px 24px\" }}>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"flex-end\",\n marginTop: -(avatarSize / 2),\n position: \"relative\",\n }}\n >\n <div\n style={{\n width: avatarSize,\n height: avatarSize,\n borderRadius: \"100%\",\n background: t.cardBg,\n flexShrink: 0,\n }}\n >\n <div style={groupStyle(1)}>\n <Avatar\n avatarUrl={avatarUrl}\n name={name}\n size={avatarSize}\n accent={accentColor}\n theme={t}\n />\n </div>\n </div>\n </div>\n\n <ProfileInfo\n name={name}\n handle={handle}\n bio={bio}\n verified={verified}\n accent={accentColor}\n theme={t}\n isVertical={isVertical}\n nameStyle={groupStyle(2)}\n handleStyle={groupStyle(3)}\n bioStyle={groupStyle(4)}\n />\n\n <div style={groupStyle(5)}>\n <MetaRow\n location={location}\n website={website}\n joined={joined}\n accent={accentColor}\n theme={t}\n />\n </div>\n\n <div style={{ height: layout.h - 8 }} aria-hidden=\"true\" />\n\n <div style={groupStyle(7)}>\n <Tabs accent={accentColor} theme={t} isVertical={isVertical} />\n </div>\n\n <div style={groupStyle(8)}>\n <SamplePost\n name={name}\n handle={handle}\n avatarUrl={avatarUrl}\n accent={accentColor}\n theme={t}\n />\n </div>\n </div>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n transform: `translateY(${bounce.translateY}px) scale(${bounce.scale})`,\n transformOrigin: \"center top\",\n }}\n >\n <div style={{ ...groupStyle(6), position: \"absolute\", inset: 0 }}>\n <MessageButton layout={messageLayout} theme={t} />\n <FollowButton\n frame={frame}\n speed={speed}\n accent={accentColor}\n theme={t}\n layout={layout}\n pressScale={pressScale}\n />\n </div>\n </div>\n\n <CursorLayer accent={accentColor} style={cursorStyle} />\n </div>\n </AbsoluteFill>\n );\n}\n","type": "registry:component","target": "components/remocn/x-follow-card.tsx"}diff --git a/public/r/x-followers-overview.json b/public/r/x-followers-overview.jsonindex 6e5927ef..c5f22a24 100644--- a/public/r/x-followers-overview.json+++ b/public/r/x-followers-overview.json@@ -8,7 +8,7 @@"files": [{"path": "registry/remocn/x-followers-overview/index.tsx",- "content": "\"use client\";\n\nimport { useState } from \"react\";\nimport { loadFont as loadSans } from \"@remotion/google-fonts/Manrope\";\nimport {\n AbsoluteFill,\n Easing,\n Img,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Confetti } from \"@/components/remocn/confetti\";\n\nexport interface FollowerNotification {\n name: string;\n verified: boolean;\n /** Relative time label, e.g. \"7h\", \"1d\". */\n time: string;\n}\n\nexport interface XFollowersOverviewProps {\n notifications?: FollowerNotification[];\n totalFollowers?: number;\n handle?: string;\n avatarUrl?: string;\n accentColor?: string;\n orientation?: \"horizontal\" | \"vertical\";\n speed?: number;\n}\n\nconst { fontFamily: SANS_FAMILY } = loadSans();\nconst FONT_FAMILY = SANS_FAMILY;\n\ninterface Theme {\n bg: string;\n fg: string;\n fgMuted: string;\n border: string;\n}\n\nconst THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n bg: \"#ffffff\",\n fg: \"#0f1419\",\n fgMuted: \"#536471\",\n border: \"#eff3f4\",\n },\n dark: {\n bg: \"#0a0a0a\",\n fg: \"#e7e9ea\",\n fgMuted: \"#71767b\",\n border: \"#2f3336\",\n },\n};\n\n/**\n * Hardcoded sample notifications so the composition renders immediately from\n * defaults. A future revision swaps this for live X API data.\n */\nexport const SAMPLE_FOLLOWERS: FollowerNotification[] = [\n { name: \"Andre Vitorio\", verified: true, time: \"7h\" },\n { name: \"Sarah Chen\", verified: true, time: \"7h\" },\n { name: \"marcus\", verified: false, time: \"8h\" },\n { name: \"Lena Powell\", verified: true, time: \"9h\" },\n { name: \"dev_jay\", verified: false, time: \"10h\" },\n { name: \"Priya Nair\", verified: true, time: \"11h\" },\n { name: \"Tomás Rivera\", verified: true, time: \"13h\" },\n { name: \"hana.eth\", verified: false, time: \"15h\" },\n { name: \"Will Carter\", verified: true, time: \"18h\" },\n { name: \"Yuki Tanaka\", verified: true, time: \"21h\" },\n { name: \"benoit\", verified: false, time: \"23h\" },\n { name: \"Amara Okafor\", verified: true, time: \"1d\" },\n { name: \"Leo Martins\", verified: true, time: \"1d\" },\n { name: \"sol\", verified: false, time: \"2d\" },\n];\n\n// --- Pure helpers (unit-tested) -------------------------------------------\n\n/** Map an effective frame to the active notification index + in-slot fraction. */\nexport function slotProgress(\n fc: number,\n slotFrames: number,\n count: number,\n): { idx: number; frac: number } {\n if (slotFrames <= 0 || count <= 0) return { idx: 0, frac: 0 };\n const pos = fc / slotFrames;\n const idx = Math.max(0, Math.min(Math.floor(pos), count - 1));\n const frac = Math.max(0, Math.min(pos - idx, 1));\n return { idx, frac };\n}\n\n/** Smoothstep flip ramp: rest for `hold` of the slot, then flip 0→1. */\nexport function flipEase(frac: number, hold: number): number {\n if (hold >= 1) return 0;\n const raw = (frac - hold) / (1 - hold);\n const c = Math.max(0, Math.min(raw, 1));\n return c * c * (3 - 2 * c);\n}\n\nexport function blurIn(\n frame: number,\n start: number,\n end: number,\n): { blur: number; opacity: number; translateY: number } {\n const range: [number, number] = [start, end];\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n return {\n blur: interpolate(frame, range, [10, 0], opts),\n opacity: interpolate(frame, range, [0, 1], opts),\n translateY: interpolate(frame, range, [12, 0], opts),\n };\n}\n\n// --- Sub-components --------------------------------------------------------\n\nfunction VerifiedBadge({ accent, size }: { accent: string; size: number }) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 22 22\"\n width={size}\n height={size}\n fill={accent}\n style={{ flexShrink: 0 }}\n >\n <title>Verified</title>\n <path d=\"M20.396 11c-.018-.646-.215-1.275-.57-1.816-.354-.54-.852-.972-1.438-1.246.223-.607.27-1.264.14-1.897-.131-.634-.437-1.218-.882-1.687-.47-.445-1.053-.75-1.687-.882-.633-.13-1.29-.083-1.897.14-.273-.587-.704-1.086-1.245-1.44S11.647 1.62 11 1.604c-.646.017-1.273.213-1.813.568s-.969.854-1.24 1.44c-.608-.223-1.267-.272-1.902-.14-.635.13-1.22.436-1.69.882-.445.47-.749 1.055-.878 1.688-.13.633-.08 1.29.144 1.896-.587.274-1.087.705-1.443 1.245-.356.54-.555 1.17-.574 1.817.02.647.218 1.276.574 1.817.356.54.856.972 1.443 1.245-.224.606-.274 1.263-.144 1.896.13.634.433 1.218.877 1.688.47.443 1.054.747 1.687.878.633.132 1.29.084 1.897-.136.274.586.705 1.084 1.246 1.439.54.354 1.17.551 1.816.569.647-.016 1.276-.213 1.817-.567s.972-.854 1.245-1.44c.604.239 1.266.296 1.903.164.636-.132 1.22-.447 1.68-.907.46-.46.776-1.044.908-1.681s.075-1.299-.165-1.903c.586-.274 1.084-.705 1.439-1.246.354-.54.551-1.17.569-1.816zM9.662 14.85l-3.429-3.428 1.293-1.302 2.072 2.072 4.4-4.794 1.347 1.246z\" />\n </svg>\n );\n}\n\nfunction Avatar({\n avatarUrl,\n handle,\n size,\n theme,\n}: {\n avatarUrl: string;\n handle: string;\n size: number;\n theme: Theme;\n}) {\n const [errored, setErrored] = useState(false);\n const ringStyle = {\n width: size,\n height: size,\n borderRadius: 9999,\n border: `1px solid ${theme.border}`,\n flexShrink: 0,\n } as const;\n\n if (errored || !avatarUrl) {\n return (\n <div\n style={{\n ...ringStyle,\n background: theme.border,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: theme.fgMuted,\n fontSize: size * 0.42,\n fontWeight: 700,\n fontFamily: FONT_FAMILY,\n }}\n >\n {handle.charAt(0).toUpperCase()}\n </div>\n );\n }\n\n return (\n <Img\n src={avatarUrl}\n crossOrigin=\"anonymous\"\n onError={() => setErrored(true)}\n style={{ ...ringStyle, objectFit: \"cover\" }}\n />\n );\n}\n\n/** Username + verified badge — the only part that flips. Absolutely overlaid\n * and centered inside a slot sized to the active name, so the line as a whole\n * stays centered while names swap. */\nfunction NameBlock({\n item,\n fontSize,\n height,\n theme,\n accent,\n deg,\n opacity,\n}: {\n item: FollowerNotification;\n fontSize: number;\n height: number;\n theme: Theme;\n accent: string;\n deg: number;\n opacity: number;\n}) {\n return (\n <div\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n top: 0,\n height,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: fontSize * 0.2,\n whiteSpace: \"nowrap\",\n transformOrigin: \"center\",\n backfaceVisibility: \"hidden\",\n transform: `rotateX(${deg}deg)`,\n opacity,\n }}\n >\n <span\n style={{\n fontFamily: FONT_FAMILY,\n fontSize,\n fontWeight: 800,\n color: theme.fg,\n lineHeight: 1,\n }}\n >\n {item.name}\n </span>\n {item.verified && (\n <VerifiedBadge accent={accent} size={fontSize * 0.66} />\n )}\n </div>\n );\n}\n\n// --- Main composition ------------------------------------------------------\n\nexport function XFollowersOverview({\n notifications = SAMPLE_FOLLOWERS,\n totalFollowers = 1709,\n handle = \"remocn\",\n avatarUrl = \"/logo.svg\",\n accentColor = \"#1d9bf0\",\n orientation = \"horizontal\",\n speed = 1,\n}: XFollowersOverviewProps) {\n const frame = useCurrentFrame();\n const { durationInFrames, width, height, fps } = useVideoConfig();\n const t = THEMES.light;\n const isVertical = orientation === \"vertical\";\n\n const refW = isVertical ? 720 : 1280;\n const refH = isVertical ? 1280 : 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const notifSize = isVertical ? 38 : 46;\n const countNum = isVertical ? 92 : 110;\n const countLabel = isVertical ? 40 : 46;\n const perspective = isVertical ? 1000 : 1200;\n const stageH = isVertical ? 160 : 180;\n const lineH = notifSize * 1.4;\n // Fast cadence: ~0.43s per username at speed 1; flip occupies the back half.\n const SLOT = 13;\n const HOLD = 0.45;\n\n const fc = frame * speed;\n const items = notifications.length > 0 ? notifications : SAMPLE_FOLLOWERS;\n const count = items.length;\n\n // Notifications cycle first, then the total blurs in. The reveal starts once\n // the list is exhausted, capped so it always fits before the timeline ends.\n const revealStart = Math.min(\n count * SLOT,\n Math.round(durationInFrames * 0.82),\n );\n\n const { idx, frac } = slotProgress(fc, SLOT, count);\n const flipP = flipEase(frac, HOLD);\n const hasNext = idx + 1 < count;\n\n const current = items[idx];\n const next = hasNext ? items[idx + 1] : undefined;\n const activeItem = flipP >= 0.5 && next ? next : current;\n\n const currentDeg = hasNext ? -90 * flipP : 0;\n const currentOpacity = hasNext\n ? interpolate(flipP, [0, 0.55], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 1;\n const nextDeg = 90 * (1 - flipP);\n const nextOpacity = interpolate(flipP, [0.45, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const notifOpacity = interpolate(\n fc,\n [revealStart - 4, revealStart + 8],\n [1, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n const countIn = blurIn(fc, revealStart + 4, revealStart + 28);\n // Dynamic pop: spring overshoot on the total as it blurs in.\n const revealSpring = spring({\n fps,\n frame: fc - (revealStart + 2),\n config: { damping: 10, stiffness: 170, mass: 0.8 },\n });\n const revealScale = interpolate(revealSpring, [0, 1], [0.5, 1]);\n\n // Avatar + handle reveal in sync with the total: same window as countIn,\n // avatar sliding in from the left, handle from the right.\n const avatarSize = isVertical ? 72 : 64;\n const handleSize = isVertical ? 30 : 34;\n const avatarIn = blurIn(fc, revealStart + 4, revealStart + 28);\n const handleIn = avatarIn;\n const slideOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n const avatarX = interpolate(\n fc,\n [revealStart + 4, revealStart + 28],\n [-36, 0],\n slideOpts,\n );\n const handleX = interpolate(\n fc,\n [revealStart + 4, revealStart + 28],\n [36, 0],\n slideOpts,\n );\n\n // Confetti fires on the real frame the reveal begins (sync across speeds),\n // centered on the canvas.\n const confettiStart = Math.round((revealStart + 2) / speed);\n const confettiColors = [\n accentColor,\n \"#ff5da2\",\n \"#ffd23f\",\n \"#22c55e\",\n \"#a855f7\",\n ];\n\n\n return (\n <AbsoluteFill style={{ background: \"transparent\" }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n transform: `translate(-50%, -50%) scale(${stageScale})`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div style={{ position: \"relative\", width: refW, height: stageH }}>\n {/* Cycling notifications — only the username flips in 3D, the\n \"followed you · <time>\" suffix stays put. */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: notifSize * 0.28,\n opacity: notifOpacity,\n }}\n >\n <div\n style={{\n position: \"relative\",\n height: lineH,\n perspective,\n display: \"inline-flex\",\n }}\n >\n {/* Invisible spacer sizes the slot to the active name so the\n whole line stays centered; flips overlay it absolutely. */}\n <div\n aria-hidden=\"true\"\n style={{\n visibility: \"hidden\",\n display: \"flex\",\n alignItems: \"center\",\n gap: notifSize * 0.2,\n whiteSpace: \"nowrap\",\n fontFamily: FONT_FAMILY,\n fontSize: notifSize,\n fontWeight: 800,\n }}\n >\n {activeItem.name}\n {activeItem.verified && (\n <span style={{ width: notifSize * 0.66 }} />\n )}\n </div>\n <NameBlock\n item={current}\n fontSize={notifSize}\n height={lineH}\n theme={t}\n accent={accentColor}\n deg={currentDeg}\n opacity={currentOpacity}\n />\n {next && (\n <NameBlock\n item={next}\n fontSize={notifSize}\n height={lineH}\n theme={t}\n accent={accentColor}\n deg={nextDeg}\n opacity={nextOpacity}\n />\n )}\n </div>\n <span\n style={{\n fontFamily: FONT_FAMILY,\n fontSize: notifSize,\n fontWeight: 500,\n color: t.fgMuted,\n whiteSpace: \"nowrap\",\n lineHeight: 1,\n }}\n >\n followed you · {activeItem.time}\n </span>\n </div>\n\n {/* Total reveal: avatar + handle above the count */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: isVertical ? 26 : 22,\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 14,\n }}\n >\n <div\n style={{\n opacity: avatarIn.opacity,\n filter:\n avatarIn.blur > 0 ? `blur(${avatarIn.blur}px)` : \"none\",\n transform: `translateX(${avatarX}px)`,\n }}\n >\n <Avatar\n avatarUrl={avatarUrl}\n handle={handle}\n size={avatarSize}\n theme={t}\n />\n </div>\n <span\n style={{\n fontFamily: FONT_FAMILY,\n fontSize: handleSize,\n fontWeight: 700,\n color: t.fg,\n whiteSpace: \"nowrap\",\n opacity: handleIn.opacity,\n filter:\n handleIn.blur > 0 ? `blur(${handleIn.blur}px)` : \"none\",\n transform: `translateX(${handleX}px)`,\n }}\n >\n @{handle}\n </span>\n </div>\n\n <div\n style={{\n display: \"flex\",\n alignItems: \"baseline\",\n justifyContent: \"center\",\n gap: 18,\n opacity: countIn.opacity,\n filter: countIn.blur > 0 ? `blur(${countIn.blur}px)` : \"none\",\n transform: `translateY(${countIn.translateY}px) scale(${revealScale})`,\n }}\n >\n <span\n style={{\n fontFamily: FONT_FAMILY,\n fontSize: countNum,\n fontWeight: 800,\n color: t.fg,\n letterSpacing: \"-0.03em\",\n fontVariantNumeric: \"tabular-nums\",\n lineHeight: 1,\n }}\n >\n {totalFollowers.toLocaleString(\"en-US\")}\n </span>\n <span\n style={{\n fontFamily: FONT_FAMILY,\n fontSize: countLabel,\n fontWeight: 500,\n color: t.fgMuted,\n lineHeight: 1,\n }}\n >\n Followers\n </span>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <Confetti\n startFrame={confettiStart}\n originX={0.5}\n originY={0.5}\n colors={confettiColors}\n particleCount={160}\n />\n </AbsoluteFill>\n );\n}\n",+ "content": "\"use client\";\n\nimport { loadFont as loadSans } from \"@remotion/google-fonts/Manrope\";\nimport { useState } from \"react\";\nimport {\n AbsoluteFill,\n Img,\n interpolate,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { Confetti } from \"@/components/remocn/confetti\";\n\nexport interface FollowerNotification {\n name: string;\n verified: boolean;\n /** Relative time label, e.g. \"7h\", \"1d\". */\n time: string;\n}\n\nexport interface XFollowersOverviewProps {\n notifications?: FollowerNotification[];\n totalFollowers?: number;\n handle?: string;\n avatarUrl?: string;\n accentColor?: string;\n orientation?: \"horizontal\" | \"vertical\";\n speed?: number;\n}\n\nconst { fontFamily: SANS_FAMILY } = loadSans();\nconst FONT_FAMILY = SANS_FAMILY;\n\ninterface Theme {\n bg: string;\n fg: string;\n fgMuted: string;\n border: string;\n}\n\nconst THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n bg: \"#ffffff\",\n fg: \"#0f1419\",\n fgMuted: \"#536471\",\n border: \"#eff3f4\",\n },\n dark: {\n bg: \"#0a0a0a\",\n fg: \"#e7e9ea\",\n fgMuted: \"#71767b\",\n border: \"#2f3336\",\n },\n};\n\n/**\n * Hardcoded sample notifications so the composition renders immediately from\n * defaults. A future revision swaps this for live X API data.\n */\nexport const SAMPLE_FOLLOWERS: FollowerNotification[] = [\n { name: \"Andre Vitorio\", verified: true, time: \"7h\" },\n { name: \"Sarah Chen\", verified: true, time: \"7h\" },\n { name: \"marcus\", verified: false, time: \"8h\" },\n { name: \"Lena Powell\", verified: true, time: \"9h\" },\n { name: \"dev_jay\", verified: false, time: \"10h\" },\n { name: \"Priya Nair\", verified: true, time: \"11h\" },\n { name: \"Tomás Rivera\", verified: true, time: \"13h\" },\n { name: \"hana.eth\", verified: false, time: \"15h\" },\n { name: \"Will Carter\", verified: true, time: \"18h\" },\n { name: \"Yuki Tanaka\", verified: true, time: \"21h\" },\n { name: \"benoit\", verified: false, time: \"23h\" },\n { name: \"Amara Okafor\", verified: true, time: \"1d\" },\n { name: \"Leo Martins\", verified: true, time: \"1d\" },\n { name: \"sol\", verified: false, time: \"2d\" },\n];\n\n// --- Pure helpers (unit-tested) -------------------------------------------\n\n/** Map an effective frame to the active notification index + in-slot fraction. */\nexport function slotProgress(\n fc: number,\n slotFrames: number,\n count: number,\n): { idx: number; frac: number } {\n if (slotFrames <= 0 || count <= 0) return { idx: 0, frac: 0 };\n const pos = fc / slotFrames;\n const idx = Math.max(0, Math.min(Math.floor(pos), count - 1));\n const frac = Math.max(0, Math.min(pos - idx, 1));\n return { idx, frac };\n}\n\n/** Smoothstep flip ramp: rest for `hold` of the slot, then flip 0→1. */\nexport function flipEase(frac: number, hold: number): number {\n if (hold >= 1) return 0;\n const raw = (frac - hold) / (1 - hold);\n const c = Math.max(0, Math.min(raw, 1));\n return c * c * (3 - 2 * c);\n}\n\nexport function blurIn(\n frame: number,\n start: number,\n end: number,\n): { blur: number; opacity: number; translateY: number } {\n const range: [number, number] = [start, end];\n const opts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n return {\n blur: interpolate(frame, range, [10, 0], opts),\n opacity: interpolate(frame, range, [0, 1], opts),\n translateY: interpolate(frame, range, [12, 0], opts),\n };\n}\n\n// --- Sub-components --------------------------------------------------------\n\nfunction VerifiedBadge({ accent, size }: { accent: string; size: number }) {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 22 22\"\n width={size}\n height={size}\n fill={accent}\n style={{ flexShrink: 0 }}\n >\n <title>Verified</title>\n <path d=\"M20.396 11c-.018-.646-.215-1.275-.57-1.816-.354-.54-.852-.972-1.438-1.246.223-.607.27-1.264.14-1.897-.131-.634-.437-1.218-.882-1.687-.47-.445-1.053-.75-1.687-.882-.633-.13-1.29-.083-1.897.14-.273-.587-.704-1.086-1.245-1.44S11.647 1.62 11 1.604c-.646.017-1.273.213-1.813.568s-.969.854-1.24 1.44c-.608-.223-1.267-.272-1.902-.14-.635.13-1.22.436-1.69.882-.445.47-.749 1.055-.878 1.688-.13.633-.08 1.29.144 1.896-.587.274-1.087.705-1.443 1.245-.356.54-.555 1.17-.574 1.817.02.647.218 1.276.574 1.817.356.54.856.972 1.443 1.245-.224.606-.274 1.263-.144 1.896.13.634.433 1.218.877 1.688.47.443 1.054.747 1.687.878.633.132 1.29.084 1.897-.136.274.586.705 1.084 1.246 1.439.54.354 1.17.551 1.816.569.647-.016 1.276-.213 1.817-.567s.972-.854 1.245-1.44c.604.239 1.266.296 1.903.164.636-.132 1.22-.447 1.68-.907.46-.46.776-1.044.908-1.681s.075-1.299-.165-1.903c.586-.274 1.084-.705 1.439-1.246.354-.54.551-1.17.569-1.816zM9.662 14.85l-3.429-3.428 1.293-1.302 2.072 2.072 4.4-4.794 1.347 1.246z\" />\n </svg>\n );\n}\n\nfunction Avatar({\n avatarUrl,\n handle,\n size,\n theme,\n}: {\n avatarUrl: string;\n handle: string;\n size: number;\n theme: Theme;\n}) {\n const [errored, setErrored] = useState(false);\n const ringStyle = {\n width: size,\n height: size,\n borderRadius: 9999,\n border: `1px solid ${theme.border}`,\n flexShrink: 0,\n } as const;\n\n if (errored || !avatarUrl) {\n return (\n <div\n style={{\n ...ringStyle,\n background: theme.border,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: theme.fgMuted,\n fontSize: size * 0.42,\n fontWeight: 700,\n fontFamily: FONT_FAMILY,\n }}\n >\n {handle.charAt(0).toUpperCase()}\n </div>\n );\n }\n\n return (\n <Img\n src={avatarUrl}\n crossOrigin=\"anonymous\"\n onError={() => setErrored(true)}\n style={{ ...ringStyle, objectFit: \"cover\" }}\n />\n );\n}\n\n/** Username + verified badge — the only part that flips. Absolutely overlaid\n * and centered inside a slot sized to the active name, so the line as a whole\n * stays centered while names swap. */\nfunction NameBlock({\n item,\n fontSize,\n height,\n theme,\n accent,\n deg,\n opacity,\n}: {\n item: FollowerNotification;\n fontSize: number;\n height: number;\n theme: Theme;\n accent: string;\n deg: number;\n opacity: number;\n}) {\n return (\n <div\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n top: 0,\n height,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: fontSize * 0.2,\n whiteSpace: \"nowrap\",\n transformOrigin: \"center\",\n backfaceVisibility: \"hidden\",\n transform: `rotateX(${deg}deg)`,\n opacity,\n }}\n >\n <span\n style={{\n fontFamily: FONT_FAMILY,\n fontSize,\n fontWeight: 800,\n color: theme.fg,\n lineHeight: 1,\n }}\n >\n {item.name}\n </span>\n {item.verified && (\n <VerifiedBadge accent={accent} size={fontSize * 0.66} />\n )}\n </div>\n );\n}\n\n// --- Main composition ------------------------------------------------------\n\nexport function XFollowersOverview({\n notifications = SAMPLE_FOLLOWERS,\n totalFollowers = 1709,\n handle = \"remocn\",\n avatarUrl = \"/logo.svg\",\n accentColor = \"#1d9bf0\",\n orientation = \"horizontal\",\n speed = 1,\n}: XFollowersOverviewProps) {\n const frame = useCurrentFrame();\n const { durationInFrames, width, height, fps } = useVideoConfig();\n const t = THEMES.light;\n const isVertical = orientation === \"vertical\";\n\n const refW = isVertical ? 720 : 1280;\n const refH = isVertical ? 1280 : 720;\n const stageScale = Math.min(width / refW, height / refH);\n\n const notifSize = isVertical ? 38 : 46;\n const countNum = isVertical ? 92 : 110;\n const countLabel = isVertical ? 40 : 46;\n const perspective = isVertical ? 1000 : 1200;\n const stageH = isVertical ? 160 : 180;\n const lineH = notifSize * 1.4;\n // Fast cadence: ~0.43s per username at speed 1; flip occupies the back half.\n const SLOT = 13;\n const HOLD = 0.45;\n\n const fc = frame * speed;\n const items = notifications.length > 0 ? notifications : SAMPLE_FOLLOWERS;\n const count = items.length;\n\n // Notifications cycle first, then the total blurs in. The reveal starts once\n // the list is exhausted, capped so it always fits before the timeline ends.\n const revealStart = Math.min(\n count * SLOT,\n Math.round(durationInFrames * 0.82),\n );\n\n const { idx, frac } = slotProgress(fc, SLOT, count);\n const flipP = flipEase(frac, HOLD);\n const hasNext = idx + 1 < count;\n\n const current = items[idx];\n const next = hasNext ? items[idx + 1] : undefined;\n const activeItem = flipP >= 0.5 && next ? next : current;\n\n const currentDeg = hasNext ? -90 * flipP : 0;\n const currentOpacity = hasNext\n ? interpolate(flipP, [0, 0.55], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 1;\n const nextDeg = 90 * (1 - flipP);\n const nextOpacity = interpolate(flipP, [0.45, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const notifOpacity = interpolate(\n fc,\n [revealStart - 4, revealStart + 8],\n [1, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n const countIn = blurIn(fc, revealStart + 4, revealStart + 28);\n // Dynamic pop: spring overshoot on the total as it blurs in.\n const revealSpring = spring({\n fps,\n frame: fc - (revealStart + 2),\n config: { damping: 10, stiffness: 170, mass: 0.8 },\n });\n const revealScale = interpolate(revealSpring, [0, 1], [0.5, 1]);\n\n // Avatar + handle reveal in sync with the total: same window as countIn,\n // avatar sliding in from the left, handle from the right.\n const avatarSize = isVertical ? 72 : 64;\n const handleSize = isVertical ? 30 : 34;\n const avatarIn = blurIn(fc, revealStart + 4, revealStart + 28);\n const handleIn = avatarIn;\n const slideOpts = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n };\n const avatarX = interpolate(\n fc,\n [revealStart + 4, revealStart + 28],\n [-36, 0],\n slideOpts,\n );\n const handleX = interpolate(\n fc,\n [revealStart + 4, revealStart + 28],\n [36, 0],\n slideOpts,\n );\n\n // Confetti fires on the real frame the reveal begins (sync across speeds),\n // centered on the canvas.\n const confettiStart = Math.round((revealStart + 2) / speed);\n const confettiColors = [\n accentColor,\n \"#ff5da2\",\n \"#ffd23f\",\n \"#22c55e\",\n \"#a855f7\",\n ];\n\n return (\n <AbsoluteFill style={{ background: \"transparent\" }}>\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: refW,\n height: refH,\n transform: `translate(-50%, -50%) scale(${stageScale})`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div style={{ position: \"relative\", width: refW, height: stageH }}>\n {/* Cycling notifications — only the username flips in 3D, the\n \"followed you · <time>\" suffix stays put. */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: notifSize * 0.28,\n opacity: notifOpacity,\n }}\n >\n <div\n style={{\n position: \"relative\",\n height: lineH,\n perspective,\n display: \"inline-flex\",\n }}\n >\n {/* Invisible spacer sizes the slot to the active name so the\n whole line stays centered; flips overlay it absolutely. */}\n <div\n aria-hidden=\"true\"\n style={{\n visibility: \"hidden\",\n display: \"flex\",\n alignItems: \"center\",\n gap: notifSize * 0.2,\n whiteSpace: \"nowrap\",\n fontFamily: FONT_FAMILY,\n fontSize: notifSize,\n fontWeight: 800,\n }}\n >\n {activeItem.name}\n {activeItem.verified && (\n <span style={{ width: notifSize * 0.66 }} />\n )}\n </div>\n <NameBlock\n item={current}\n fontSize={notifSize}\n height={lineH}\n theme={t}\n accent={accentColor}\n deg={currentDeg}\n opacity={currentOpacity}\n />\n {next && (\n <NameBlock\n item={next}\n fontSize={notifSize}\n height={lineH}\n theme={t}\n accent={accentColor}\n deg={nextDeg}\n opacity={nextOpacity}\n />\n )}\n </div>\n <span\n style={{\n fontFamily: FONT_FAMILY,\n fontSize: notifSize,\n fontWeight: 500,\n color: t.fgMuted,\n whiteSpace: \"nowrap\",\n lineHeight: 1,\n }}\n >\n followed you · {activeItem.time}\n </span>\n </div>\n\n {/* Total reveal: avatar + handle above the count */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: isVertical ? 26 : 22,\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 14,\n }}\n >\n <div\n style={{\n opacity: avatarIn.opacity,\n filter:\n avatarIn.blur > 0 ? `blur(${avatarIn.blur}px)` : \"none\",\n transform: `translateX(${avatarX}px)`,\n }}\n >\n <Avatar\n avatarUrl={avatarUrl}\n handle={handle}\n size={avatarSize}\n theme={t}\n />\n </div>\n <span\n style={{\n fontFamily: FONT_FAMILY,\n fontSize: handleSize,\n fontWeight: 700,\n color: t.fg,\n whiteSpace: \"nowrap\",\n opacity: handleIn.opacity,\n filter:\n handleIn.blur > 0 ? `blur(${handleIn.blur}px)` : \"none\",\n transform: `translateX(${handleX}px)`,\n }}\n >\n @{handle}\n </span>\n </div>\n\n <div\n style={{\n display: \"flex\",\n alignItems: \"baseline\",\n justifyContent: \"center\",\n gap: 18,\n opacity: countIn.opacity,\n filter: countIn.blur > 0 ? `blur(${countIn.blur}px)` : \"none\",\n transform: `translateY(${countIn.translateY}px) scale(${revealScale})`,\n }}\n >\n <span\n style={{\n fontFamily: FONT_FAMILY,\n fontSize: countNum,\n fontWeight: 800,\n color: t.fg,\n letterSpacing: \"-0.03em\",\n fontVariantNumeric: \"tabular-nums\",\n lineHeight: 1,\n }}\n >\n {totalFollowers.toLocaleString(\"en-US\")}\n </span>\n <span\n style={{\n fontFamily: FONT_FAMILY,\n fontSize: countLabel,\n fontWeight: 500,\n color: t.fgMuted,\n lineHeight: 1,\n }}\n >\n Followers\n </span>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <Confetti\n startFrame={confettiStart}\n originX={0.5}\n originY={0.5}\n colors={confettiColors}\n particleCount={160}\n />\n </AbsoluteFill>\n );\n}\n","type": "registry:component","target": "components/remocn/x-followers-overview.tsx"}