Skip to content

Production-ready animations, transitions, backgrounds, and scenes for Remotion

feat: build registry

dev_wandryd001e2c2c0e9
diff --git a/public/r/accordion.json b/public/r/accordion.json
index a85ba564..88c45dd4 100644
--- a/public/r/accordion.json
+++ b/public/r/accordion.json
@@ -12,7 +12,7 @@
"files": [
{
"path": "registry/remocn-ui/accordion/index.tsx",
- "content": "\"use client\";\n\nimport { mixOklch, type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type AccordionState = \"opened\" | \"closed\";\n\ntype AccordionVariant = \"default\" | \"ghost\";\n\nexport interface AccordionProps {\n state?: AccordionState;\n style?: AccordionStyle;\n title?: string;\n content?: string;\n contentHeight?: number;\n variant?: AccordionVariant;\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n className?: string;\n}\n\nconst CARD_WIDTH = 440;\n\ninterface VariantTokens {\n bordered: boolean;\n closedBg: string;\n openBg: string;\n}\n\nfunction variantTokens(\n variant: AccordionVariant,\n theme: RemocnTheme,\n): VariantTokens {\n const variants = {\n ghost: {\n bordered: false,\n closedBg: theme.background,\n openBg: mixOklch(theme.background, theme.muted, 0.25),\n },\n default: {\n bordered: true,\n closedBg: theme.background,\n openBg: mixOklch(theme.background, theme.muted, 0.5),\n },\n };\n\n return variants[variant] ?? variants.default;\n}\n\nexport interface AccordionStyle {\n panelHeight: number;\n panelOpacity: number;\n chevronRotation: number;\n background: string;\n}\n\nexport interface AccordionStyleContext {\n bordered: boolean;\n closedBg: string;\n openBg: string;\n border: string;\n foreground: string;\n mutedForeground: string;\n}\n\nexport function accordionStyleContext(\n variant: AccordionVariant,\n theme: RemocnTheme,\n): AccordionStyleContext {\n const tokens = variantTokens(variant, theme);\n return {\n bordered: tokens.bordered,\n closedBg: tokens.closedBg,\n openBg: tokens.openBg,\n border: theme.border,\n foreground: theme.foreground,\n mutedForeground: theme.mutedForeground,\n };\n}\n\nexport function accordionStyle(\n state: AccordionState,\n ctx: AccordionStyleContext,\n): AccordionStyle {\n switch (state) {\n case \"opened\":\n return {\n panelHeight: 1,\n panelOpacity: 1,\n chevronRotation: 180,\n background: ctx.openBg,\n };\n default:\n return {\n panelHeight: 0,\n panelOpacity: 0,\n chevronRotation: 0,\n background: ctx.closedBg,\n };\n }\n}\n\nexport function Accordion({\n state = \"closed\",\n style,\n title = \"Is it accessible?\",\n content = \"Yes. It adheres to the WAI-ARIA design pattern.\",\n contentHeight = 64,\n variant = \"default\",\n theme: themeOverride,\n mode,\n className,\n}: AccordionProps) {\n const theme = useRemocnTheme(themeOverride, mode);\n\n const ctx = accordionStyleContext(variant, theme);\n const v = style ?? accordionStyle(state, ctx);\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: theme.background,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div\n className={className}\n style={{\n width: CARD_WIDTH,\n background: v.background,\n border: ctx.bordered\n ? `1px solid ${ctx.border}`\n : \"1px solid transparent\",\n borderRadius: theme.radius,\n overflow: \"hidden\",\n }}\n >\n {}\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n gap: 24,\n padding: 16,\n fontSize: 15,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n color: ctx.foreground,\n }}\n >\n <span>{title}</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.mutedForeground}\n strokeWidth=\"2.2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n {}\n <div\n style={{\n height: contentHeight * v.panelHeight,\n opacity: v.panelOpacity,\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n padding: \"0 16px 16px\",\n fontSize: 14,\n lineHeight: 1.5,\n color: ctx.mutedForeground,\n }}\n >\n {content}\n </div>\n </div>\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { mixOklch, type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type AccordionState = \"opened\" | \"closed\";\n\ntype AccordionVariant = \"default\" | \"ghost\";\n\nexport interface AccordionProps {\n state?: AccordionState;\n style?: AccordionStyle;\n title?: string;\n content?: string;\n contentHeight?: number;\n variant?: AccordionVariant;\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nconst CARD_WIDTH = 440;\n\ninterface VariantTokens {\n bordered: boolean;\n closedBg: string;\n openBg: string;\n}\n\nfunction variantTokens(\n variant: AccordionVariant,\n theme: RemocnTheme,\n): VariantTokens {\n const variants = {\n ghost: {\n bordered: false,\n closedBg: theme.background,\n openBg: mixOklch(theme.background, theme.muted, 0.25),\n },\n default: {\n bordered: true,\n closedBg: theme.background,\n openBg: mixOklch(theme.background, theme.muted, 0.5),\n },\n };\n\n return variants[variant] ?? variants.default;\n}\n\nexport interface AccordionStyle {\n panelHeight: number;\n panelOpacity: number;\n chevronRotation: number;\n background: string;\n}\n\nexport interface AccordionStyleContext {\n bordered: boolean;\n closedBg: string;\n openBg: string;\n border: string;\n foreground: string;\n mutedForeground: string;\n}\n\nexport function accordionStyleContext(\n variant: AccordionVariant,\n theme: RemocnTheme,\n): AccordionStyleContext {\n const tokens = variantTokens(variant, theme);\n return {\n bordered: tokens.bordered,\n closedBg: tokens.closedBg,\n openBg: tokens.openBg,\n border: theme.border,\n foreground: theme.foreground,\n mutedForeground: theme.mutedForeground,\n };\n}\n\nexport function accordionStyle(\n state: AccordionState,\n ctx: AccordionStyleContext,\n): AccordionStyle {\n switch (state) {\n case \"opened\":\n return {\n panelHeight: 1,\n panelOpacity: 1,\n chevronRotation: 180,\n background: ctx.openBg,\n };\n default:\n return {\n panelHeight: 0,\n panelOpacity: 0,\n chevronRotation: 0,\n background: ctx.closedBg,\n };\n }\n}\n\nexport function Accordion({\n state = \"closed\",\n style,\n title = \"Is it accessible?\",\n content = \"Yes. It adheres to the WAI-ARIA design pattern.\",\n contentHeight = 64,\n variant = \"default\",\n theme: themeOverride,\n className,\n}: AccordionProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n\n const ctx = accordionStyleContext(variant, theme);\n const v = style ?? accordionStyle(state, ctx);\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 width: CARD_WIDTH,\n background: v.background,\n border: ctx.bordered\n ? `1px solid ${ctx.border}`\n : \"1px solid transparent\",\n borderRadius: theme.radius,\n overflow: \"hidden\",\n }}\n >\n {}\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n gap: 24,\n padding: 16,\n fontSize: 15,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n color: ctx.foreground,\n }}\n >\n <span>{title}</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.mutedForeground}\n strokeWidth=\"2.2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n {}\n <div\n style={{\n height: contentHeight * v.panelHeight,\n opacity: v.panelOpacity,\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n padding: \"0 16px 16px\",\n fontSize: 14,\n lineHeight: 1.5,\n color: ctx.mutedForeground,\n }}\n >\n {content}\n </div>\n </div>\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/accordion.tsx"
},
diff --git a/public/r/ai-prompt-flow.json b/public/r/ai-prompt-flow.json
index 7711b798..5668549d 100644
--- a/public/r/ai-prompt-flow.json
+++ b/public/r/ai-prompt-flow.json
@@ -17,7 +17,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 mode?: \"light\" | \"dark\";\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 mode = \"light\",\n theme,\n}: AiPromptFlowProps) {\n const resolved = useRemocnTheme(theme, mode);\n const opts = { mode, 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 { mode },\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 { mode },\n );\n\n return (\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n background: resolved.background,\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 mode={mode}\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 mode={mode}\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 mode={mode}\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 mode={mode}\n theme={theme}\n />\n </div>\n </div>\n );\n}\n",
+ "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",
"type": "registry:component",
"target": "components/remocn/ai-prompt-flow.tsx"
}
diff --git a/public/r/alert-dialog.json b/public/r/alert-dialog.json
index 86b3f804..cfcd5cb9 100644
--- a/public/r/alert-dialog.json
+++ b/public/r/alert-dialog.json
@@ -12,7 +12,7 @@
"files": [
{
"path": "registry/remocn-ui/alert-dialog/index.tsx",
- "content": "\"use client\";\n\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type AlertDialogState = \"closed\" | \"opened\";\n\nexport interface AlertDialogProps {\n state?: AlertDialogState;\n style?: AlertDialogStyle;\n title?: string;\n description?: string;\n actionLabel?: string;\n cancelLabel?: string;\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n className?: string;\n}\n\nconst POPUP_WIDTH = 400;\nconst MAX_OVERLAY_ALPHA = 0.5;\n\nexport interface AlertDialogStyle {\n overlayOpacity: number;\n popupOpacity: number;\n popupScale: number;\n popupTranslateY: number;\n}\n\nexport interface AlertDialogStyleContext {\n popoverBg: string;\n popoverFg: string;\n mutedFg: string;\n border: string;\n radius: number;\n actionBg: string;\n actionFg: string;\n cancelFg: string;\n}\n\nexport function alertDialogStyleContext(\n theme: RemocnTheme,\n): AlertDialogStyleContext {\n return {\n popoverBg: theme.popover,\n popoverFg: theme.popoverForeground,\n mutedFg: theme.mutedForeground,\n border: theme.border,\n radius: theme.radius,\n actionBg: theme.destructive,\n actionFg: theme.destructiveForeground,\n cancelFg: theme.foreground,\n };\n}\n\nexport function alertDialogStyle(\n state: AlertDialogState,\n _ctx: AlertDialogStyleContext,\n): AlertDialogStyle {\n switch (state) {\n case \"opened\":\n return {\n overlayOpacity: 1,\n popupOpacity: 1,\n popupScale: 1,\n popupTranslateY: 0,\n };\n default:\n return {\n overlayOpacity: 0,\n popupOpacity: 0,\n popupScale: 0.95,\n popupTranslateY: 8,\n };\n }\n}\n\nexport function AlertDialog({\n state = \"closed\",\n style,\n title = \"Delete account?\",\n description = \"This action cannot be undone. This will permanently remove your data from our servers.\",\n actionLabel = \"Delete\",\n cancelLabel = \"Cancel\",\n theme: themeOverride,\n mode,\n className,\n}: AlertDialogProps) {\n const theme = useRemocnTheme(themeOverride, mode);\n\n const ctx = alertDialogStyleContext(theme);\n const v = style ?? alertDialogStyle(state, ctx);\n\n const buttonBase: React.CSSProperties = {\n height: 40,\n padding: \"0 20px\",\n fontSize: 15,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n borderRadius: ctx.radius,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n cursor: \"pointer\",\n };\n\n return (\n <div\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 {}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: `rgba(0, 0, 0, ${MAX_OVERLAY_ALPHA * v.overlayOpacity})`,\n }}\n />\n <div\n className={className}\n style={{\n position: \"relative\",\n width: POPUP_WIDTH,\n transform: `translateY(${v.popupTranslateY}px) scale(${v.popupScale})`,\n opacity: v.popupOpacity,\n background: ctx.popoverBg,\n color: ctx.popoverFg,\n border: `1px solid ${ctx.border}`,\n borderRadius: ctx.radius + 6,\n padding: 24,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n boxShadow: \"0 24px 48px -12px rgba(0,0,0,0.25)\",\n }}\n >\n <div\n style={{ fontSize: 18, fontWeight: 500, letterSpacing: \"-0.01em\" }}\n >\n {title}\n </div>\n <div style={{ fontSize: 14, lineHeight: 1.5, color: ctx.mutedFg }}>\n {description}\n </div>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"flex-end\",\n gap: 8,\n marginTop: 16,\n }}\n >\n {}\n <button\n type=\"button\"\n style={{\n ...buttonBase,\n background: \"transparent\",\n color: ctx.cancelFg,\n border: `1px solid ${ctx.border}`,\n }}\n >\n {cancelLabel}\n </button>\n {}\n <button\n type=\"button\"\n style={{\n ...buttonBase,\n background: ctx.actionBg,\n color: ctx.actionFg,\n border: \"1px solid transparent\",\n }}\n >\n {actionLabel}\n </button>\n </div>\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type AlertDialogState = \"closed\" | \"opened\";\n\nexport interface AlertDialogProps {\n state?: AlertDialogState;\n style?: AlertDialogStyle;\n title?: string;\n description?: string;\n actionLabel?: string;\n cancelLabel?: string;\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nconst POPUP_WIDTH = 400;\nconst MAX_OVERLAY_ALPHA = 0.5;\n\nexport interface AlertDialogStyle {\n overlayOpacity: number;\n popupOpacity: number;\n popupScale: number;\n popupTranslateY: number;\n}\n\nexport interface AlertDialogStyleContext {\n popoverBg: string;\n popoverFg: string;\n mutedFg: string;\n border: string;\n radius: number;\n actionBg: string;\n actionFg: string;\n cancelFg: string;\n}\n\nexport function alertDialogStyleContext(\n theme: RemocnTheme,\n): AlertDialogStyleContext {\n return {\n popoverBg: theme.popover,\n popoverFg: theme.popoverForeground,\n mutedFg: theme.mutedForeground,\n border: theme.border,\n radius: theme.radius,\n actionBg: theme.destructive,\n actionFg: theme.destructiveForeground,\n cancelFg: theme.foreground,\n };\n}\n\nexport function alertDialogStyle(\n state: AlertDialogState,\n _ctx: AlertDialogStyleContext,\n): AlertDialogStyle {\n switch (state) {\n case \"opened\":\n return {\n overlayOpacity: 1,\n popupOpacity: 1,\n popupScale: 1,\n popupTranslateY: 0,\n };\n default:\n return {\n overlayOpacity: 0,\n popupOpacity: 0,\n popupScale: 0.95,\n popupTranslateY: 8,\n };\n }\n}\n\nexport function AlertDialog({\n state = \"closed\",\n style,\n title = \"Delete account?\",\n description = \"This action cannot be undone. This will permanently remove your data from our servers.\",\n actionLabel = \"Delete\",\n cancelLabel = \"Cancel\",\n theme: themeOverride,\n className,\n}: AlertDialogProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n\n const ctx = alertDialogStyleContext(theme);\n const v = style ?? alertDialogStyle(state, ctx);\n\n const buttonBase: React.CSSProperties = {\n height: 40,\n padding: \"0 20px\",\n fontSize: 15,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n borderRadius: ctx.radius,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n cursor: \"pointer\",\n };\n\n return (\n <div\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 {}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: `rgba(0, 0, 0, ${MAX_OVERLAY_ALPHA * v.overlayOpacity})`,\n }}\n />\n <div\n className={className}\n style={{\n position: \"relative\",\n width: POPUP_WIDTH,\n transform: `translateY(${v.popupTranslateY}px) scale(${v.popupScale})`,\n opacity: v.popupOpacity,\n background: ctx.popoverBg,\n color: ctx.popoverFg,\n border: `1px solid ${ctx.border}`,\n borderRadius: ctx.radius + 6,\n padding: 24,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n boxShadow: \"0 24px 48px -12px rgba(0,0,0,0.25)\",\n }}\n >\n <div\n style={{ fontSize: 18, fontWeight: 500, letterSpacing: \"-0.01em\" }}\n >\n {title}\n </div>\n <div style={{ fontSize: 14, lineHeight: 1.5, color: ctx.mutedFg }}>\n {description}\n </div>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"flex-end\",\n gap: 8,\n marginTop: 16,\n }}\n >\n {}\n <button\n type=\"button\"\n style={{\n ...buttonBase,\n background: \"transparent\",\n color: ctx.cancelFg,\n border: `1px solid ${ctx.border}`,\n }}\n >\n {cancelLabel}\n </button>\n {}\n <button\n type=\"button\"\n style={{\n ...buttonBase,\n background: ctx.actionBg,\n color: ctx.actionFg,\n border: \"1px solid transparent\",\n }}\n >\n {actionLabel}\n </button>\n </div>\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/alert-dialog.tsx"
},
diff --git a/public/r/animated-bar-chart.json b/public/r/animated-bar-chart.json
index d074c97a..528e7eb8 100644
--- a/public/r/animated-bar-chart.json
+++ b/public/r/animated-bar-chart.json
@@ -9,7 +9,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 background?: 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 background = \"#0a0a0a\",\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 background,\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 && 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/animated-line-chart.json b/public/r/animated-line-chart.json
index 53c43de8..fcc6149b 100644
--- a/public/r/animated-line-chart.json
+++ b/public/r/animated-line-chart.json
@@ -9,7 +9,7 @@
"files": [
{
"path": "registry/remocn/animated-line-chart/index.tsx",
- "content": "\"use client\";\n\nimport { spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface AnimatedLineChartProps {\n data?: number[];\n width?: number;\n height?: number;\n strokeColor?: string;\n strokeWidth?: number;\n background?: string;\n gridColor?: string;\n showDot?: boolean;\n speed?: number;\n className?: string;\n}\n\nexport function AnimatedLineChart({\n data = [12, 19, 8, 15, 22, 18, 28, 25, 32],\n width = 1000,\n height = 500,\n strokeColor = \"#22c55e\",\n strokeWidth = 4,\n background = \"#0a0a0a\",\n gridColor = \"#27272a\",\n showDot = true,\n speed = 1,\n className,\n}: AnimatedLineChartProps) {\n const frame = useCurrentFrame() * speed;\n const { fps, durationInFrames } = useVideoConfig();\n\n const padding = 60;\n const innerWidth = width - padding * 2;\n const innerHeight = height - padding * 2;\n\n const min = Math.min(...data);\n const max = Math.max(...data);\n const range = max - min || 1;\n\n const points = data.map((value, index) => {\n const x = padding + (index / (data.length - 1)) * innerWidth;\n const y = padding + innerHeight - ((value - min) / range) * innerHeight;\n return { x, y };\n });\n\n // Analytical path length: sum of segment distances\n let pathLength = 0;\n for (let i = 1; i < points.length; i++) {\n const dx = points[i].x - points[i - 1].x;\n const dy = points[i].y - points[i - 1].y;\n pathLength += Math.sqrt(dx * dx + dy * dy);\n }\n\n const d = points\n .map((p, i) => `${i === 0 ? \"M\" : \"L\"}${p.x.toFixed(2)},${p.y.toFixed(2)}`)\n .join(\" \");\n\n // Spring-driven progress: smooth, no bounce. Matches the \"smooth\" preset\n // from remotion-best-practices/timing.md.\n const progress = spring({\n frame,\n fps,\n durationInFrames: Math.round(durationInFrames * 0.85),\n config: { damping: 200 },\n });\n\n const dashOffset = pathLength * (1 - progress);\n\n // Find dot position along the path at current progress\n const targetLen = pathLength * progress;\n let traveled = 0;\n let dotX = points[0].x;\n let dotY = points[0].y;\n for (let i = 1; i < points.length; i++) {\n const dx = points[i].x - points[i - 1].x;\n const dy = points[i].y - points[i - 1].y;\n const segLen = Math.sqrt(dx * dx + dy * dy);\n if (traveled + segLen >= targetLen) {\n const t = (targetLen - traveled) / segLen;\n dotX = points[i - 1].x + dx * t;\n dotY = points[i - 1].y + dy * t;\n break;\n }\n traveled += segLen;\n dotX = points[i].x;\n dotY = points[i].y;\n }\n\n const gridRows = 4;\n const gridCols = data.length - 1;\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,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <svg\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ overflow: \"visible\" }}\n >\n {/* Horizontal grid */}\n {Array.from({ length: gridRows + 1 }).map((_, i) => {\n const y = padding + (i / gridRows) * innerHeight;\n return (\n <line\n key={`h-${i}`}\n x1={padding}\n x2={padding + innerWidth}\n y1={y}\n y2={y}\n stroke={gridColor}\n strokeWidth={1}\n />\n );\n })}\n {/* Vertical grid */}\n {Array.from({ length: gridCols + 1 }).map((_, i) => {\n const x = padding + (i / gridCols) * innerWidth;\n return (\n <line\n key={`v-${i}`}\n x1={x}\n x2={x}\n y1={padding}\n y2={padding + innerHeight}\n stroke={gridColor}\n strokeWidth={1}\n />\n );\n })}\n {/* Axis */}\n <line\n x1={padding}\n x2={padding}\n y1={padding}\n y2={padding + innerHeight}\n stroke={gridColor}\n strokeWidth={2}\n />\n <line\n x1={padding}\n x2={padding + innerWidth}\n y1={padding + innerHeight}\n y2={padding + innerHeight}\n stroke={gridColor}\n strokeWidth={2}\n />\n\n {/* Animated line */}\n <path\n d={d}\n fill=\"none\"\n stroke={strokeColor}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeDasharray={pathLength}\n strokeDashoffset={dashOffset}\n style={{\n filter: `drop-shadow(0 0 12px ${strokeColor}55)`,\n }}\n />\n\n {showDot && progress > 0 && progress < 1 && (\n <circle\n cx={dotX}\n cy={dotY}\n r={strokeWidth * 2}\n fill={strokeColor}\n style={{\n filter: `drop-shadow(0 0 8px ${strokeColor})`,\n }}\n />\n )}\n </svg>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface AnimatedLineChartProps {\n data?: number[];\n width?: number;\n height?: number;\n strokeColor?: string;\n strokeWidth?: number;\n gridColor?: string;\n showDot?: boolean;\n speed?: number;\n className?: string;\n}\n\nexport function AnimatedLineChart({\n data = [12, 19, 8, 15, 22, 18, 28, 25, 32],\n width = 1000,\n height = 500,\n strokeColor = \"#22c55e\",\n strokeWidth = 4,\n gridColor = \"#27272a\",\n showDot = true,\n speed = 1,\n className,\n}: AnimatedLineChartProps) {\n const frame = useCurrentFrame() * speed;\n const { fps, durationInFrames } = useVideoConfig();\n\n const padding = 60;\n const innerWidth = width - padding * 2;\n const innerHeight = height - padding * 2;\n\n const min = Math.min(...data);\n const max = Math.max(...data);\n const range = max - min || 1;\n\n const points = data.map((value, index) => {\n const x = padding + (index / (data.length - 1)) * innerWidth;\n const y = padding + innerHeight - ((value - min) / range) * innerHeight;\n return { x, y };\n });\n\n // Analytical path length: sum of segment distances\n let pathLength = 0;\n for (let i = 1; i < points.length; i++) {\n const dx = points[i].x - points[i - 1].x;\n const dy = points[i].y - points[i - 1].y;\n pathLength += Math.sqrt(dx * dx + dy * dy);\n }\n\n const d = points\n .map((p, i) => `${i === 0 ? \"M\" : \"L\"}${p.x.toFixed(2)},${p.y.toFixed(2)}`)\n .join(\" \");\n\n // Spring-driven progress: smooth, no bounce. Matches the \"smooth\" preset\n // from remotion-best-practices/timing.md.\n const progress = spring({\n frame,\n fps,\n durationInFrames: Math.round(durationInFrames * 0.85),\n config: { damping: 200 },\n });\n\n const dashOffset = pathLength * (1 - progress);\n\n // Find dot position along the path at current progress\n const targetLen = pathLength * progress;\n let traveled = 0;\n let dotX = points[0].x;\n let dotY = points[0].y;\n for (let i = 1; i < points.length; i++) {\n const dx = points[i].x - points[i - 1].x;\n const dy = points[i].y - points[i - 1].y;\n const segLen = Math.sqrt(dx * dx + dy * dy);\n if (traveled + segLen >= targetLen) {\n const t = (targetLen - traveled) / segLen;\n dotX = points[i - 1].x + dx * t;\n dotY = points[i - 1].y + dy * t;\n break;\n }\n traveled += segLen;\n dotX = points[i].x;\n dotY = points[i].y;\n }\n\n const gridRows = 4;\n const gridCols = data.length - 1;\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\n width={width}\n height={height}\n viewBox={`0 0 ${width} ${height}`}\n style={{ overflow: \"visible\" }}\n >\n {/* Horizontal grid */}\n {Array.from({ length: gridRows + 1 }).map((_, i) => {\n const y = padding + (i / gridRows) * innerHeight;\n return (\n <line\n key={`h-${i}`}\n x1={padding}\n x2={padding + innerWidth}\n y1={y}\n y2={y}\n stroke={gridColor}\n strokeWidth={1}\n />\n );\n })}\n {/* Vertical grid */}\n {Array.from({ length: gridCols + 1 }).map((_, i) => {\n const x = padding + (i / gridCols) * innerWidth;\n return (\n <line\n key={`v-${i}`}\n x1={x}\n x2={x}\n y1={padding}\n y2={padding + innerHeight}\n stroke={gridColor}\n strokeWidth={1}\n />\n );\n })}\n {/* Axis */}\n <line\n x1={padding}\n x2={padding}\n y1={padding}\n y2={padding + innerHeight}\n stroke={gridColor}\n strokeWidth={2}\n />\n <line\n x1={padding}\n x2={padding + innerWidth}\n y1={padding + innerHeight}\n y2={padding + innerHeight}\n stroke={gridColor}\n strokeWidth={2}\n />\n\n {/* Animated line */}\n <path\n d={d}\n fill=\"none\"\n stroke={strokeColor}\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeDasharray={pathLength}\n strokeDashoffset={dashOffset}\n style={{\n filter: `drop-shadow(0 0 12px ${strokeColor}55)`,\n }}\n />\n\n {showDot && progress > 0 && progress < 1 && (\n <circle\n cx={dotX}\n cy={dotY}\n r={strokeWidth * 2}\n fill={strokeColor}\n style={{\n filter: `drop-shadow(0 0 8px ${strokeColor})`,\n }}\n />\n )}\n </svg>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/animated-line-chart.tsx"
}
diff --git a/public/r/backdrop.json b/public/r/backdrop.json
new file mode 100644
index 00000000..678ef1b5
--- /dev/null
+++ b/public/r/backdrop.json
@@ -0,0 +1,18 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "backdrop",
+ "title": "Backdrop",
+ "description": "Configurable full-frame background (color / gradient / image / live component) with Screen Studio-style padding and a rounded, shadowed content frame.",
+ "dependencies": [
+ "remotion"
+ ],
+ "files": [
+ {
+ "path": "registry/remocn/backdrop/index.tsx",
+ "content": "\"use client\";\n\nimport { isValidElement, type ReactNode } from \"react\";\nimport { AbsoluteFill, Img, useVideoConfig } from \"remotion\";\n\nexport type BackdropFill =\n | { type: \"color\"; value: string }\n | { type: \"gradient\"; value: string }\n | { type: \"image\"; src: string; fit?: \"cover\" | \"contain\" };\n\nexport interface BackdropProps {\n fill?: BackdropFill | ReactNode;\n padding?: number;\n radius?: number;\n shadow?: string;\n children?: ReactNode;\n className?: string;\n}\n\nconst DEFAULT_FILL: BackdropFill = { type: \"color\", value: \"#0a0a0a\" };\n\nfunction FillLayer({ fill }: { fill: BackdropFill }) {\n if (fill.type === \"image\") {\n return (\n <AbsoluteFill>\n <Img\n src={fill.src}\n style={{\n width: \"100%\",\n height: \"100%\",\n objectFit: fill.fit ?? \"cover\",\n }}\n />\n </AbsoluteFill>\n );\n }\n\n return <AbsoluteFill style={{ background: fill.value }} />;\n}\n\nexport function Backdrop({\n fill,\n padding = 4,\n radius = 1,\n shadow = \"0 20px 60px rgba(0,0,0,0.4)\",\n children,\n className,\n}: BackdropProps) {\n const { width } = useVideoConfig();\n\n const paddingPx = (padding / 100) * width;\n const radiusPx = (radius / 100) * width;\n\n const fillLayer = isValidElement(fill) ? (\n <AbsoluteFill>{fill}</AbsoluteFill>\n ) : (\n <FillLayer fill={(fill as BackdropFill | undefined) ?? DEFAULT_FILL} />\n );\n\n return (\n <AbsoluteFill className={className}>\n {fillLayer}\n {children != null && (\n <div\n style={{\n position: \"absolute\",\n inset: paddingPx,\n overflow: \"hidden\",\n borderRadius: radiusPx,\n display: \"flex\",\n ...(shadow === \"\" ? {} : { boxShadow: shadow }),\n }}\n >\n <div style={{ width: \"100%\", height: \"100%\" }}>{children}</div>\n </div>\n )}\n </AbsoluteFill>\n );\n}\n",
+ "type": "registry:component",
+ "target": "components/remocn/backdrop.tsx"
+ }
+ ],
+ "type": "registry:component"
+}
\ No newline at end of file
diff --git a/public/r/blur-reveal.json b/public/r/blur-reveal.json
index 77064ff0..6d0c7b3d 100644
--- a/public/r/blur-reveal.json
+++ b/public/r/blur-reveal.json
@@ -9,7 +9,7 @@
"files": [
{
"path": "registry/remocn/blur-reveal/index.tsx",
- "content": "\"use client\";\n\nimport { interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface BlurRevealProps {\n text: string;\n className?: string;\n blur?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n}\n\nexport function BlurReveal({\n text,\n className,\n blur = 10,\n fontSize = 48,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n}: BlurRevealProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const opacity = interpolate(frame, [0, durationInFrames * 0.6], [0, 1], {\n extrapolateRight: \"clamp\",\n });\n\n const blurAmount = interpolate(\n frame,\n [0, durationInFrames * 0.6],\n [blur, 0],\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 opacity,\n filter: `blur(${blurAmount}px)`,\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 {text}\n </span>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface BlurRevealProps {\n text: string;\n className?: string;\n blur?: number;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n speed?: number;\n}\n\nexport function BlurReveal({\n text,\n className,\n blur = 10,\n fontSize = 48,\n color = \"#171717\",\n fontWeight = 600,\n speed = 1,\n}: BlurRevealProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const opacity = interpolate(frame, [0, durationInFrames * 0.6], [0, 1], {\n extrapolateRight: \"clamp\",\n });\n\n const blurAmount = interpolate(\n frame,\n [0, durationInFrames * 0.6],\n [blur, 0],\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: \"transparent\",\n }}\n >\n <span\n className={className}\n style={{\n opacity,\n filter: `blur(${blurAmount}px)`,\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 {text}\n </span>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/blur-reveal.tsx"
}
diff --git a/public/r/browser-flow.json b/public/r/browser-flow.json
index cb7a1254..7c013689 100644
--- a/public/r/browser-flow.json
+++ b/public/r/browser-flow.json
@@ -9,7 +9,7 @@
"files": [
{
"path": "registry/remocn/browser-flow/index.tsx",
- "content": "\"use client\";\n\nimport { interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface BrowserFlowProps {\n url?: string;\n speed?: number;\n className?: string;\n /**\n * CSS background for the scene behind the browser window. Accepts any\n * `background` shorthand value (color, gradient, `url(...)`, or a layered\n * combination). Defaults to the dark radial gradient.\n */\n background?: string;\n}\n\nconst DEFAULT_BACKGROUND =\n \"radial-gradient(ellipse at center, #11141c 0%, #050505 75%)\";\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\nconst MONO_FAMILY =\n \"var(--font-geist-mono), ui-monospace, SFMono-Regular, Menlo, monospace\";\n\nfunction MacDots({ size = 12 }: { size?: number }) {\n return (\n <div style={{ display: \"flex\", gap: 8, alignItems: \"center\" }}>\n {[\"#ff5f57\", \"#febc2e\", \"#28c840\"].map((c) => (\n <div\n key={c}\n style={{\n width: size,\n height: size,\n borderRadius: \"50%\",\n background: c,\n opacity: 0.85,\n }}\n />\n ))}\n </div>\n );\n}\n\nfunction CursorSVG() {\n return (\n <svg width=\"22\" height=\"28\" viewBox=\"0 0 22 28\" fill=\"none\">\n <path\n d=\"M2 2L2 22L7 17.5L10.5 25L13.5 23.5L10 16L17 16L2 2Z\"\n fill=\"white\"\n stroke=\"black\"\n strokeWidth=\"1.5\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction easeInOut(t: number) {\n return t < 0.5 ? 2 * t * t : 1 - (-2 * t + 2) ** 2 / 2;\n}\n\nexport function BrowserFlow({\n url = \"remocn.dev\",\n speed = 1,\n className,\n background = DEFAULT_BACKGROUND,\n}: BrowserFlowProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n // ── Browser dimensions ────────────────────────────\n const browserWidth = 1100;\n const browserHeight = 620;\n const chromeHeight = 56;\n const browserLeft = (1280 - browserWidth) / 2;\n const browserTop = (720 - browserHeight) / 2;\n\n // ── URL typing (frames 0..40) ─────────────────────\n const typingProgress = interpolate(frame, [4, 38], [0, url.length], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const typedChars = Math.floor(typingProgress);\n const typedUrl = url.slice(0, typedChars);\n const showCaret = frame < 50 && Math.floor(frame / 12) % 2 === 0;\n\n // Autocomplete suggestion appears once a few chars typed\n const showSuggestion = typedChars >= 2 && frame < 48;\n const suggestion = url;\n\n // ── Progress bar ──────────────────────────────────\n // 40..50: 0 -> 15\n // 50..65: hold at 15\n // 65..85: 15 -> 100\n // 85..95: fade out\n let progress = 0;\n if (frame < 40) progress = 0;\n else if (frame < 50)\n progress = interpolate(frame, [40, 50], [0, 15], {\n extrapolateRight: \"clamp\",\n });\n else if (frame < 65) progress = 15;\n else if (frame < 85)\n progress = interpolate(frame, [65, 85], [15, 100], {\n extrapolateRight: \"clamp\",\n });\n else progress = 100;\n\n const progressOpacity =\n frame < 40\n ? 0\n : frame < 85\n ? 1\n : interpolate(frame, [85, 95], [1, 0], {\n extrapolateRight: \"clamp\",\n });\n\n // ── Page render ───────────────────────────────────\n const pageStart = 95;\n const pageOpacity = interpolate(frame, [pageStart, pageStart + 12], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n // ── Page scroll & cursor motion ───────────────────\n const scrollStart = 115;\n const scrollEnd = 230;\n const scrollT = interpolate(frame, [scrollStart, scrollEnd], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const scrollEased = easeInOut(scrollT);\n const maxScroll = 600;\n const scrollY = scrollEased * maxScroll;\n\n // Cursor path: starts off the address bar area, moves down toward CTA inside viewport\n // Coordinates relative to the full 1280x720 frame.\n const cursorStartX = browserLeft + 380;\n const cursorStartY = browserTop + chromeHeight + 60;\n const cursorEndX = browserLeft + browserWidth / 2;\n const cursorEndY = browserTop + chromeHeight + 380;\n\n const cursorT = interpolate(frame, [pageStart + 5, scrollEnd], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const cursorEased = easeInOut(cursorT);\n // arc bias on Y for organic feel\n const arcOffset = Math.sin(cursorEased * Math.PI) * 30;\n const cursorX =\n cursorStartX + (cursorEndX - cursorStartX) * cursorEased + arcOffset * 0.6;\n const cursorY =\n cursorStartY + (cursorEndY - cursorStartY) * cursorEased - arcOffset;\n\n // Click animation near the end\n const clickFrame = scrollEnd + 4;\n const clickSpring = spring({\n frame: frame - clickFrame,\n fps,\n config: { mass: 0.4, damping: 12, stiffness: 220 },\n durationInFrames: 18,\n });\n const cursorClickScale = interpolate(clickSpring, [0, 0.4, 1], [1, 0.85, 1], {\n extrapolateRight: \"clamp\",\n });\n const buttonClickScale =\n frame >= clickFrame\n ? interpolate(clickSpring, [0, 0.4, 1], [1, 0.98, 1], {\n extrapolateRight: \"clamp\",\n })\n : 1;\n\n // Address bar focus state (highlighted while typing)\n const addressFocused = frame < 50;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n background,\n fontFamily: FONT_FAMILY,\n }}\n >\n {/* Browser window */}\n <div\n style={{\n position: \"absolute\",\n left: browserLeft,\n top: browserTop,\n width: browserWidth,\n height: browserHeight,\n borderRadius: 16,\n overflow: \"hidden\",\n background: \"#0a0a0c\",\n border: \"1px solid rgba(255,255,255,0.08)\",\n boxShadow:\n \"0 50px 120px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.06)\",\n }}\n >\n {/* Chrome */}\n <div\n style={{\n position: \"relative\",\n height: chromeHeight,\n display: \"flex\",\n alignItems: \"center\",\n gap: 14,\n paddingLeft: 18,\n paddingRight: 18,\n background: \"rgba(20,20,24,0.95)\",\n borderBottom: \"1px solid rgba(255,255,255,0.06)\",\n }}\n >\n <MacDots />\n {/* nav arrows */}\n <div\n style={{\n display: \"flex\",\n gap: 6,\n marginLeft: 8,\n color: \"rgba(255,255,255,0.35)\",\n fontSize: 16,\n }}\n >\n <span>‹</span>\n <span>›</span>\n </div>\n {/* address bar */}\n <div\n style={{\n flex: 1,\n position: \"relative\",\n height: 32,\n borderRadius: 16,\n background: addressFocused\n ? \"rgba(255,255,255,0.08)\"\n : \"rgba(255,255,255,0.05)\",\n border: `1px solid ${\n addressFocused\n ? \"rgba(120,160,255,0.45)\"\n : \"rgba(255,255,255,0.07)\"\n }`,\n display: \"flex\",\n alignItems: \"center\",\n paddingLeft: 14,\n paddingRight: 14,\n fontFamily: MONO_FAMILY,\n fontSize: 13,\n color: \"rgba(255,255,255,0.85)\",\n boxShadow: addressFocused\n ? \"0 0 0 3px rgba(120,160,255,0.12)\"\n : \"none\",\n }}\n >\n <span style={{ color: \"rgba(255,255,255,0.4)\", marginRight: 8 }}>\n ⌕\n </span>\n <span>{typedUrl}</span>\n {showCaret && (\n <span\n style={{\n display: \"inline-block\",\n width: 1.5,\n height: 16,\n background: \"rgba(255,255,255,0.85)\",\n marginLeft: 1,\n }}\n />\n )}\n\n {/* Autocomplete suggestion dropdown */}\n {showSuggestion && (\n <div\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n top: \"calc(100% + 6px)\",\n background: \"rgba(22,22,26,0.98)\",\n border: \"1px solid rgba(255,255,255,0.08)\",\n borderRadius: 10,\n padding: \"10px 14px\",\n fontFamily: MONO_FAMILY,\n fontSize: 13,\n color: \"rgba(255,255,255,0.85)\",\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n boxShadow: \"0 20px 50px rgba(0,0,0,0.5)\",\n zIndex: 10,\n }}\n >\n <span style={{ color: \"rgba(255,255,255,0.4)\" }}>↗</span>\n <span>\n <span style={{ color: \"white\" }}>{typedUrl}</span>\n <span style={{ color: \"rgba(255,255,255,0.4)\" }}>\n {suggestion.slice(typedChars)}\n </span>\n </span>\n </div>\n )}\n </div>\n <div style={{ width: 60 }} />\n\n {/* Progress bar */}\n <div\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n bottom: 0,\n height: 2,\n opacity: progressOpacity,\n }}\n >\n <div\n style={{\n width: `${progress}%`,\n height: \"100%\",\n background: \"linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%)\",\n boxShadow: \"0 0 8px rgba(96,165,250,0.6)\",\n }}\n />\n </div>\n </div>\n\n {/* Page viewport */}\n <div\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n top: chromeHeight,\n bottom: 0,\n overflow: \"hidden\",\n background: \"#0a0a0c\",\n opacity: pageOpacity,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n top: 0,\n transform: `translateY(${-scrollY}px)`,\n willChange: \"transform\",\n }}\n >\n {/* Header */}\n <div\n style={{\n height: 68,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n padding: \"0 60px\",\n borderBottom: \"1px solid rgba(255,255,255,0.05)\",\n }}\n >\n <div\n style={{\n fontWeight: 700,\n fontSize: 18,\n color: \"white\",\n letterSpacing: \"-0.02em\",\n }}\n >\n remocn\n </div>\n <div\n style={{\n display: \"flex\",\n gap: 28,\n fontSize: 14,\n color: \"rgba(255,255,255,0.65)\",\n }}\n >\n <span>Components</span>\n <span>Docs</span>\n <span>GitHub</span>\n </div>\n </div>\n\n {/* Hero */}\n <div\n style={{\n padding: \"100px 60px 80px\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: 24,\n alignItems: \"center\",\n textAlign: \"center\",\n }}\n >\n <div\n style={{\n fontSize: 13,\n color: \"rgba(120,160,255,0.85)\",\n fontWeight: 500,\n letterSpacing: \"0.02em\",\n }}\n >\n shadcn registry for Remotion\n </div>\n <div\n style={{\n fontSize: 64,\n fontWeight: 700,\n letterSpacing: \"-0.04em\",\n color: \"white\",\n lineHeight: 1.05,\n maxWidth: 720,\n }}\n >\n Production-ready video blocks.\n </div>\n <div\n style={{\n fontSize: 17,\n color: \"rgba(255,255,255,0.6)\",\n maxWidth: 520,\n lineHeight: 1.5,\n }}\n >\n Drop-in animations, transitions, and backgrounds for Remotion.\n Own your code.\n </div>\n\n {/* CTA — clicked at the end */}\n <button\n type=\"button\"\n style={{\n marginTop: 12,\n padding: \"16px 32px\",\n borderRadius: 12,\n background: \"white\",\n color: \"#0a0a0c\",\n fontFamily: FONT_FAMILY,\n fontSize: 15,\n fontWeight: 600,\n border: \"none\",\n transform: `scale(${buttonClickScale})`,\n boxShadow:\n frame >= clickFrame\n ? \"0 0 0 6px rgba(255,255,255,0.08)\"\n : \"0 10px 30px rgba(255,255,255,0.1)\",\n willChange: \"transform\",\n }}\n >\n Browse components →\n </button>\n </div>\n\n {/* Sections */}\n {[\n { title: \"Typography\", color: \"#3b82f6\" },\n { title: \"Backgrounds\", color: \"#a855f7\" },\n { title: \"Transitions\", color: \"#22c55e\" },\n ].map((s) => (\n <div\n key={s.title}\n style={{\n margin: \"40px 60px\",\n padding: \"40px\",\n borderRadius: 16,\n background:\n \"linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%)\",\n border: \"1px solid rgba(255,255,255,0.06)\",\n display: \"flex\",\n alignItems: \"center\",\n gap: 28,\n }}\n >\n <div\n style={{\n width: 64,\n height: 64,\n borderRadius: 14,\n background: `${s.color}22`,\n border: `1px solid ${s.color}55`,\n }}\n />\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 6,\n }}\n >\n <div\n style={{\n fontSize: 22,\n fontWeight: 600,\n color: \"white\",\n letterSpacing: \"-0.02em\",\n }}\n >\n {s.title}\n </div>\n <div\n style={{\n fontSize: 14,\n color: \"rgba(255,255,255,0.55)\",\n }}\n >\n Hand-tuned primitives, copied straight into your project.\n </div>\n </div>\n </div>\n ))}\n </div>\n </div>\n </div>\n\n {/* Virtual cursor */}\n {frame >= pageStart && (\n <div\n style={{\n position: \"absolute\",\n left: cursorX,\n top: cursorY,\n transform: `scale(${cursorClickScale})`,\n transformOrigin: \"top left\",\n zIndex: 9999,\n filter: \"drop-shadow(0 4px 8px rgba(0,0,0,0.5))\",\n willChange: \"transform\",\n }}\n >\n <CursorSVG />\n </div>\n )}\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface BrowserFlowProps {\n url?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\nconst MONO_FAMILY =\n \"var(--font-geist-mono), ui-monospace, SFMono-Regular, Menlo, monospace\";\n\nfunction MacDots({ size = 12 }: { size?: number }) {\n return (\n <div style={{ display: \"flex\", gap: 8, alignItems: \"center\" }}>\n {[\"#ff5f57\", \"#febc2e\", \"#28c840\"].map((c) => (\n <div\n key={c}\n style={{\n width: size,\n height: size,\n borderRadius: \"50%\",\n background: c,\n opacity: 0.85,\n }}\n />\n ))}\n </div>\n );\n}\n\nfunction CursorSVG() {\n return (\n <svg width=\"22\" height=\"28\" viewBox=\"0 0 22 28\" fill=\"none\">\n <path\n d=\"M2 2L2 22L7 17.5L10.5 25L13.5 23.5L10 16L17 16L2 2Z\"\n fill=\"white\"\n stroke=\"black\"\n strokeWidth=\"1.5\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nfunction easeInOut(t: number) {\n return t < 0.5 ? 2 * t * t : 1 - (-2 * t + 2) ** 2 / 2;\n}\n\nexport function BrowserFlow({\n url = \"remocn.dev\",\n speed = 1,\n className,\n}: BrowserFlowProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n // ── Browser dimensions ────────────────────────────\n const browserWidth = 1100;\n const browserHeight = 620;\n const chromeHeight = 56;\n const browserLeft = (1280 - browserWidth) / 2;\n const browserTop = (720 - browserHeight) / 2;\n\n // ── URL typing (frames 0..40) ─────────────────────\n const typingProgress = interpolate(frame, [4, 38], [0, url.length], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const typedChars = Math.floor(typingProgress);\n const typedUrl = url.slice(0, typedChars);\n const showCaret = frame < 50 && Math.floor(frame / 12) % 2 === 0;\n\n // Autocomplete suggestion appears once a few chars typed\n const showSuggestion = typedChars >= 2 && frame < 48;\n const suggestion = url;\n\n // ── Progress bar ──────────────────────────────────\n // 40..50: 0 -> 15\n // 50..65: hold at 15\n // 65..85: 15 -> 100\n // 85..95: fade out\n let progress = 0;\n if (frame < 40) progress = 0;\n else if (frame < 50)\n progress = interpolate(frame, [40, 50], [0, 15], {\n extrapolateRight: \"clamp\",\n });\n else if (frame < 65) progress = 15;\n else if (frame < 85)\n progress = interpolate(frame, [65, 85], [15, 100], {\n extrapolateRight: \"clamp\",\n });\n else progress = 100;\n\n const progressOpacity =\n frame < 40\n ? 0\n : frame < 85\n ? 1\n : interpolate(frame, [85, 95], [1, 0], {\n extrapolateRight: \"clamp\",\n });\n\n // ── Page render ───────────────────────────────────\n const pageStart = 95;\n const pageOpacity = interpolate(frame, [pageStart, pageStart + 12], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n // ── Page scroll & cursor motion ───────────────────\n const scrollStart = 115;\n const scrollEnd = 230;\n const scrollT = interpolate(frame, [scrollStart, scrollEnd], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const scrollEased = easeInOut(scrollT);\n const maxScroll = 600;\n const scrollY = scrollEased * maxScroll;\n\n // Cursor path: starts off the address bar area, moves down toward CTA inside viewport\n // Coordinates relative to the full 1280x720 frame.\n const cursorStartX = browserLeft + 380;\n const cursorStartY = browserTop + chromeHeight + 60;\n const cursorEndX = browserLeft + browserWidth / 2;\n const cursorEndY = browserTop + chromeHeight + 380;\n\n const cursorT = interpolate(frame, [pageStart + 5, scrollEnd], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n const cursorEased = easeInOut(cursorT);\n // arc bias on Y for organic feel\n const arcOffset = Math.sin(cursorEased * Math.PI) * 30;\n const cursorX =\n cursorStartX + (cursorEndX - cursorStartX) * cursorEased + arcOffset * 0.6;\n const cursorY =\n cursorStartY + (cursorEndY - cursorStartY) * cursorEased - arcOffset;\n\n // Click animation near the end\n const clickFrame = scrollEnd + 4;\n const clickSpring = spring({\n frame: frame - clickFrame,\n fps,\n config: { mass: 0.4, damping: 12, stiffness: 220 },\n durationInFrames: 18,\n });\n const cursorClickScale = interpolate(clickSpring, [0, 0.4, 1], [1, 0.85, 1], {\n extrapolateRight: \"clamp\",\n });\n const buttonClickScale =\n frame >= clickFrame\n ? interpolate(clickSpring, [0, 0.4, 1], [1, 0.98, 1], {\n extrapolateRight: \"clamp\",\n })\n : 1;\n\n // Address bar focus state (highlighted while typing)\n const addressFocused = frame < 50;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n fontFamily: FONT_FAMILY,\n }}\n >\n {/* Browser window */}\n <div\n style={{\n position: \"absolute\",\n left: browserLeft,\n top: browserTop,\n width: browserWidth,\n height: browserHeight,\n borderRadius: 16,\n overflow: \"hidden\",\n background: \"#0a0a0c\",\n border: \"1px solid rgba(255,255,255,0.08)\",\n boxShadow:\n \"0 50px 120px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.06)\",\n }}\n >\n {/* Chrome */}\n <div\n style={{\n position: \"relative\",\n height: chromeHeight,\n display: \"flex\",\n alignItems: \"center\",\n gap: 14,\n paddingLeft: 18,\n paddingRight: 18,\n background: \"rgba(20,20,24,0.95)\",\n borderBottom: \"1px solid rgba(255,255,255,0.06)\",\n }}\n >\n <MacDots />\n {/* nav arrows */}\n <div\n style={{\n display: \"flex\",\n gap: 6,\n marginLeft: 8,\n color: \"rgba(255,255,255,0.35)\",\n fontSize: 16,\n }}\n >\n <span>‹</span>\n <span>›</span>\n </div>\n {/* address bar */}\n <div\n style={{\n flex: 1,\n position: \"relative\",\n height: 32,\n borderRadius: 16,\n background: addressFocused\n ? \"rgba(255,255,255,0.08)\"\n : \"rgba(255,255,255,0.05)\",\n border: `1px solid ${\n addressFocused\n ? \"rgba(120,160,255,0.45)\"\n : \"rgba(255,255,255,0.07)\"\n }`,\n display: \"flex\",\n alignItems: \"center\",\n paddingLeft: 14,\n paddingRight: 14,\n fontFamily: MONO_FAMILY,\n fontSize: 13,\n color: \"rgba(255,255,255,0.85)\",\n boxShadow: addressFocused\n ? \"0 0 0 3px rgba(120,160,255,0.12)\"\n : \"none\",\n }}\n >\n <span style={{ color: \"rgba(255,255,255,0.4)\", marginRight: 8 }}>\n ⌕\n </span>\n <span>{typedUrl}</span>\n {showCaret && (\n <span\n style={{\n display: \"inline-block\",\n width: 1.5,\n height: 16,\n background: \"rgba(255,255,255,0.85)\",\n marginLeft: 1,\n }}\n />\n )}\n\n {/* Autocomplete suggestion dropdown */}\n {showSuggestion && (\n <div\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n top: \"calc(100% + 6px)\",\n background: \"rgba(22,22,26,0.98)\",\n border: \"1px solid rgba(255,255,255,0.08)\",\n borderRadius: 10,\n padding: \"10px 14px\",\n fontFamily: MONO_FAMILY,\n fontSize: 13,\n color: \"rgba(255,255,255,0.85)\",\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n boxShadow: \"0 20px 50px rgba(0,0,0,0.5)\",\n zIndex: 10,\n }}\n >\n <span style={{ color: \"rgba(255,255,255,0.4)\" }}>↗</span>\n <span>\n <span style={{ color: \"white\" }}>{typedUrl}</span>\n <span style={{ color: \"rgba(255,255,255,0.4)\" }}>\n {suggestion.slice(typedChars)}\n </span>\n </span>\n </div>\n )}\n </div>\n <div style={{ width: 60 }} />\n\n {/* Progress bar */}\n <div\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n bottom: 0,\n height: 2,\n opacity: progressOpacity,\n }}\n >\n <div\n style={{\n width: `${progress}%`,\n height: \"100%\",\n background: \"linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%)\",\n boxShadow: \"0 0 8px rgba(96,165,250,0.6)\",\n }}\n />\n </div>\n </div>\n\n {/* Page viewport */}\n <div\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n top: chromeHeight,\n bottom: 0,\n overflow: \"hidden\",\n background: \"#0a0a0c\",\n opacity: pageOpacity,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n top: 0,\n transform: `translateY(${-scrollY}px)`,\n willChange: \"transform\",\n }}\n >\n {/* Header */}\n <div\n style={{\n height: 68,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n padding: \"0 60px\",\n borderBottom: \"1px solid rgba(255,255,255,0.05)\",\n }}\n >\n <div\n style={{\n fontWeight: 700,\n fontSize: 18,\n color: \"white\",\n letterSpacing: \"-0.02em\",\n }}\n >\n remocn\n </div>\n <div\n style={{\n display: \"flex\",\n gap: 28,\n fontSize: 14,\n color: \"rgba(255,255,255,0.65)\",\n }}\n >\n <span>Components</span>\n <span>Docs</span>\n <span>GitHub</span>\n </div>\n </div>\n\n {/* Hero */}\n <div\n style={{\n padding: \"100px 60px 80px\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: 24,\n alignItems: \"center\",\n textAlign: \"center\",\n }}\n >\n <div\n style={{\n fontSize: 13,\n color: \"rgba(120,160,255,0.85)\",\n fontWeight: 500,\n letterSpacing: \"0.02em\",\n }}\n >\n shadcn registry for Remotion\n </div>\n <div\n style={{\n fontSize: 64,\n fontWeight: 700,\n letterSpacing: \"-0.04em\",\n color: \"white\",\n lineHeight: 1.05,\n maxWidth: 720,\n }}\n >\n Production-ready video blocks.\n </div>\n <div\n style={{\n fontSize: 17,\n color: \"rgba(255,255,255,0.6)\",\n maxWidth: 520,\n lineHeight: 1.5,\n }}\n >\n Drop-in animations, transitions, and backgrounds for Remotion.\n Own your code.\n </div>\n\n {/* CTA — clicked at the end */}\n <button\n type=\"button\"\n style={{\n marginTop: 12,\n padding: \"16px 32px\",\n borderRadius: 12,\n background: \"white\",\n color: \"#0a0a0c\",\n fontFamily: FONT_FAMILY,\n fontSize: 15,\n fontWeight: 600,\n border: \"none\",\n transform: `scale(${buttonClickScale})`,\n boxShadow:\n frame >= clickFrame\n ? \"0 0 0 6px rgba(255,255,255,0.08)\"\n : \"0 10px 30px rgba(255,255,255,0.1)\",\n willChange: \"transform\",\n }}\n >\n Browse components →\n </button>\n </div>\n\n {/* Sections */}\n {[\n { title: \"Typography\", color: \"#3b82f6\" },\n { title: \"Backgrounds\", color: \"#a855f7\" },\n { title: \"Transitions\", color: \"#22c55e\" },\n ].map((s) => (\n <div\n key={s.title}\n style={{\n margin: \"40px 60px\",\n padding: \"40px\",\n borderRadius: 16,\n background:\n \"linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%)\",\n border: \"1px solid rgba(255,255,255,0.06)\",\n display: \"flex\",\n alignItems: \"center\",\n gap: 28,\n }}\n >\n <div\n style={{\n width: 64,\n height: 64,\n borderRadius: 14,\n background: `${s.color}22`,\n border: `1px solid ${s.color}55`,\n }}\n />\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 6,\n }}\n >\n <div\n style={{\n fontSize: 22,\n fontWeight: 600,\n color: \"white\",\n letterSpacing: \"-0.02em\",\n }}\n >\n {s.title}\n </div>\n <div\n style={{\n fontSize: 14,\n color: \"rgba(255,255,255,0.55)\",\n }}\n >\n Hand-tuned primitives, copied straight into your project.\n </div>\n </div>\n </div>\n ))}\n </div>\n </div>\n </div>\n\n {/* Virtual cursor */}\n {frame >= pageStart && (\n <div\n style={{\n position: \"absolute\",\n left: cursorX,\n top: cursorY,\n transform: `scale(${cursorClickScale})`,\n transformOrigin: \"top left\",\n zIndex: 9999,\n filter: \"drop-shadow(0 4px 8px rgba(0,0,0,0.5))\",\n willChange: \"transform\",\n }}\n >\n <CursorSVG />\n </div>\n )}\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/browser-flow.tsx"
}
diff --git a/public/r/button.json b/public/r/button.json
index de314161..57595000 100644
--- a/public/r/button.json
+++ b/public/r/button.json
@@ -13,7 +13,7 @@
"files": [
{
"path": "registry/remocn-ui/button/index.tsx",
- "content": "\"use client\";\n\nimport { Spinner } from \"@/components/remocn/spinner\";\nimport { mixOklch, type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type ButtonState = \"idle\" | \"hover\" | \"press\" | \"loading\" | \"success\";\n\ntype ButtonVariant =\n | \"default\"\n | \"secondary\"\n | \"destructive\"\n | \"outline\"\n | \"ghost\";\n\ntype ButtonSize = \"sm\" | \"default\" | \"lg\";\n\nexport interface ButtonProps {\n state?: ButtonState;\n style?: ButtonStyle;\n label?: string;\n variant?: ButtonVariant;\n size?: ButtonSize;\n theme?: Partial<RemocnTheme>;\n primary?: string;\n mode?: \"light\" | \"dark\";\n speed?: number;\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 CHECK_PATH_LENGTH = 14;\n\nconst SIZE_STYLES: Record<\n ButtonSize,\n { height: number; padding: string; fontSize: number; gap: number }\n> = {\n sm: { height: 32, padding: \"0 12px\", fontSize: 13, gap: 6 },\n default: { height: 40, padding: \"0 20px\", fontSize: 15, gap: 8 },\n lg: { height: 48, padding: \"0 28px\", fontSize: 17, gap: 10 },\n};\n\ninterface VariantTokens {\n bg: string;\n fg: string;\n hoverBg: string;\n border: string;\n}\n\nfunction variantTokens(\n variant: ButtonVariant,\n theme: RemocnTheme,\n): VariantTokens {\n const variants = {\n secondary: {\n bg: theme.secondary,\n fg: theme.secondaryForeground,\n hoverBg: mixOklch(theme.secondary, theme.muted, 1),\n border: \"transparent\",\n },\n destructive: {\n bg: theme.destructive,\n fg: theme.destructiveForeground,\n hoverBg: mixOklch(theme.destructive, theme.foreground, 0.12),\n border: \"transparent\",\n },\n outline: {\n bg: \"transparent\",\n fg: theme.foreground,\n hoverBg: theme.accent,\n border: theme.border,\n },\n ghost: {\n bg: \"transparent\",\n fg: theme.foreground,\n hoverBg: theme.accent,\n border: \"transparent\",\n },\n default: {\n bg: theme.primary,\n fg: theme.primaryForeground,\n hoverBg: mixOklch(theme.primary, theme.foreground, 0.1),\n border: \"transparent\",\n },\n };\n\n return variants[variant] ?? variants.default;\n}\n\nexport interface ButtonStyle {\n translateY: number;\n scale: number;\n background: string;\n labelOpacity: number;\n spinnerOpacity: number;\n checkOpacity: number;\n}\n\nexport interface ButtonStyleContext {\n restBg: string;\n hoverBg: string;\n pressBg: string;\n primary: string;\n}\n\nexport function buttonStyleContext(\n variant: ButtonVariant,\n theme: RemocnTheme,\n): ButtonStyleContext {\n const tokens = variantTokens(variant, theme);\n const restBg = tokens.bg === \"transparent\" ? theme.background : tokens.bg;\n return {\n restBg,\n hoverBg: tokens.hoverBg,\n pressBg:\n tokens.bg === \"transparent\"\n ? tokens.hoverBg\n : mixOklch(tokens.hoverBg, theme.foreground, 0.08),\n primary: theme.primary,\n };\n}\n\nexport function buttonStyle(\n state: ButtonState,\n ctx: ButtonStyleContext,\n): ButtonStyle {\n switch (state) {\n case \"hover\":\n return {\n translateY: -1,\n scale: 1,\n background: ctx.hoverBg,\n labelOpacity: 1,\n spinnerOpacity: 0,\n checkOpacity: 0,\n };\n case \"press\":\n return {\n translateY: -1,\n scale: 0.97,\n background: ctx.pressBg,\n labelOpacity: 1,\n spinnerOpacity: 0,\n checkOpacity: 0,\n };\n case \"loading\":\n return {\n translateY: -1,\n scale: 1,\n background: ctx.hoverBg,\n labelOpacity: 0,\n spinnerOpacity: 1,\n checkOpacity: 0,\n };\n case \"success\":\n return {\n translateY: -1,\n scale: 1,\n background: ctx.primary,\n labelOpacity: 0,\n spinnerOpacity: 0,\n checkOpacity: 1,\n };\n default:\n return {\n translateY: 0,\n scale: 1,\n background: ctx.restBg,\n labelOpacity: 1,\n spinnerOpacity: 0,\n checkOpacity: 0,\n };\n }\n}\n\nexport function Button({\n state = \"idle\",\n style,\n label = \"Continue\",\n variant = \"default\",\n size = \"default\",\n theme: themeOverride,\n primary,\n mode,\n speed = 1,\n align = \"center\",\n className,\n}: ButtonProps) {\n const theme = useRemocnTheme(\n { ...themeOverride, ...(primary ? { primary } : {}) },\n mode,\n );\n\n const sizeStyle = SIZE_STYLES[size];\n const tokens = variantTokens(variant, theme);\n\n const ctx = buttonStyleContext(variant, theme);\n const v = style ?? buttonStyle(state, ctx);\n const iconSize = Math.round(sizeStyle.fontSize * 1.1);\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: justify(align),\n background: theme.background,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <button\n type=\"button\"\n className={className}\n style={{\n position: \"relative\",\n transform: `translateY(${v.translateY}px) scale(${v.scale})`,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: sizeStyle.gap,\n height: sizeStyle.height,\n padding: sizeStyle.padding,\n fontSize: sizeStyle.fontSize,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n color: tokens.fg,\n background: v.background,\n border:\n variant === \"outline\"\n ? `1px solid ${tokens.border}`\n : \"1px solid transparent\",\n borderRadius: theme.radius,\n cursor: \"pointer\",\n }}\n >\n {}\n <span style={{ position: \"relative\", display: \"inline-flex\" }}>\n <span style={{ opacity: v.labelOpacity }}>{label}</span>\n <span\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: v.spinnerOpacity,\n }}\n >\n <Spinner color={tokens.fg} speed={speed} size={iconSize} />\n </span>\n <span\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: v.checkOpacity,\n }}\n >\n <svg\n width={iconSize}\n height={iconSize}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n >\n <path\n d=\"M5 12.5l4.5 4.5L19 7\"\n stroke={tokens.fg}\n strokeWidth=\"2.6\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeDasharray={CHECK_PATH_LENGTH}\n strokeDashoffset={0}\n pathLength={CHECK_PATH_LENGTH}\n />\n </svg>\n </span>\n </span>\n </button>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { Spinner } from \"@/components/remocn/spinner\";\nimport { mixOklch, type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type ButtonState = \"idle\" | \"hover\" | \"press\" | \"loading\" | \"success\";\n\ntype ButtonVariant =\n | \"default\"\n | \"secondary\"\n | \"destructive\"\n | \"outline\"\n | \"ghost\";\n\ntype ButtonSize = \"sm\" | \"default\" | \"lg\";\n\nexport interface ButtonProps {\n state?: ButtonState;\n style?: ButtonStyle;\n label?: string;\n variant?: ButtonVariant;\n size?: ButtonSize;\n theme?: Partial<RemocnTheme>;\n primary?: string;\n speed?: number;\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 CHECK_PATH_LENGTH = 14;\n\nconst SIZE_STYLES: Record<\n ButtonSize,\n { height: number; padding: string; fontSize: number; gap: number }\n> = {\n sm: { height: 32, padding: \"0 12px\", fontSize: 13, gap: 6 },\n default: { height: 40, padding: \"0 20px\", fontSize: 15, gap: 8 },\n lg: { height: 48, padding: \"0 28px\", fontSize: 17, gap: 10 },\n};\n\ninterface VariantTokens {\n bg: string;\n fg: string;\n hoverBg: string;\n border: string;\n}\n\nfunction variantTokens(\n variant: ButtonVariant,\n theme: RemocnTheme,\n): VariantTokens {\n const variants = {\n secondary: {\n bg: theme.secondary,\n fg: theme.secondaryForeground,\n hoverBg: mixOklch(theme.secondary, theme.muted, 1),\n border: \"transparent\",\n },\n destructive: {\n bg: theme.destructive,\n fg: theme.destructiveForeground,\n hoverBg: mixOklch(theme.destructive, theme.foreground, 0.12),\n border: \"transparent\",\n },\n outline: {\n bg: \"transparent\",\n fg: theme.foreground,\n hoverBg: theme.accent,\n border: theme.border,\n },\n ghost: {\n bg: \"transparent\",\n fg: theme.foreground,\n hoverBg: theme.accent,\n border: \"transparent\",\n },\n default: {\n bg: theme.primary,\n fg: theme.primaryForeground,\n hoverBg: mixOklch(theme.primary, theme.foreground, 0.1),\n border: \"transparent\",\n },\n };\n\n return variants[variant] ?? variants.default;\n}\n\nexport interface ButtonStyle {\n translateY: number;\n scale: number;\n background: string;\n labelOpacity: number;\n spinnerOpacity: number;\n checkOpacity: number;\n}\n\nexport interface ButtonStyleContext {\n restBg: string;\n hoverBg: string;\n pressBg: string;\n primary: string;\n}\n\nexport function buttonStyleContext(\n variant: ButtonVariant,\n theme: RemocnTheme,\n): ButtonStyleContext {\n const tokens = variantTokens(variant, theme);\n const restBg = tokens.bg === \"transparent\" ? theme.background : tokens.bg;\n return {\n restBg,\n hoverBg: tokens.hoverBg,\n pressBg:\n tokens.bg === \"transparent\"\n ? tokens.hoverBg\n : mixOklch(tokens.hoverBg, theme.foreground, 0.08),\n primary: theme.primary,\n };\n}\n\nexport function buttonStyle(\n state: ButtonState,\n ctx: ButtonStyleContext,\n): ButtonStyle {\n switch (state) {\n case \"hover\":\n return {\n translateY: -1,\n scale: 1,\n background: ctx.hoverBg,\n labelOpacity: 1,\n spinnerOpacity: 0,\n checkOpacity: 0,\n };\n case \"press\":\n return {\n translateY: -1,\n scale: 0.97,\n background: ctx.pressBg,\n labelOpacity: 1,\n spinnerOpacity: 0,\n checkOpacity: 0,\n };\n case \"loading\":\n return {\n translateY: -1,\n scale: 1,\n background: ctx.hoverBg,\n labelOpacity: 0,\n spinnerOpacity: 1,\n checkOpacity: 0,\n };\n case \"success\":\n return {\n translateY: -1,\n scale: 1,\n background: ctx.primary,\n labelOpacity: 0,\n spinnerOpacity: 0,\n checkOpacity: 1,\n };\n default:\n return {\n translateY: 0,\n scale: 1,\n background: ctx.restBg,\n labelOpacity: 1,\n spinnerOpacity: 0,\n checkOpacity: 0,\n };\n }\n}\n\nexport function Button({\n state = \"idle\",\n style,\n label = \"Continue\",\n variant = \"default\",\n size = \"default\",\n theme: themeOverride,\n primary,\n speed = 1,\n align = \"center\",\n className,\n}: ButtonProps) {\n const theme = useRemocnTheme(\n { ...themeOverride, ...(primary ? { primary } : {}) },\n \"light\",\n );\n\n const sizeStyle = SIZE_STYLES[size];\n const tokens = variantTokens(variant, theme);\n\n const ctx = buttonStyleContext(variant, theme);\n const v = style ?? buttonStyle(state, ctx);\n const iconSize = Math.round(sizeStyle.fontSize * 1.1);\n\n return (\n <div\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 <button\n type=\"button\"\n className={className}\n style={{\n position: \"relative\",\n transform: `translateY(${v.translateY}px) scale(${v.scale})`,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: sizeStyle.gap,\n height: sizeStyle.height,\n padding: sizeStyle.padding,\n fontSize: sizeStyle.fontSize,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n color: tokens.fg,\n background: v.background,\n border:\n variant === \"outline\"\n ? `1px solid ${tokens.border}`\n : \"1px solid transparent\",\n borderRadius: theme.radius,\n cursor: \"pointer\",\n }}\n >\n {}\n <span style={{ position: \"relative\", display: \"inline-flex\" }}>\n <span style={{ opacity: v.labelOpacity }}>{label}</span>\n <span\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: v.spinnerOpacity,\n }}\n >\n <Spinner color={tokens.fg} speed={speed} size={iconSize} />\n </span>\n <span\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n opacity: v.checkOpacity,\n }}\n >\n <svg\n width={iconSize}\n height={iconSize}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n >\n <path\n d=\"M5 12.5l4.5 4.5L19 7\"\n stroke={tokens.fg}\n strokeWidth=\"2.6\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeDasharray={CHECK_PATH_LENGTH}\n strokeDashoffset={0}\n pathLength={CHECK_PATH_LENGTH}\n />\n </svg>\n </span>\n </span>\n </button>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/button.tsx"
},
diff --git a/public/r/chat-gpt.json b/public/r/chat-gpt.json
index 8d3c4094..45ae1fad 100644
--- a/public/r/chat-gpt.json
+++ b/public/r/chat-gpt.json
@@ -14,7 +14,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 theme?: \"light\" | \"dark\";\n background?: \"surface\" | \"transparent\";\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 theme = \"light\",\n background = \"surface\",\n speed = 1,\n}: ChatGptProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = THEMES[theme] ?? 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 pageBg = background === \"transparent\" ? \"transparent\" : t.page;\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: pageBg }}>\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:\n theme === \"light\"\n ? \"0 8px 30px -14px rgba(13,13,13,0.14)\"\n : \"0 8px 30px -14px rgba(0,0,0,0.5)\",\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\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",
"type": "registry:component",
"target": "components/remocn/chat-gpt.tsx"
}
diff --git a/public/r/chat-to-preview-layout.json b/public/r/chat-to-preview-layout.json
index 8b822be2..477bb63b 100644
--- a/public/r/chat-to-preview-layout.json
+++ b/public/r/chat-to-preview-layout.json
@@ -9,7 +9,7 @@
"files": [
{
"path": "registry/remocn/chat-to-preview-layout/index.tsx",
- "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface ChatToPreviewLayoutProps {\n chat?: ReactNode;\n preview?: ReactNode;\n startChatRatio?: number;\n endChatRatio?: number;\n background?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nfunction DefaultChat() {\n const messages = [\n { from: \"user\", text: \"Build me a landing page\" },\n { from: \"ai\", text: \"Sure — what should it feature?\" },\n { from: \"user\", text: \"Hero, pricing, footer.\" },\n { from: \"ai\", text: \"On it. Generating now...\" },\n ];\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n padding: 24,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 12,\n fontFamily: FONT_FAMILY,\n background: \"#111\",\n }}\n >\n <div\n style={{\n color: \"#888\",\n fontSize: 12,\n fontWeight: 600,\n letterSpacing: \"0.08em\",\n textTransform: \"uppercase\",\n marginBottom: 8,\n }}\n >\n Chat\n </div>\n {messages.map((m, i) => (\n <div\n key={i}\n style={{\n alignSelf: m.from === \"user\" ? \"flex-end\" : \"flex-start\",\n background: m.from === \"user\" ? \"#0ea5e9\" : \"#262626\",\n color: \"white\",\n padding: \"10px 14px\",\n borderRadius: 14,\n fontSize: 14,\n maxWidth: \"85%\",\n }}\n >\n {m.text}\n </div>\n ))}\n </div>\n );\n}\n\nfunction DefaultPreview() {\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"white\",\n display: \"flex\",\n flexDirection: \"column\",\n fontFamily: FONT_FAMILY,\n }}\n >\n <div\n style={{\n height: 36,\n background: \"#f4f4f5\",\n borderBottom: \"1px solid #e4e4e7\",\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n padding: \"0 12px\",\n }}\n >\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"#ef4444\",\n }}\n />\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"#f59e0b\",\n }}\n />\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"#22c55e\",\n }}\n />\n </div>\n <div\n style={{\n flex: 1,\n padding: 32,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 16,\n }}\n >\n <div\n style={{\n fontSize: 36,\n fontWeight: 700,\n letterSpacing: \"-0.03em\",\n color: \"#0a0a0a\",\n }}\n >\n Ship faster.\n </div>\n <div style={{ fontSize: 16, color: \"#71717a\", maxWidth: 360 }}>\n The fastest way to launch your idea. Built with Remotion.\n </div>\n <div\n style={{\n marginTop: 12,\n display: \"inline-flex\",\n background: \"#0a0a0a\",\n color: \"white\",\n padding: \"10px 18px\",\n borderRadius: 10,\n alignSelf: \"flex-start\",\n fontSize: 14,\n fontWeight: 600,\n }}\n >\n Get started\n </div>\n </div>\n </div>\n );\n}\n\nexport function ChatToPreviewLayout({\n chat,\n preview,\n startChatRatio = 0.5,\n endChatRatio = 0.25,\n background = \"#0a0a0a\",\n speed = 1,\n className,\n}: ChatToPreviewLayoutProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n // Apple's signature ease — slow start, dramatic settle. Replaces the older\n // symmetric bezier so the morph feels deliberate instead of mechanical.\n const APPLE_EASE = Easing.bezier(0.16, 1, 0.3, 1);\n\n const morphStart = durationInFrames * 0.1;\n const morphEnd = durationInFrames * 0.7;\n\n const ratio = interpolate(\n frame,\n [morphStart, morphEnd],\n [startChatRatio, endChatRatio],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: APPLE_EASE,\n },\n );\n\n // Right (preview) panel reveal: fade in + slide left into its growing slot.\n // Anchored to the same morph window so it feels like the chat is physically\n // dragging the preview into existence.\n const previewOpacity = interpolate(frame, [morphStart, morphEnd], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: APPLE_EASE,\n });\n const previewTx = interpolate(frame, [morphStart, morphEnd], [40, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: APPLE_EASE,\n });\n\n const chatBasis = `${ratio * 100}%`;\n const previewBasis = `${(1 - ratio) * 100}%`;\n\n // Inner content min-widths. These are the lever that prevents text from\n // re-flowing inside the columns as the parent flex-basis morphs — content\n // is rendered at a fixed virtual width, then clipped by `overflow: hidden`\n // on the outer column. No reflow → no jumping characters.\n const CHAT_INNER_MIN = 520;\n const PREVIEW_INNER_MIN = 720;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background,\n padding: 32,\n display: \"flex\",\n gap: 16,\n }}\n >\n <div\n style={{\n flexBasis: chatBasis,\n flexGrow: 0,\n flexShrink: 0,\n position: \"relative\",\n overflow: \"hidden\",\n borderRadius: 16,\n border: \"1px solid rgba(255,255,255,0.08)\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n minWidth: CHAT_INNER_MIN,\n }}\n >\n {chat ?? <DefaultChat />}\n </div>\n </div>\n <div\n style={{\n flexBasis: previewBasis,\n flexGrow: 0,\n flexShrink: 0,\n position: \"relative\",\n overflow: \"hidden\",\n borderRadius: 16,\n border: \"1px solid rgba(255,255,255,0.08)\",\n opacity: previewOpacity,\n transform: `translateX(${previewTx}px)`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n minWidth: PREVIEW_INNER_MIN,\n }}\n >\n {preview ?? <DefaultPreview />}\n </div>\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface ChatToPreviewLayoutProps {\n chat?: ReactNode;\n preview?: ReactNode;\n startChatRatio?: number;\n endChatRatio?: number;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nfunction DefaultChat() {\n const messages = [\n { from: \"user\", text: \"Build me a landing page\" },\n { from: \"ai\", text: \"Sure — what should it feature?\" },\n { from: \"user\", text: \"Hero, pricing, footer.\" },\n { from: \"ai\", text: \"On it. Generating now...\" },\n ];\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n padding: 24,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 12,\n fontFamily: FONT_FAMILY,\n background: \"#111\",\n }}\n >\n <div\n style={{\n color: \"#888\",\n fontSize: 12,\n fontWeight: 600,\n letterSpacing: \"0.08em\",\n textTransform: \"uppercase\",\n marginBottom: 8,\n }}\n >\n Chat\n </div>\n {messages.map((m, i) => (\n <div\n key={i}\n style={{\n alignSelf: m.from === \"user\" ? \"flex-end\" : \"flex-start\",\n background: m.from === \"user\" ? \"#0ea5e9\" : \"#262626\",\n color: \"white\",\n padding: \"10px 14px\",\n borderRadius: 14,\n fontSize: 14,\n maxWidth: \"85%\",\n }}\n >\n {m.text}\n </div>\n ))}\n </div>\n );\n}\n\nfunction DefaultPreview() {\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"white\",\n display: \"flex\",\n flexDirection: \"column\",\n fontFamily: FONT_FAMILY,\n }}\n >\n <div\n style={{\n height: 36,\n background: \"#f4f4f5\",\n borderBottom: \"1px solid #e4e4e7\",\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n padding: \"0 12px\",\n }}\n >\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"#ef4444\",\n }}\n />\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"#f59e0b\",\n }}\n />\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"#22c55e\",\n }}\n />\n </div>\n <div\n style={{\n flex: 1,\n padding: 32,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 16,\n }}\n >\n <div\n style={{\n fontSize: 36,\n fontWeight: 700,\n letterSpacing: \"-0.03em\",\n color: \"#0a0a0a\",\n }}\n >\n Ship faster.\n </div>\n <div style={{ fontSize: 16, color: \"#71717a\", maxWidth: 360 }}>\n The fastest way to launch your idea. Built with Remotion.\n </div>\n <div\n style={{\n marginTop: 12,\n display: \"inline-flex\",\n background: \"#0a0a0a\",\n color: \"white\",\n padding: \"10px 18px\",\n borderRadius: 10,\n alignSelf: \"flex-start\",\n fontSize: 14,\n fontWeight: 600,\n }}\n >\n Get started\n </div>\n </div>\n </div>\n );\n}\n\nexport function ChatToPreviewLayout({\n chat,\n preview,\n startChatRatio = 0.5,\n endChatRatio = 0.25,\n speed = 1,\n className,\n}: ChatToPreviewLayoutProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n // Apple's signature ease — slow start, dramatic settle. Replaces the older\n // symmetric bezier so the morph feels deliberate instead of mechanical.\n const APPLE_EASE = Easing.bezier(0.16, 1, 0.3, 1);\n\n const morphStart = durationInFrames * 0.1;\n const morphEnd = durationInFrames * 0.7;\n\n const ratio = interpolate(\n frame,\n [morphStart, morphEnd],\n [startChatRatio, endChatRatio],\n {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: APPLE_EASE,\n },\n );\n\n // Right (preview) panel reveal: fade in + slide left into its growing slot.\n // Anchored to the same morph window so it feels like the chat is physically\n // dragging the preview into existence.\n const previewOpacity = interpolate(frame, [morphStart, morphEnd], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: APPLE_EASE,\n });\n const previewTx = interpolate(frame, [morphStart, morphEnd], [40, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: APPLE_EASE,\n });\n\n const chatBasis = `${ratio * 100}%`;\n const previewBasis = `${(1 - ratio) * 100}%`;\n\n // Inner content min-widths. These are the lever that prevents text from\n // re-flowing inside the columns as the parent flex-basis morphs — content\n // is rendered at a fixed virtual width, then clipped by `overflow: hidden`\n // on the outer column. No reflow → no jumping characters.\n const CHAT_INNER_MIN = 520;\n const PREVIEW_INNER_MIN = 720;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n padding: 32,\n display: \"flex\",\n gap: 16,\n }}\n >\n <div\n style={{\n flexBasis: chatBasis,\n flexGrow: 0,\n flexShrink: 0,\n position: \"relative\",\n overflow: \"hidden\",\n borderRadius: 16,\n border: \"1px solid rgba(255,255,255,0.08)\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n minWidth: CHAT_INNER_MIN,\n }}\n >\n {chat ?? <DefaultChat />}\n </div>\n </div>\n <div\n style={{\n flexBasis: previewBasis,\n flexGrow: 0,\n flexShrink: 0,\n position: \"relative\",\n overflow: \"hidden\",\n borderRadius: 16,\n border: \"1px solid rgba(255,255,255,0.08)\",\n opacity: previewOpacity,\n transform: `translateX(${previewTx}px)`,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n minWidth: PREVIEW_INNER_MIN,\n }}\n >\n {preview ?? <DefaultPreview />}\n </div>\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/chat-to-preview-layout.tsx"
}
diff --git a/public/r/checkbox.json b/public/r/checkbox.json
index be9e6ab5..ca2aa05f 100644
--- a/public/r/checkbox.json
+++ b/public/r/checkbox.json
@@ -12,7 +12,7 @@
"files": [
{
"path": "registry/remocn-ui/checkbox/index.tsx",
- "content": "\"use client\";\n\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type CheckboxState = \"unchecked\" | \"checked\";\n\ntype CheckboxSize = \"sm\" | \"default\" | \"lg\";\n\nexport interface CheckboxProps {\n state?: CheckboxState;\n style?: CheckboxStyle;\n label?: string;\n size?: CheckboxSize;\n theme?: Partial<RemocnTheme>;\n primary?: string;\n mode?: \"light\" | \"dark\";\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 CHECK_PATH_LENGTH = 14;\n\nconst SIZE_STYLES: Record<\n CheckboxSize,\n { box: number; fontSize: number; gap: number }\n> = {\n sm: { box: 16, fontSize: 13, gap: 8 },\n default: { box: 20, fontSize: 15, gap: 10 },\n lg: { box: 24, fontSize: 17, gap: 12 },\n};\n\nexport interface CheckboxStyle {\n boxBackground: string;\n boxBorderColor: string;\n checkOpacity: number;\n checkScale: number;\n checkDraw: number;\n}\n\nexport interface CheckboxStyleContext {\n uncheckedBg: string;\n checkedBg: string;\n uncheckedBorder: string;\n checkedBorder: string;\n checkColor: string;\n}\n\nexport function checkboxStyleContext(theme: RemocnTheme): CheckboxStyleContext {\n return {\n uncheckedBg: theme.background,\n checkedBg: theme.primary,\n uncheckedBorder: theme.border,\n checkedBorder: theme.primary,\n checkColor: theme.primaryForeground,\n };\n}\n\nexport function checkboxStyle(\n state: CheckboxState,\n ctx: CheckboxStyleContext,\n): CheckboxStyle {\n switch (state) {\n case \"checked\":\n return {\n boxBackground: ctx.checkedBg,\n boxBorderColor: ctx.checkedBorder,\n checkOpacity: 1,\n checkScale: 1,\n checkDraw: 1,\n };\n default:\n return {\n boxBackground: ctx.uncheckedBg,\n boxBorderColor: ctx.uncheckedBorder,\n checkOpacity: 0,\n checkScale: 0.6,\n checkDraw: 0,\n };\n }\n}\n\nexport function Checkbox({\n state = \"unchecked\",\n style,\n label,\n size = \"default\",\n theme: themeOverride,\n primary,\n mode,\n align = \"center\",\n className,\n}: CheckboxProps) {\n const theme = useRemocnTheme(\n { ...themeOverride, ...(primary ? { primary } : {}) },\n mode,\n );\n\n const sizeStyle = SIZE_STYLES[size];\n const ctx = checkboxStyleContext(theme);\n const v = style ?? checkboxStyle(state, ctx);\n const boxSize = sizeStyle.box;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: justify(align),\n background: theme.background,\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 display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: boxSize,\n height: boxSize,\n borderRadius: Math.round(boxSize * 0.28),\n border: `1px solid ${v.boxBorderColor}`,\n background: v.boxBackground,\n }}\n >\n <svg\n width={boxSize}\n height={boxSize}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n style={{\n opacity: v.checkOpacity,\n transform: `scale(${v.checkScale})`,\n }}\n >\n <path\n d=\"M5 12.5l4.5 4.5L19 7\"\n stroke={ctx.checkColor}\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 - v.checkDraw)}\n />\n </svg>\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 CheckboxState = \"unchecked\" | \"checked\";\n\ntype CheckboxSize = \"sm\" | \"default\" | \"lg\";\n\nexport interface CheckboxProps {\n state?: CheckboxState;\n style?: CheckboxStyle;\n label?: string;\n size?: CheckboxSize;\n theme?: Partial<RemocnTheme>;\n primary?: string;\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 CHECK_PATH_LENGTH = 14;\n\nconst SIZE_STYLES: Record<\n CheckboxSize,\n { box: number; fontSize: number; gap: number }\n> = {\n sm: { box: 16, fontSize: 13, gap: 8 },\n default: { box: 20, fontSize: 15, gap: 10 },\n lg: { box: 24, fontSize: 17, gap: 12 },\n};\n\nexport interface CheckboxStyle {\n boxBackground: string;\n boxBorderColor: string;\n checkOpacity: number;\n checkScale: number;\n checkDraw: number;\n}\n\nexport interface CheckboxStyleContext {\n uncheckedBg: string;\n checkedBg: string;\n uncheckedBorder: string;\n checkedBorder: string;\n checkColor: string;\n}\n\nexport function checkboxStyleContext(theme: RemocnTheme): CheckboxStyleContext {\n return {\n uncheckedBg: theme.background,\n checkedBg: theme.primary,\n uncheckedBorder: theme.border,\n checkedBorder: theme.primary,\n checkColor: theme.primaryForeground,\n };\n}\n\nexport function checkboxStyle(\n state: CheckboxState,\n ctx: CheckboxStyleContext,\n): CheckboxStyle {\n switch (state) {\n case \"checked\":\n return {\n boxBackground: ctx.checkedBg,\n boxBorderColor: ctx.checkedBorder,\n checkOpacity: 1,\n checkScale: 1,\n checkDraw: 1,\n };\n default:\n return {\n boxBackground: ctx.uncheckedBg,\n boxBorderColor: ctx.uncheckedBorder,\n checkOpacity: 0,\n checkScale: 0.6,\n checkDraw: 0,\n };\n }\n}\n\nexport function Checkbox({\n state = \"unchecked\",\n style,\n label,\n size = \"default\",\n theme: themeOverride,\n primary,\n align = \"center\",\n className,\n}: CheckboxProps) {\n const theme = useRemocnTheme(\n { ...themeOverride, ...(primary ? { primary } : {}) },\n \"light\",\n );\n\n const sizeStyle = SIZE_STYLES[size];\n const ctx = checkboxStyleContext(theme);\n const v = style ?? checkboxStyle(state, ctx);\n const boxSize = sizeStyle.box;\n\n return (\n <div\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 <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 display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: boxSize,\n height: boxSize,\n borderRadius: Math.round(boxSize * 0.28),\n border: `1px solid ${v.boxBorderColor}`,\n background: v.boxBackground,\n }}\n >\n <svg\n width={boxSize}\n height={boxSize}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n style={{\n opacity: v.checkOpacity,\n transform: `scale(${v.checkScale})`,\n }}\n >\n <path\n d=\"M5 12.5l4.5 4.5L19 7\"\n stroke={ctx.checkColor}\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 - v.checkDraw)}\n />\n </svg>\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/checkbox.tsx"
},
diff --git a/public/r/checkout-flow.json b/public/r/checkout-flow.json
index 87ddeab8..43102491 100644
--- a/public/r/checkout-flow.json
+++ b/public/r/checkout-flow.json
@@ -20,7 +20,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 mode?: \"light\" | \"dark\";\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 mode = \"light\",\n theme,\n}: CheckoutFlowProps) {\n const resolved = useRemocnTheme(theme, mode);\n const opts = { mode, 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 { mode },\n );\n\n return (\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n background: resolved.muted,\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 mode={mode}\n theme={theme}\n />\n </FieldControl>\n </BlurIn>\n\n <FieldGroup gap={24}>\n <BlurIn display=\"block\" style={enterCard}>\n <Field>\n <FieldLabel mode={mode} theme={theme}>\n {cardLabel}\n </FieldLabel>\n <FieldControl>\n <Input\n placeholder={cardPlaceholder}\n value={cardPlaceholder}\n style={cardStyle}\n fullWidth\n mode={mode}\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 mode={mode}\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 mode={mode}\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 mode={mode}\n theme={theme}\n />\n </div>\n\n <Cursor style={cursorStyle} variant=\"pointer\" mode={mode} theme={theme} />\n </div>\n );\n}\n",
+ "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",
"type": "registry:component",
"target": "components/remocn/checkout-flow.tsx"
}
diff --git a/public/r/claude-chat.json b/public/r/claude-chat.json
index 7f7a5289..e0fee3b0 100644
--- a/public/r/claude-chat.json
+++ b/public/r/claude-chat.json
@@ -14,7 +14,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 theme?: \"light\" | \"dark\";\n background?: \"surface\" | \"transparent\";\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 theme = \"light\",\n background = \"surface\",\n speed = 1,\n}: ClaudeChatProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = THEMES[theme] ?? 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 pageBg = background === \"transparent\" ? \"transparent\" : t.page;\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: pageBg }}>\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:\n theme === \"light\"\n ? \"0 8px 30px -12px rgba(31,30,29,0.12)\"\n : \"0 8px 30px -12px rgba(0,0,0,0.5)\",\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 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",
"type": "registry:component",
"target": "components/remocn/claude-chat.tsx"
}
diff --git a/public/r/claude-code.json b/public/r/claude-code.json
index f71000e4..2604a38f 100644
--- a/public/r/claude-code.json
+++ b/public/r/claude-code.json
@@ -14,7 +14,7 @@
"files": [
{
"path": "registry/remocn/claude-code/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 ClaudeCodeProps {\n title?: string;\n userName?: string;\n model?: string;\n cwd?: string;\n placeholder?: string;\n prompt?: string;\n accentColor?: string;\n theme?: \"light\" | \"dark\";\n background?: \"surface\" | \"transparent\";\n speed?: number;\n}\n\ninterface Theme {\n page: string;\n windowBar: string;\n windowBody: string;\n fg: string;\n fgMuted: string;\n fgDim: string;\n boxBorder: string;\n}\n\nexport const THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n page: \"#E8E5DD\",\n windowBar: \"#D8D3CA\",\n windowBody: \"#FBFAF7\",\n fg: \"#1F1E1D\",\n fgMuted: \"#73726C\",\n fgDim: \"#A3A097\",\n boxBorder: \"#D97757\",\n },\n dark: {\n page: \"#2B2A28\",\n windowBar: \"#3A3633\",\n windowBody: \"#1B1A18\",\n fg: \"#E8E5DD\",\n fgMuted: \"#8A857C\",\n fgDim: \"#6B6660\",\n boxBorder: \"#D97757\",\n },\n};\n\nexport const TYPING_START_FRAME = 48;\n\nexport const TYPING_CPS = 18;\n\nexport const WHATS_NEW: string[] = [\n \"/agents to create subagents\",\n \"/security-review for review agent\",\n \"ctrl+b to background bashes\",\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 Mascot({ accent, size = 96 }: { accent: string; size?: number }) {\n return (\n <svg\n height={size}\n viewBox=\"0 0 24 24\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <title>Claude Code</title>\n <path\n clipRule=\"evenodd\"\n d=\"M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z\"\n fill={accent}\n fillRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function ClaudeCode({\n title = \"Claude Code v2.0.0\",\n userName = \"Meaghan\",\n model = \"Opus 4.8 • Max 20x\",\n cwd = \"/users/meaghan/code/apps\",\n placeholder = 'Try \"edit <filepath> to ...\"',\n prompt = \"edit src/theme.ts to add a dark mode toggle\",\n accentColor = \"#D97757\",\n theme = \"dark\",\n background = \"surface\",\n speed = 1,\n}: ClaudeCodeProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = THEMES[theme] ?? 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 showText = tw.count > 0;\n\n const intro = introBounceIn(frame * speed, fps);\n const leftFade = fadeUpAt(frame * speed, [6, 22]);\n const rightFade = fadeUpAt(frame * speed, [12, 30]);\n const promptFade = fadeUpAt(frame * speed, [18, 36]);\n\n const pageBg = background === \"transparent\" ? \"transparent\" : t.page;\n const border = accentColor;\n\n const winLeft = 90;\n const winTop = 40;\n const winWidth = 1100;\n const winHeight = 620;\n const barHeight = 40;\n\n return (\n <AbsoluteFill style={{ background: pageBg }}>\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: winLeft,\n top: winTop,\n width: winWidth,\n height: winHeight,\n background: t.windowBody,\n borderRadius: 12,\n overflow: \"hidden\",\n boxShadow:\n theme === \"light\"\n ? \"0 24px 60px -20px rgba(31,30,29,0.28)\"\n : \"0 24px 60px -20px rgba(0,0,0,0.6)\",\n opacity: intro.scale,\n transform: `translateY(${intro.translateY}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 height: barHeight,\n background: t.windowBar,\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n paddingLeft: 16,\n flexShrink: 0,\n }}\n >\n <div\n style={{\n width: 12,\n height: 12,\n borderRadius: \"50%\",\n background: \"#FF5F57\",\n }}\n />\n <div\n style={{\n width: 12,\n height: 12,\n borderRadius: \"50%\",\n background: \"#FEBC2E\",\n }}\n />\n <div\n style={{\n width: 12,\n height: 12,\n borderRadius: \"50%\",\n background: \"#28C840\",\n }}\n />\n </div>\n\n <div\n style={{\n flex: 1,\n position: \"relative\",\n padding: 28,\n boxSizing: \"border-box\",\n display: \"flex\",\n flexDirection: \"column\",\n }}\n >\n <div\n style={{\n position: \"relative\",\n border: `1px dashed ${border}`,\n borderRadius: 6,\n padding: \"28px 24px 24px\",\n opacity: leftFade.opacity,\n transform: `translateY(${leftFade.translateY}px)`,\n }}\n >\n <span\n style={{\n position: \"absolute\",\n top: -11,\n left: 22,\n padding: \"0 10px\",\n background: t.windowBody,\n color: accentColor,\n fontFamily: MONO_FAMILY,\n fontSize: 16,\n fontWeight: 700,\n }}\n >\n {title}\n </span>\n\n <div style={{ display: \"flex\", flexDirection: \"row\" }}>\n <div\n style={{\n width: \"42%\",\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n gap: 16,\n paddingRight: 24,\n boxSizing: \"border-box\",\n }}\n >\n <div\n style={{\n fontFamily: MONO_FAMILY,\n fontSize: 20,\n color: t.fg,\n }}\n >\n Welcome back {userName}!\n </div>\n <div style={{ alignSelf: \"center\" }}>\n <Mascot accent={accentColor} />\n </div>\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 4,\n }}\n >\n <div\n style={{\n fontFamily: MONO_FAMILY,\n fontSize: 15,\n color: t.fgMuted,\n }}\n >\n {model}\n </div>\n <div\n style={{\n fontFamily: MONO_FAMILY,\n fontSize: 15,\n color: t.fgMuted,\n }}\n >\n {cwd}\n </div>\n </div>\n </div>\n\n <div\n style={{\n width: \"58%\",\n borderLeft: `1px dashed ${border}`,\n paddingLeft: 24,\n boxSizing: \"border-box\",\n display: \"flex\",\n flexDirection: \"column\",\n opacity: rightFade.opacity,\n transform: `translateY(${rightFade.translateY}px)`,\n }}\n >\n <div>\n <div\n style={{\n fontFamily: MONO_FAMILY,\n fontSize: 15,\n fontWeight: 700,\n color: accentColor,\n marginBottom: 10,\n }}\n >\n What's new\n </div>\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 6,\n }}\n >\n {WHATS_NEW.map((line) => (\n <div\n key={line}\n style={{\n fontFamily: MONO_FAMILY,\n fontSize: 14,\n color: t.fg,\n }}\n >\n {line}\n </div>\n ))}\n <div\n style={{\n fontFamily: MONO_FAMILY,\n fontSize: 14,\n color: t.fgDim,\n }}\n >\n ... /help for more\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div style={{ height: 32 }} />\n\n <div\n style={{\n opacity: promptFade.opacity,\n transform: `translateY(${promptFade.translateY}px)`,\n }}\n >\n <div\n style={{\n height: 1,\n background: t.fgDim,\n opacity: 0.4,\n marginBottom: 16,\n }}\n />\n <div\n style={{\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n fontFamily: MONO_FAMILY,\n fontSize: 17,\n whiteSpace: \"pre\",\n }}\n >\n <span style={{ color: t.fgMuted }}>{\"> \"}</span>\n {showText ? (\n <span\n style={{\n position: \"relative\",\n color: t.fg,\n display: \"inline-flex\",\n alignItems: \"center\",\n }}\n >\n {tw.text}\n <span style={{ opacity: 0.55, display: \"inline-flex\" }}>\n <Caret\n width={11}\n height={22}\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n marginLeft={2}\n />\n </span>\n </span>\n ) : (\n <span\n style={{\n position: \"relative\",\n color: t.fgMuted,\n display: \"inline-flex\",\n alignItems: \"center\",\n }}\n >\n <span style={{ opacity: 0.55, display: \"inline-flex\" }}>\n <Caret\n width={11}\n height={22}\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n />\n </span>\n <span style={{ marginLeft: 6 }}>{placeholder}</span>\n </span>\n )}\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/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 ClaudeCodeProps {\n title?: string;\n userName?: string;\n model?: string;\n cwd?: string;\n placeholder?: string;\n prompt?: string;\n accentColor?: string;\n speed?: number;\n}\n\ninterface Theme {\n page: string;\n windowBar: string;\n windowBody: string;\n fg: string;\n fgMuted: string;\n fgDim: string;\n boxBorder: string;\n}\n\nexport const THEMES: Record<\"light\" | \"dark\", Theme> = {\n light: {\n page: \"#E8E5DD\",\n windowBar: \"#D8D3CA\",\n windowBody: \"#FBFAF7\",\n fg: \"#1F1E1D\",\n fgMuted: \"#73726C\",\n fgDim: \"#A3A097\",\n boxBorder: \"#D97757\",\n },\n dark: {\n page: \"#2B2A28\",\n windowBar: \"#3A3633\",\n windowBody: \"#1B1A18\",\n fg: \"#E8E5DD\",\n fgMuted: \"#8A857C\",\n fgDim: \"#6B6660\",\n boxBorder: \"#D97757\",\n },\n};\n\nexport const TYPING_START_FRAME = 48;\n\nexport const TYPING_CPS = 18;\n\nexport const WHATS_NEW: string[] = [\n \"/agents to create subagents\",\n \"/security-review for review agent\",\n \"ctrl+b to background bashes\",\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 Mascot({ accent, size = 96 }: { accent: string; size?: number }) {\n return (\n <svg\n height={size}\n viewBox=\"0 0 24 24\"\n width={size}\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <title>Claude Code</title>\n <path\n clipRule=\"evenodd\"\n d=\"M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z\"\n fill={accent}\n fillRule=\"evenodd\"\n />\n </svg>\n );\n}\n\nexport function ClaudeCode({\n title = \"Claude Code v2.0.0\",\n userName = \"Meaghan\",\n model = \"Opus 4.8 • Max 20x\",\n cwd = \"/users/meaghan/code/apps\",\n placeholder = 'Try \"edit <filepath> to ...\"',\n prompt = \"edit src/theme.ts to add a dark mode toggle\",\n accentColor = \"#D97757\",\n speed = 1,\n}: ClaudeCodeProps) {\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 showText = tw.count > 0;\n\n const intro = introBounceIn(frame * speed, fps);\n const leftFade = fadeUpAt(frame * speed, [6, 22]);\n const rightFade = fadeUpAt(frame * speed, [12, 30]);\n const promptFade = fadeUpAt(frame * speed, [18, 36]);\n\n const border = accentColor;\n\n const winLeft = 90;\n const winTop = 40;\n const winWidth = 1100;\n const winHeight = 620;\n const barHeight = 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: winLeft,\n top: winTop,\n width: winWidth,\n height: winHeight,\n background: t.windowBody,\n borderRadius: 12,\n overflow: \"hidden\",\n boxShadow: \"0 24px 60px -20px rgba(0,0,0,0.6)\",\n opacity: intro.scale,\n transform: `translateY(${intro.translateY}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 height: barHeight,\n background: t.windowBar,\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n paddingLeft: 16,\n flexShrink: 0,\n }}\n >\n <div\n style={{\n width: 12,\n height: 12,\n borderRadius: \"50%\",\n background: \"#FF5F57\",\n }}\n />\n <div\n style={{\n width: 12,\n height: 12,\n borderRadius: \"50%\",\n background: \"#FEBC2E\",\n }}\n />\n <div\n style={{\n width: 12,\n height: 12,\n borderRadius: \"50%\",\n background: \"#28C840\",\n }}\n />\n </div>\n\n <div\n style={{\n flex: 1,\n position: \"relative\",\n padding: 28,\n boxSizing: \"border-box\",\n display: \"flex\",\n flexDirection: \"column\",\n }}\n >\n <div\n style={{\n position: \"relative\",\n border: `1px dashed ${border}`,\n borderRadius: 6,\n padding: \"28px 24px 24px\",\n opacity: leftFade.opacity,\n transform: `translateY(${leftFade.translateY}px)`,\n }}\n >\n <span\n style={{\n position: \"absolute\",\n top: -11,\n left: 22,\n padding: \"0 10px\",\n background: t.windowBody,\n color: accentColor,\n fontFamily: MONO_FAMILY,\n fontSize: 16,\n fontWeight: 700,\n }}\n >\n {title}\n </span>\n\n <div style={{ display: \"flex\", flexDirection: \"row\" }}>\n <div\n style={{\n width: \"42%\",\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n gap: 16,\n paddingRight: 24,\n boxSizing: \"border-box\",\n }}\n >\n <div\n style={{\n fontFamily: MONO_FAMILY,\n fontSize: 20,\n color: t.fg,\n }}\n >\n Welcome back {userName}!\n </div>\n <div style={{ alignSelf: \"center\" }}>\n <Mascot accent={accentColor} />\n </div>\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 4,\n }}\n >\n <div\n style={{\n fontFamily: MONO_FAMILY,\n fontSize: 15,\n color: t.fgMuted,\n }}\n >\n {model}\n </div>\n <div\n style={{\n fontFamily: MONO_FAMILY,\n fontSize: 15,\n color: t.fgMuted,\n }}\n >\n {cwd}\n </div>\n </div>\n </div>\n\n <div\n style={{\n width: \"58%\",\n borderLeft: `1px dashed ${border}`,\n paddingLeft: 24,\n boxSizing: \"border-box\",\n display: \"flex\",\n flexDirection: \"column\",\n opacity: rightFade.opacity,\n transform: `translateY(${rightFade.translateY}px)`,\n }}\n >\n <div>\n <div\n style={{\n fontFamily: MONO_FAMILY,\n fontSize: 15,\n fontWeight: 700,\n color: accentColor,\n marginBottom: 10,\n }}\n >\n What's new\n </div>\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 6,\n }}\n >\n {WHATS_NEW.map((line) => (\n <div\n key={line}\n style={{\n fontFamily: MONO_FAMILY,\n fontSize: 14,\n color: t.fg,\n }}\n >\n {line}\n </div>\n ))}\n <div\n style={{\n fontFamily: MONO_FAMILY,\n fontSize: 14,\n color: t.fgDim,\n }}\n >\n ... /help for more\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div style={{ height: 32 }} />\n\n <div\n style={{\n opacity: promptFade.opacity,\n transform: `translateY(${promptFade.translateY}px)`,\n }}\n >\n <div\n style={{\n height: 1,\n background: t.fgDim,\n opacity: 0.4,\n marginBottom: 16,\n }}\n />\n <div\n style={{\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n fontFamily: MONO_FAMILY,\n fontSize: 17,\n whiteSpace: \"pre\",\n }}\n >\n <span style={{ color: t.fgMuted }}>{\"> \"}</span>\n {showText ? (\n <span\n style={{\n position: \"relative\",\n color: t.fg,\n display: \"inline-flex\",\n alignItems: \"center\",\n }}\n >\n {tw.text}\n <span style={{ opacity: 0.55, display: \"inline-flex\" }}>\n <Caret\n width={11}\n height={22}\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n marginLeft={2}\n />\n </span>\n </span>\n ) : (\n <span\n style={{\n position: \"relative\",\n color: t.fgMuted,\n display: \"inline-flex\",\n alignItems: \"center\",\n }}\n >\n <span style={{ opacity: 0.55, display: \"inline-flex\" }}>\n <Caret\n width={11}\n height={22}\n color={t.fg}\n blink={!tw.typing}\n speed={speed}\n />\n </span>\n <span style={{ marginLeft: 6 }}>{placeholder}</span>\n </span>\n )}\n </div>\n </div>\n </div>\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/claude-code.tsx"
}
diff --git a/public/r/code-accordion.json b/public/r/code-accordion.json
index 9f5b237d..e830f598 100644
--- a/public/r/code-accordion.json
+++ b/public/r/code-accordion.json
@@ -9,7 +9,7 @@
"files": [
{
"path": "registry/remocn/code-accordion/index.tsx",
- "content": "\"use client\";\n\nimport { interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface CodeAccordionProps {\n lines?: string[];\n collapseRange?: [number, number];\n collapseAt?: number;\n title?: string;\n fontSize?: number;\n width?: number;\n background?: string;\n cardColor?: string;\n textColor?: string;\n mutedColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_MONO =\n \"var(--font-geist-mono), ui-monospace, SFMono-Regular, monospace\";\n\nconst DEFAULT_LINES = [\n \"export function processOrders(orders) {\",\n \" const valid = [];\",\n \" for (const order of orders) {\",\n \" if (!order.id) continue;\",\n \" if (!order.customer) continue;\",\n \" if (!order.items?.length) continue;\",\n \" if (order.total <= 0) continue;\",\n \" if (order.status === 'cancelled') continue;\",\n \" if (order.status === 'refunded') continue;\",\n \" const enriched = enrich(order);\",\n \" const validated = validate(enriched);\",\n \" if (!validated.ok) continue;\",\n \" const priced = price(validated.value);\",\n \" const taxed = applyTax(priced);\",\n \" const shipped = applyShipping(taxed);\",\n \" valid.push(shipped);\",\n \" }\",\n \" return valid;\",\n \"}\",\n];\n\nexport function CodeAccordion({\n lines = DEFAULT_LINES,\n collapseRange = [3, 14],\n collapseAt = 30,\n title = \"process-orders.ts\",\n fontSize = 16,\n width = 720,\n background = \"#050505\",\n cardColor = \"#0a0a0a\",\n textColor = \"#e4e4e7\",\n mutedColor = \"#52525b\",\n speed = 1,\n className,\n}: CodeAccordionProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const lineHeight = Math.round(fontSize * 1.55);\n const [start, end] = collapseRange;\n const collapsedCount = Math.max(0, end - start + 1);\n\n // Spring drives BOTH the inner collapse height AND a tiny y-bounce on the\n // window so the accordion feels like it has weight.\n const collapseProgress = spring({\n frame: frame - collapseAt,\n fps,\n config: { damping: 10, stiffness: 110, mass: 1 },\n });\n\n const collapsedHeight = interpolate(\n collapseProgress,\n [0, 1],\n [collapsedCount * lineHeight, lineHeight], // collapses down to the placeholder bar's height\n );\n\n const collapsedOpacity = interpolate(collapseProgress, [0, 0.6], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const placeholderOpacity = interpolate(collapseProgress, [0.4, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const before = lines.slice(0, start);\n const collapsed = lines.slice(start, end + 1);\n const after = lines.slice(end + 1);\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontFamily: FONT_MONO,\n }}\n >\n <div\n style={{\n width,\n background: cardColor,\n borderRadius: 14,\n overflow: \"hidden\",\n boxShadow:\n \"0 30px 80px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.05)\",\n border: \"1px solid rgba(255,255,255,0.06)\",\n }}\n >\n {/* Chrome */}\n <div\n style={{\n height: 38,\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n padding: \"0 14px\",\n borderBottom: \"1px solid rgba(255,255,255,0.05)\",\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: mutedColor,\n fontSize: 12,\n }}\n >\n {title}\n </div>\n </div>\n\n {/* Code body */}\n <div style={{ padding: \"16px 0\", fontSize, lineHeight: 1.55 }}>\n {before.map((line, i) => (\n <Line\n key={`b-${i}`}\n line={line}\n index={i}\n lineHeight={lineHeight}\n textColor={textColor}\n mutedColor={mutedColor}\n />\n ))}\n\n {/* Collapsing region */}\n <div\n style={{\n position: \"relative\",\n height: collapsedHeight,\n overflow: \"hidden\",\n transition: \"none\",\n }}\n >\n <div style={{ opacity: collapsedOpacity }}>\n {collapsed.map((line, i) => (\n <Line\n key={`c-${i}`}\n line={line}\n index={start + i}\n lineHeight={lineHeight}\n textColor={textColor}\n mutedColor={mutedColor}\n />\n ))}\n </div>\n\n {/* Placeholder bar — sits at the bottom so it sits on the same\n baseline as the collapsed-into row. */}\n <div\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n bottom: 0,\n height: lineHeight,\n display: \"flex\",\n alignItems: \"center\",\n paddingLeft: 56,\n color: mutedColor,\n fontStyle: \"italic\",\n opacity: placeholderOpacity,\n }}\n >\n ⋯ {collapsedCount} lines collapsed\n </div>\n </div>\n\n {after.map((line, i) => (\n <Line\n key={`a-${i}`}\n line={line}\n index={end + 1 + i}\n lineHeight={lineHeight}\n textColor={textColor}\n mutedColor={mutedColor}\n />\n ))}\n </div>\n </div>\n </div>\n );\n}\n\nfunction Light({ color }: { color: string }) {\n return (\n <div\n style={{\n width: 11,\n height: 11,\n borderRadius: \"50%\",\n background: color,\n opacity: 0.6,\n }}\n />\n );\n}\n\nfunction Line({\n line,\n index,\n lineHeight,\n textColor,\n mutedColor,\n}: {\n line: string;\n index: number;\n lineHeight: number;\n textColor: string;\n mutedColor: string;\n}) {\n return (\n <div\n style={{\n height: lineHeight,\n display: \"flex\",\n alignItems: \"center\",\n whiteSpace: \"pre\",\n color: textColor,\n }}\n >\n <span\n style={{\n width: 56,\n textAlign: \"right\",\n paddingRight: 16,\n color: mutedColor,\n userSelect: \"none\",\n }}\n >\n {index + 1}\n </span>\n <span>{line}</span>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface CodeAccordionProps {\n lines?: string[];\n collapseRange?: [number, number];\n collapseAt?: number;\n title?: string;\n fontSize?: number;\n width?: number;\n cardColor?: string;\n textColor?: string;\n mutedColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_MONO =\n \"var(--font-geist-mono), ui-monospace, SFMono-Regular, monospace\";\n\nconst DEFAULT_LINES = [\n \"export function processOrders(orders) {\",\n \" const valid = [];\",\n \" for (const order of orders) {\",\n \" if (!order.id) continue;\",\n \" if (!order.customer) continue;\",\n \" if (!order.items?.length) continue;\",\n \" if (order.total <= 0) continue;\",\n \" if (order.status === 'cancelled') continue;\",\n \" if (order.status === 'refunded') continue;\",\n \" const enriched = enrich(order);\",\n \" const validated = validate(enriched);\",\n \" if (!validated.ok) continue;\",\n \" const priced = price(validated.value);\",\n \" const taxed = applyTax(priced);\",\n \" const shipped = applyShipping(taxed);\",\n \" valid.push(shipped);\",\n \" }\",\n \" return valid;\",\n \"}\",\n];\n\nexport function CodeAccordion({\n lines = DEFAULT_LINES,\n collapseRange = [3, 14],\n collapseAt = 30,\n title = \"process-orders.ts\",\n fontSize = 16,\n width = 720,\n cardColor = \"#0a0a0a\",\n textColor = \"#e4e4e7\",\n mutedColor = \"#52525b\",\n speed = 1,\n className,\n}: CodeAccordionProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const lineHeight = Math.round(fontSize * 1.55);\n const [start, end] = collapseRange;\n const collapsedCount = Math.max(0, end - start + 1);\n\n // Spring drives BOTH the inner collapse height AND a tiny y-bounce on the\n // window so the accordion feels like it has weight.\n const collapseProgress = spring({\n frame: frame - collapseAt,\n fps,\n config: { damping: 10, stiffness: 110, mass: 1 },\n });\n\n const collapsedHeight = interpolate(\n collapseProgress,\n [0, 1],\n [collapsedCount * lineHeight, lineHeight], // collapses down to the placeholder bar's height\n );\n\n const collapsedOpacity = interpolate(collapseProgress, [0, 0.6], [1, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const placeholderOpacity = interpolate(collapseProgress, [0.4, 1], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const before = lines.slice(0, start);\n const collapsed = lines.slice(start, end + 1);\n const after = lines.slice(end + 1);\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: FONT_MONO,\n }}\n >\n <div\n style={{\n width,\n background: cardColor,\n borderRadius: 14,\n overflow: \"hidden\",\n boxShadow:\n \"0 30px 80px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.05)\",\n border: \"1px solid rgba(255,255,255,0.06)\",\n }}\n >\n {/* Chrome */}\n <div\n style={{\n height: 38,\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n padding: \"0 14px\",\n borderBottom: \"1px solid rgba(255,255,255,0.05)\",\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: mutedColor,\n fontSize: 12,\n }}\n >\n {title}\n </div>\n </div>\n\n {/* Code body */}\n <div style={{ padding: \"16px 0\", fontSize, lineHeight: 1.55 }}>\n {before.map((line, i) => (\n <Line\n key={`b-${i}`}\n line={line}\n index={i}\n lineHeight={lineHeight}\n textColor={textColor}\n mutedColor={mutedColor}\n />\n ))}\n\n {/* Collapsing region */}\n <div\n style={{\n position: \"relative\",\n height: collapsedHeight,\n overflow: \"hidden\",\n transition: \"none\",\n }}\n >\n <div style={{ opacity: collapsedOpacity }}>\n {collapsed.map((line, i) => (\n <Line\n key={`c-${i}`}\n line={line}\n index={start + i}\n lineHeight={lineHeight}\n textColor={textColor}\n mutedColor={mutedColor}\n />\n ))}\n </div>\n\n {/* Placeholder bar — sits at the bottom so it sits on the same\n baseline as the collapsed-into row. */}\n <div\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n bottom: 0,\n height: lineHeight,\n display: \"flex\",\n alignItems: \"center\",\n paddingLeft: 56,\n color: mutedColor,\n fontStyle: \"italic\",\n opacity: placeholderOpacity,\n }}\n >\n ⋯ {collapsedCount} lines collapsed\n </div>\n </div>\n\n {after.map((line, i) => (\n <Line\n key={`a-${i}`}\n line={line}\n index={end + 1 + i}\n lineHeight={lineHeight}\n textColor={textColor}\n mutedColor={mutedColor}\n />\n ))}\n </div>\n </div>\n </div>\n );\n}\n\nfunction Light({ color }: { color: string }) {\n return (\n <div\n style={{\n width: 11,\n height: 11,\n borderRadius: \"50%\",\n background: color,\n opacity: 0.6,\n }}\n />\n );\n}\n\nfunction Line({\n line,\n index,\n lineHeight,\n textColor,\n mutedColor,\n}: {\n line: string;\n index: number;\n lineHeight: number;\n textColor: string;\n mutedColor: string;\n}) {\n return (\n <div\n style={{\n height: lineHeight,\n display: \"flex\",\n alignItems: \"center\",\n whiteSpace: \"pre\",\n color: textColor,\n }}\n >\n <span\n style={{\n width: 56,\n textAlign: \"right\",\n paddingRight: 16,\n color: mutedColor,\n userSelect: \"none\",\n }}\n >\n {index + 1}\n </span>\n <span>{line}</span>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/code-accordion.tsx"
}
diff --git a/public/r/combobox.json b/public/r/combobox.json
index 32c070dd..88f0584c 100644
--- a/public/r/combobox.json
+++ b/public/r/combobox.json
@@ -14,7 +14,7 @@
"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 mode?: \"light\" | \"dark\";\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 mode,\n className,\n}: ComboboxProps) {\n const theme = useRemocnTheme(themeOverride, mode);\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: theme.background,\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 { 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",
"type": "registry:component",
"target": "components/remocn/combobox.tsx"
},
diff --git a/public/r/command-menu-item.json b/public/r/command-menu-item.json
index 3354fb8c..27c82fb5 100644
--- a/public/r/command-menu-item.json
+++ b/public/r/command-menu-item.json
@@ -12,7 +12,7 @@
"files": [
{
"path": "registry/remocn-ui/command-menu-item/index.tsx",
- "content": "\"use client\";\n\nimport { mixOklch, type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type CommandMenuItemState = \"idle\" | \"hover\" | \"press\" | \"selected\";\n\nexport interface CommandMenuItemProps {\n state?: CommandMenuItemState;\n style?: CommandMenuItemStyle;\n label?: string;\n icon?: CommandMenuIcon;\n shortcut?: string;\n width?: number;\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n className?: string;\n}\n\nexport type CommandMenuIcon = \"search\" | \"settings\" | \"user\" | \"file\";\n\nconst ROW_WIDTH = 360;\n\nexport interface CommandMenuItemStyle {\n background: string;\n labelColor: string;\n iconColor: string;\n scale: number;\n}\n\nexport interface CommandMenuItemStyleContext {\n idleBg: string;\n hoverBg: string;\n pressBg: string;\n selectedBg: string;\n idleFg: string;\n selectedFg: string;\n idleIcon: string;\n selectedIcon: string;\n kbdBg: string;\n kbdFg: string;\n kbdBorder: string;\n}\n\nexport function commandMenuItemStyleContext(\n theme: RemocnTheme,\n): CommandMenuItemStyleContext {\n return {\n idleBg: theme.popover,\n hoverBg: theme.accent,\n pressBg: mixOklch(theme.accent, theme.foreground, 0.08),\n selectedBg: theme.accent,\n idleFg: theme.popoverForeground,\n selectedFg: theme.accentForeground,\n idleIcon: theme.mutedForeground,\n selectedIcon: theme.foreground,\n kbdBg: theme.muted,\n kbdFg: theme.mutedForeground,\n kbdBorder: theme.border,\n };\n}\n\nexport function commandMenuItemStyle(\n state: CommandMenuItemState,\n ctx: CommandMenuItemStyleContext,\n): CommandMenuItemStyle {\n switch (state) {\n case \"hover\":\n return {\n background: ctx.hoverBg,\n labelColor: ctx.idleFg,\n iconColor: ctx.selectedIcon,\n scale: 1,\n };\n case \"press\":\n return {\n background: ctx.pressBg,\n labelColor: ctx.idleFg,\n iconColor: ctx.selectedIcon,\n scale: 0.98,\n };\n case \"selected\":\n return {\n background: ctx.selectedBg,\n labelColor: ctx.selectedFg,\n iconColor: ctx.selectedIcon,\n scale: 1,\n };\n default:\n return {\n background: ctx.idleBg,\n labelColor: ctx.idleFg,\n iconColor: ctx.idleIcon,\n scale: 1,\n };\n }\n}\n\nconst ICON_PATHS: Record<CommandMenuIcon, string> = {\n search: \"M11 4a7 7 0 1 0 0 14 7 7 0 0 0 0-14ZM20 20l-3.5-3.5\",\n settings:\n \"M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6ZM12 2v3 M12 19v3 M4.2 4.2l2.1 2.1 M17.7 17.7l2.1 2.1 M2 12h3 M19 12h3 M4.2 19.8l2.1-2.1 M17.7 6.3l2.1-2.1\",\n user: \"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8ZM5 20a7 7 0 0 1 14 0\",\n file: \"M7 3h7l4 4v14H7ZM14 3v4h4\",\n};\n\nfunction CommandMenuItemIcon({\n icon,\n color,\n}: {\n icon: CommandMenuIcon;\n color: string;\n}) {\n return (\n <svg width={16} height={16} viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d={ICON_PATHS[icon]}\n stroke={color}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nexport interface CommandMenuItemRowProps {\n style?: CommandMenuItemStyle;\n state?: CommandMenuItemState;\n ctx: CommandMenuItemStyleContext;\n label: string;\n icon?: CommandMenuIcon;\n shortcut?: string;\n width: number;\n radius: number;\n}\n\nexport function CommandMenuItemRow({\n style,\n state = \"idle\",\n ctx,\n label,\n icon,\n shortcut,\n width,\n radius,\n}: CommandMenuItemRowProps) {\n const v = style ?? commandMenuItemStyle(state, ctx);\n return (\n <div\n style={{\n width,\n boxSizing: \"border-box\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n gap: 12,\n padding: \"8px 12px\",\n borderRadius: radius,\n transform: `scale(${v.scale})`,\n background: v.background,\n color: v.labelColor,\n fontSize: 14,\n letterSpacing: \"-0.01em\",\n }}\n >\n <span\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n minWidth: 0,\n }}\n >\n {icon !== undefined && (\n <span style={{ display: \"flex\", flexShrink: 0 }}>\n <CommandMenuItemIcon icon={icon} color={v.iconColor} />\n </span>\n )}\n <span\n style={{\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }}\n >\n {label}\n </span>\n </span>\n {shortcut !== undefined && (\n <kbd\n style={{\n flexShrink: 0,\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 2,\n height: 20,\n padding: \"0 6px\",\n fontSize: 12,\n fontFamily: \"inherit\",\n letterSpacing: \"0.05em\",\n color: ctx.kbdFg,\n background: ctx.kbdBg,\n border: `1px solid ${ctx.kbdBorder}`,\n borderRadius: Math.max(4, radius - 4),\n }}\n >\n {shortcut}\n </kbd>\n )}\n </div>\n );\n}\n\nexport function CommandMenuItem({\n state = \"idle\",\n style,\n label = \"Settings\",\n icon = \"settings\",\n shortcut,\n width = ROW_WIDTH,\n theme: themeOverride,\n mode,\n className,\n}: CommandMenuItemProps) {\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = commandMenuItemStyleContext(theme);\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: theme.background,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <CommandMenuItemRow\n style={style}\n state={state}\n ctx={ctx}\n label={label}\n icon={icon}\n shortcut={shortcut}\n width={width}\n radius={theme.radius}\n />\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { mixOklch, type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type CommandMenuItemState = \"idle\" | \"hover\" | \"press\" | \"selected\";\n\nexport interface CommandMenuItemProps {\n state?: CommandMenuItemState;\n style?: CommandMenuItemStyle;\n label?: string;\n icon?: CommandMenuIcon;\n shortcut?: string;\n width?: number;\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nexport type CommandMenuIcon = \"search\" | \"settings\" | \"user\" | \"file\";\n\nconst ROW_WIDTH = 360;\n\nexport interface CommandMenuItemStyle {\n background: string;\n labelColor: string;\n iconColor: string;\n scale: number;\n}\n\nexport interface CommandMenuItemStyleContext {\n idleBg: string;\n hoverBg: string;\n pressBg: string;\n selectedBg: string;\n idleFg: string;\n selectedFg: string;\n idleIcon: string;\n selectedIcon: string;\n kbdBg: string;\n kbdFg: string;\n kbdBorder: string;\n}\n\nexport function commandMenuItemStyleContext(\n theme: RemocnTheme,\n): CommandMenuItemStyleContext {\n return {\n idleBg: theme.popover,\n hoverBg: theme.accent,\n pressBg: mixOklch(theme.accent, theme.foreground, 0.08),\n selectedBg: theme.accent,\n idleFg: theme.popoverForeground,\n selectedFg: theme.accentForeground,\n idleIcon: theme.mutedForeground,\n selectedIcon: theme.foreground,\n kbdBg: theme.muted,\n kbdFg: theme.mutedForeground,\n kbdBorder: theme.border,\n };\n}\n\nexport function commandMenuItemStyle(\n state: CommandMenuItemState,\n ctx: CommandMenuItemStyleContext,\n): CommandMenuItemStyle {\n switch (state) {\n case \"hover\":\n return {\n background: ctx.hoverBg,\n labelColor: ctx.idleFg,\n iconColor: ctx.selectedIcon,\n scale: 1,\n };\n case \"press\":\n return {\n background: ctx.pressBg,\n labelColor: ctx.idleFg,\n iconColor: ctx.selectedIcon,\n scale: 0.98,\n };\n case \"selected\":\n return {\n background: ctx.selectedBg,\n labelColor: ctx.selectedFg,\n iconColor: ctx.selectedIcon,\n scale: 1,\n };\n default:\n return {\n background: ctx.idleBg,\n labelColor: ctx.idleFg,\n iconColor: ctx.idleIcon,\n scale: 1,\n };\n }\n}\n\nconst ICON_PATHS: Record<CommandMenuIcon, string> = {\n search: \"M11 4a7 7 0 1 0 0 14 7 7 0 0 0 0-14ZM20 20l-3.5-3.5\",\n settings:\n \"M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6ZM12 2v3 M12 19v3 M4.2 4.2l2.1 2.1 M17.7 17.7l2.1 2.1 M2 12h3 M19 12h3 M4.2 19.8l2.1-2.1 M17.7 6.3l2.1-2.1\",\n user: \"M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8ZM5 20a7 7 0 0 1 14 0\",\n file: \"M7 3h7l4 4v14H7ZM14 3v4h4\",\n};\n\nfunction CommandMenuItemIcon({\n icon,\n color,\n}: {\n icon: CommandMenuIcon;\n color: string;\n}) {\n return (\n <svg width={16} height={16} viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d={ICON_PATHS[icon]}\n stroke={color}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n}\n\nexport interface CommandMenuItemRowProps {\n style?: CommandMenuItemStyle;\n state?: CommandMenuItemState;\n ctx: CommandMenuItemStyleContext;\n label: string;\n icon?: CommandMenuIcon;\n shortcut?: string;\n width: number;\n radius: number;\n}\n\nexport function CommandMenuItemRow({\n style,\n state = \"idle\",\n ctx,\n label,\n icon,\n shortcut,\n width,\n radius,\n}: CommandMenuItemRowProps) {\n const v = style ?? commandMenuItemStyle(state, ctx);\n return (\n <div\n style={{\n width,\n boxSizing: \"border-box\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n gap: 12,\n padding: \"8px 12px\",\n borderRadius: radius,\n transform: `scale(${v.scale})`,\n background: v.background,\n color: v.labelColor,\n fontSize: 14,\n letterSpacing: \"-0.01em\",\n }}\n >\n <span\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n minWidth: 0,\n }}\n >\n {icon !== undefined && (\n <span style={{ display: \"flex\", flexShrink: 0 }}>\n <CommandMenuItemIcon icon={icon} color={v.iconColor} />\n </span>\n )}\n <span\n style={{\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }}\n >\n {label}\n </span>\n </span>\n {shortcut !== undefined && (\n <kbd\n style={{\n flexShrink: 0,\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 2,\n height: 20,\n padding: \"0 6px\",\n fontSize: 12,\n fontFamily: \"inherit\",\n letterSpacing: \"0.05em\",\n color: ctx.kbdFg,\n background: ctx.kbdBg,\n border: `1px solid ${ctx.kbdBorder}`,\n borderRadius: Math.max(4, radius - 4),\n }}\n >\n {shortcut}\n </kbd>\n )}\n </div>\n );\n}\n\nexport function CommandMenuItem({\n state = \"idle\",\n style,\n label = \"Settings\",\n icon = \"settings\",\n shortcut,\n width = ROW_WIDTH,\n theme: themeOverride,\n className,\n}: CommandMenuItemProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const ctx = commandMenuItemStyleContext(theme);\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 <CommandMenuItemRow\n style={style}\n state={state}\n ctx={ctx}\n label={label}\n icon={icon}\n shortcut={shortcut}\n width={width}\n radius={theme.radius}\n />\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/command-menu-item.tsx"
},
diff --git a/public/r/command-menu.json b/public/r/command-menu.json
index 86347e6f..a21cbe2d 100644
--- a/public/r/command-menu.json
+++ b/public/r/command-menu.json
@@ -13,7 +13,7 @@
"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 mode?: \"light\" | \"dark\";\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 mode,\n className,\n}: CommandMenuProps) {\n const theme = useRemocnTheme(themeOverride, mode);\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 { 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",
"type": "registry:component",
"target": "components/remocn/command-menu.tsx"
},
diff --git a/public/r/context-menu.json b/public/r/context-menu.json
index 866d8f5d..70d3128b 100644
--- a/public/r/context-menu.json
+++ b/public/r/context-menu.json
@@ -13,7 +13,7 @@
"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 mode?: \"light\" | \"dark\";\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 mode,\n className,\n}: ContextMenuProps) {\n const theme = useRemocnTheme(themeOverride, mode);\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 mode={mode}\n />\n );\n })}\n </div>\n );\n}\n",
+ "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",
"type": "registry:component",
"target": "components/remocn/context-menu.tsx"
},
diff --git a/public/r/cursor.json b/public/r/cursor.json
index f1c846ce..d2005862 100644
--- a/public/r/cursor.json
+++ b/public/r/cursor.json
@@ -12,7 +12,7 @@
"files": [
{
"path": "registry/remocn-ui/cursor/index.tsx",
- "content": "\"use client\";\n\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type CursorVariant = \"arrow\" | \"pointer\";\n\nexport interface CursorStyle {\n x: number;\n y: number;\n scale: number;\n rippleOpacity: number;\n rippleScale: number;\n pressScale?: number;\n}\n\nexport interface CursorProps {\n style?: CursorStyle;\n variant?: CursorVariant;\n size?: number;\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n rippleColor?: string;\n className?: string;\n}\n\nconst REST: CursorStyle = {\n x: 0,\n y: 0,\n scale: 1,\n rippleOpacity: 0,\n rippleScale: 0,\n};\n\nconst ARROW_PATH =\n \"M1 1 L1 18.5 L5.6 14.4 L8.7 21.6 L11.6 20.4 L8.5 13.2 L14.5 13.2 Z\";\nconst POINTER_PATH =\n \"M8 2.2 C8 1.3 8.7 0.7 9.5 0.7 C10.3 0.7 11 1.3 11 2.2 L11 9 \" +\n \"C11 9 11.3 8.4 12.2 8.4 C13 8.4 13.4 9 13.4 9.6 \" +\n \"C13.4 9.6 13.9 9.1 14.7 9.1 C15.5 9.1 15.9 9.7 15.9 10.3 \" +\n \"C15.9 10.3 16.4 9.9 17.1 9.9 C17.9 9.9 18.3 10.5 18.3 11.2 \" +\n \"L18.3 16.8 C18.3 19.8 16.3 22.3 12.8 22.3 L11.4 22.3 \" +\n \"C9 22.3 7.9 21.2 6.6 19.2 L4 15.2 C3.5 14.4 3.7 13.4 4.5 12.9 \" +\n \"C5.1 12.5 5.9 12.6 6.4 13.2 L8 15 Z\";\n\nexport function Cursor({\n style,\n variant = \"arrow\",\n size = 28,\n theme: themeOverride,\n mode,\n rippleColor,\n className,\n}: CursorProps) {\n const theme = useRemocnTheme(themeOverride, mode);\n const v = style ?? REST;\n\n const press = v.pressScale ?? 1;\n const pressedScale = v.scale * (0.9 + 0.1 * press);\n\n const ring = rippleColor ?? theme.primary;\n const fill = theme.foreground;\n const stroke = theme.background;\n const rippleSize = size * 1.8;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n transform: `translate(${v.x}px, ${v.y}px)`,\n pointerEvents: \"none\",\n }}\n >\n {}\n <div\n style={{\n position: \"absolute\",\n left: -rippleSize / 2,\n top: -rippleSize / 2,\n width: rippleSize,\n height: rippleSize,\n borderRadius: \"50%\",\n border: `2px solid ${ring}`,\n opacity: v.rippleOpacity,\n transform: `scale(${v.rippleScale})`,\n transformOrigin: \"center\",\n }}\n />\n {}\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n transform: `scale(${pressedScale})`,\n transformOrigin: \"0 0\",\n filter: \"drop-shadow(0 1px 2px rgba(0,0,0,0.3))\",\n overflow: \"visible\",\n }}\n >\n <path\n d={variant === \"pointer\" ? POINTER_PATH : ARROW_PATH}\n fill={fill}\n stroke={stroke}\n strokeWidth={1.4}\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type CursorVariant = \"arrow\" | \"pointer\";\n\nexport interface CursorStyle {\n x: number;\n y: number;\n scale: number;\n rippleOpacity: number;\n rippleScale: number;\n pressScale?: number;\n}\n\nexport interface CursorProps {\n style?: CursorStyle;\n variant?: CursorVariant;\n size?: number;\n theme?: Partial<RemocnTheme>;\n rippleColor?: string;\n className?: string;\n}\n\nconst REST: CursorStyle = {\n x: 0,\n y: 0,\n scale: 1,\n rippleOpacity: 0,\n rippleScale: 0,\n};\n\nconst ARROW_PATH =\n \"M1 1 L1 18.5 L5.6 14.4 L8.7 21.6 L11.6 20.4 L8.5 13.2 L14.5 13.2 Z\";\nconst POINTER_PATH =\n \"M8 2.2 C8 1.3 8.7 0.7 9.5 0.7 C10.3 0.7 11 1.3 11 2.2 L11 9 \" +\n \"C11 9 11.3 8.4 12.2 8.4 C13 8.4 13.4 9 13.4 9.6 \" +\n \"C13.4 9.6 13.9 9.1 14.7 9.1 C15.5 9.1 15.9 9.7 15.9 10.3 \" +\n \"C15.9 10.3 16.4 9.9 17.1 9.9 C17.9 9.9 18.3 10.5 18.3 11.2 \" +\n \"L18.3 16.8 C18.3 19.8 16.3 22.3 12.8 22.3 L11.4 22.3 \" +\n \"C9 22.3 7.9 21.2 6.6 19.2 L4 15.2 C3.5 14.4 3.7 13.4 4.5 12.9 \" +\n \"C5.1 12.5 5.9 12.6 6.4 13.2 L8 15 Z\";\n\nexport function Cursor({\n style,\n variant = \"arrow\",\n size = 28,\n theme: themeOverride,\n rippleColor,\n className,\n}: CursorProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const v = style ?? REST;\n\n const press = v.pressScale ?? 1;\n const pressedScale = v.scale * (0.9 + 0.1 * press);\n\n const ring = rippleColor ?? theme.primary;\n const fill = theme.foreground;\n const stroke = theme.background;\n const rippleSize = size * 1.8;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n transform: `translate(${v.x}px, ${v.y}px)`,\n pointerEvents: \"none\",\n }}\n >\n {}\n <div\n style={{\n position: \"absolute\",\n left: -rippleSize / 2,\n top: -rippleSize / 2,\n width: rippleSize,\n height: rippleSize,\n borderRadius: \"50%\",\n border: `2px solid ${ring}`,\n opacity: v.rippleOpacity,\n transform: `scale(${v.rippleScale})`,\n transformOrigin: \"center\",\n }}\n />\n {}\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n transform: `scale(${pressedScale})`,\n transformOrigin: \"0 0\",\n filter: \"drop-shadow(0 1px 2px rgba(0,0,0,0.3))\",\n overflow: \"visible\",\n }}\n >\n <path\n d={variant === \"pointer\" ? POINTER_PATH : ARROW_PATH}\n fill={fill}\n stroke={stroke}\n strokeWidth={1.4}\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/cursor.tsx"
},
diff --git a/public/r/dashboard-populate.json b/public/r/dashboard-populate.json
index e847a504..4aa88da9 100644
--- a/public/r/dashboard-populate.json
+++ b/public/r/dashboard-populate.json
@@ -9,7 +9,7 @@
"files": [
{
"path": "registry/remocn/dashboard-populate/index.tsx",
- "content": "\"use client\";\n\nimport { interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface DashboardPopulateProps {\n accentColor?: string;\n kpiTarget?: number;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\nconst MONO_FAMILY =\n \"var(--font-geist-mono), ui-monospace, SFMono-Regular, Menlo, monospace\";\n\nconst STRUCTURE_END = 15;\n\nfunction formatNumber(n: number) {\n return n.toLocaleString(\"en-US\");\n}\n\nconst BAR_VALUES = [0.55, 0.78, 0.42, 0.92, 0.66];\n\n// Hand-coded line chart points (in 0..100 viewBox space)\nconst LINE_POINTS: Array<[number, number]> = [\n [0, 70],\n [16, 55],\n [32, 62],\n [48, 38],\n [64, 45],\n [80, 22],\n [100, 12],\n];\n\nfunction buildLinePath() {\n return LINE_POINTS.map(([x, y], i) => `${i === 0 ? \"M\" : \"L\"}${x},${y}`).join(\n \" \",\n );\n}\n\nfunction Tile({\n title,\n children,\n structureOpacity,\n}: {\n title: string;\n children: React.ReactNode;\n structureOpacity: number;\n}) {\n return (\n <div\n style={{\n position: \"relative\",\n background: \"linear-gradient(180deg, #131316 0%, #0d0d10 100%)\",\n border: \"1px solid rgba(255,255,255,0.08)\",\n borderRadius: 16,\n padding: 24,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 16,\n opacity: structureOpacity,\n boxShadow:\n \"inset 0 1px 0 rgba(255,255,255,0.04), 0 20px 40px rgba(0,0,0,0.3)\",\n }}\n >\n <div\n style={{\n fontSize: 12,\n fontWeight: 500,\n textTransform: \"uppercase\",\n letterSpacing: \"0.08em\",\n color: \"rgba(255,255,255,0.5)\",\n }}\n >\n {title}\n </div>\n <div style={{ flex: 1, position: \"relative\" }}>{children}</div>\n </div>\n );\n}\n\nexport function DashboardPopulate({\n accentColor = \"#22c55e\",\n kpiTarget = 128400,\n speed = 1,\n className,\n}: DashboardPopulateProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n // Phase 1: structure fade in 0..15\n const structureOpacity = interpolate(frame, [0, STRUCTURE_END], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n // KPI count up\n const kpiSpring = spring({\n frame: frame - STRUCTURE_END,\n fps,\n config: { damping: 20, stiffness: 80, mass: 1 },\n durationInFrames: 60,\n });\n const kpiValue = Math.floor(kpiSpring * kpiTarget);\n const kpiDelta = interpolate(kpiSpring, [0, 1], [0, 12.4]);\n\n // Bar chart springs (staggered)\n const barProgress = BAR_VALUES.map((_, i) =>\n spring({\n frame: frame - STRUCTURE_END - i * 4,\n fps,\n config: { damping: 11, stiffness: 140, mass: 1 },\n durationInFrames: 40,\n }),\n );\n\n // Line chart stroke-dashoffset\n const linePath = buildLinePath();\n // approx length for viewBox 100x100 — use a generous constant; we set\n // pathLength on the path so dashoffset works in normalized units\n const lineProgress = interpolate(\n frame,\n [STRUCTURE_END + 4, STRUCTURE_END + 50],\n [0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n // Donut\n const donutTarget = 0.72;\n const donutSpring = spring({\n frame: frame - STRUCTURE_END - 6,\n fps,\n config: { damping: 13, stiffness: 110, mass: 1 },\n durationInFrames: 50,\n });\n const donutValue = donutSpring * donutTarget;\n const donutR = 70;\n const donutCircum = 2 * Math.PI * donutR;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"#09090b\",\n fontFamily: FONT_FAMILY,\n color: \"white\",\n padding: 64,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 24,\n overflow: \"hidden\",\n }}\n >\n {/* Subtle grid bg */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n backgroundImage:\n \"linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px)\",\n backgroundSize: \"48px 48px\",\n }}\n />\n <div\n style={{\n position: \"relative\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n opacity: structureOpacity,\n }}\n >\n <div>\n <div\n style={{\n fontSize: 28,\n fontWeight: 600,\n letterSpacing: \"-0.02em\",\n }}\n >\n Overview\n </div>\n <div\n style={{\n fontSize: 14,\n opacity: 0.5,\n marginTop: 4,\n }}\n >\n Last 30 days\n </div>\n </div>\n <div\n style={{\n display: \"flex\",\n gap: 8,\n fontSize: 12,\n fontFamily: MONO_FAMILY,\n }}\n >\n {[\"1D\", \"7D\", \"30D\", \"ALL\"].map((l, i) => (\n <div\n key={l}\n style={{\n padding: \"6px 12px\",\n borderRadius: 8,\n background:\n i === 2 ? \"rgba(255,255,255,0.1)\" : \"rgba(255,255,255,0.03)\",\n border: \"1px solid rgba(255,255,255,0.06)\",\n }}\n >\n {l}\n </div>\n ))}\n </div>\n </div>\n\n <div\n style={{\n position: \"relative\",\n flex: 1,\n display: \"grid\",\n gridTemplateColumns: \"1fr 1fr\",\n gridTemplateRows: \"1fr 1fr\",\n gap: 24,\n }}\n >\n {/* KPI */}\n <Tile title=\"Revenue\" structureOpacity={structureOpacity}>\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 12,\n height: \"100%\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n fontSize: 64,\n fontWeight: 700,\n letterSpacing: \"-0.04em\",\n fontVariantNumeric: \"tabular-nums\",\n fontFamily: MONO_FAMILY,\n }}\n >\n ${formatNumber(kpiValue)}\n </div>\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n fontSize: 14,\n color: accentColor,\n }}\n >\n <span style={{ fontWeight: 600 }}>+{kpiDelta.toFixed(1)}%</span>\n <span style={{ opacity: 0.5, color: \"white\" }}>\n vs last month\n </span>\n </div>\n </div>\n </Tile>\n\n {/* Bar chart */}\n <Tile title=\"Sessions\" structureOpacity={structureOpacity}>\n <svg\n viewBox=\"0 0 200 100\"\n preserveAspectRatio=\"none\"\n style={{ width: \"100%\", height: \"100%\" }}\n >\n {/* axes */}\n <line\n x1=\"0\"\n y1=\"100\"\n x2=\"200\"\n y2=\"100\"\n stroke=\"rgba(255,255,255,0.15)\"\n strokeWidth=\"0.5\"\n />\n {[25, 50, 75].map((y) => (\n <line\n key={y}\n x1=\"0\"\n y1={y}\n x2=\"200\"\n y2={y}\n stroke=\"rgba(255,255,255,0.06)\"\n strokeWidth=\"0.5\"\n strokeDasharray=\"2 2\"\n />\n ))}\n {BAR_VALUES.map((v, i) => {\n const barH = v * 90 * barProgress[i];\n const barW = 24;\n const x = 16 + i * 36;\n const y = 100 - barH;\n return (\n <rect\n key={i}\n x={x}\n y={y}\n width={barW}\n height={barH}\n rx={3}\n fill={accentColor}\n opacity={0.85}\n />\n );\n })}\n </svg>\n </Tile>\n\n {/* Line chart */}\n <Tile title=\"Active users\" structureOpacity={structureOpacity}>\n <svg\n viewBox=\"0 0 100 100\"\n preserveAspectRatio=\"none\"\n style={{ width: \"100%\", height: \"100%\" }}\n >\n <line\n x1=\"0\"\n y1=\"100\"\n x2=\"100\"\n y2=\"100\"\n stroke=\"rgba(255,255,255,0.15)\"\n strokeWidth=\"0.4\"\n />\n {[20, 40, 60, 80].map((y) => (\n <line\n key={y}\n x1=\"0\"\n y1={y}\n x2=\"100\"\n y2={y}\n stroke=\"rgba(255,255,255,0.06)\"\n strokeWidth=\"0.4\"\n strokeDasharray=\"1.5 1.5\"\n />\n ))}\n <path\n d={linePath}\n fill=\"none\"\n stroke={accentColor}\n strokeWidth=\"1.6\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n pathLength={1}\n strokeDasharray={1}\n strokeDashoffset={1 - lineProgress}\n />\n {/* dots */}\n {LINE_POINTS.map(([px, py], i) => {\n const dotProgress = interpolate(\n lineProgress,\n [\n i / (LINE_POINTS.length - 1),\n i / (LINE_POINTS.length - 1) + 0.05,\n ],\n [0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n return (\n <circle\n key={i}\n cx={px}\n cy={py}\n r={1.2}\n fill={accentColor}\n opacity={dotProgress}\n />\n );\n })}\n </svg>\n </Tile>\n\n {/* Donut */}\n <Tile title=\"Conversion\" structureOpacity={structureOpacity}>\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n height: \"100%\",\n position: \"relative\",\n }}\n >\n <svg width=\"180\" height=\"180\" viewBox=\"0 0 180 180\">\n <circle\n cx=\"90\"\n cy=\"90\"\n r={donutR}\n fill=\"none\"\n stroke=\"rgba(255,255,255,0.08)\"\n strokeWidth=\"14\"\n />\n <circle\n cx=\"90\"\n cy=\"90\"\n r={donutR}\n fill=\"none\"\n stroke={accentColor}\n strokeWidth=\"14\"\n strokeLinecap=\"round\"\n strokeDasharray={`${donutCircum * donutValue} ${donutCircum}`}\n transform=\"rotate(-90 90 90)\"\n />\n </svg>\n <div\n style={{\n position: \"absolute\",\n fontSize: 36,\n fontWeight: 700,\n letterSpacing: \"-0.02em\",\n fontFamily: MONO_FAMILY,\n fontVariantNumeric: \"tabular-nums\",\n }}\n >\n {(donutValue * 100).toFixed(1)}%\n </div>\n </div>\n </Tile>\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface DashboardPopulateProps {\n accentColor?: string;\n kpiTarget?: number;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\nconst MONO_FAMILY =\n \"var(--font-geist-mono), ui-monospace, SFMono-Regular, Menlo, monospace\";\n\nconst STRUCTURE_END = 15;\n\nfunction formatNumber(n: number) {\n return n.toLocaleString(\"en-US\");\n}\n\nconst BAR_VALUES = [0.55, 0.78, 0.42, 0.92, 0.66];\n\n// Hand-coded line chart points (in 0..100 viewBox space)\nconst LINE_POINTS: Array<[number, number]> = [\n [0, 70],\n [16, 55],\n [32, 62],\n [48, 38],\n [64, 45],\n [80, 22],\n [100, 12],\n];\n\nfunction buildLinePath() {\n return LINE_POINTS.map(([x, y], i) => `${i === 0 ? \"M\" : \"L\"}${x},${y}`).join(\n \" \",\n );\n}\n\nfunction Tile({\n title,\n children,\n structureOpacity,\n}: {\n title: string;\n children: React.ReactNode;\n structureOpacity: number;\n}) {\n return (\n <div\n style={{\n position: \"relative\",\n background: \"linear-gradient(180deg, #131316 0%, #0d0d10 100%)\",\n border: \"1px solid rgba(255,255,255,0.08)\",\n borderRadius: 16,\n padding: 24,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 16,\n opacity: structureOpacity,\n boxShadow:\n \"inset 0 1px 0 rgba(255,255,255,0.04), 0 20px 40px rgba(0,0,0,0.3)\",\n }}\n >\n <div\n style={{\n fontSize: 12,\n fontWeight: 500,\n textTransform: \"uppercase\",\n letterSpacing: \"0.08em\",\n color: \"rgba(255,255,255,0.5)\",\n }}\n >\n {title}\n </div>\n <div style={{ flex: 1, position: \"relative\" }}>{children}</div>\n </div>\n );\n}\n\nexport function DashboardPopulate({\n accentColor = \"#22c55e\",\n kpiTarget = 128400,\n speed = 1,\n className,\n}: DashboardPopulateProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n // Phase 1: structure fade in 0..15\n const structureOpacity = interpolate(frame, [0, STRUCTURE_END], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n // KPI count up\n const kpiSpring = spring({\n frame: frame - STRUCTURE_END,\n fps,\n config: { damping: 20, stiffness: 80, mass: 1 },\n durationInFrames: 60,\n });\n const kpiValue = Math.floor(kpiSpring * kpiTarget);\n const kpiDelta = interpolate(kpiSpring, [0, 1], [0, 12.4]);\n\n // Bar chart springs (staggered)\n const barProgress = BAR_VALUES.map((_, i) =>\n spring({\n frame: frame - STRUCTURE_END - i * 4,\n fps,\n config: { damping: 11, stiffness: 140, mass: 1 },\n durationInFrames: 40,\n }),\n );\n\n // Line chart stroke-dashoffset\n const linePath = buildLinePath();\n // approx length for viewBox 100x100 — use a generous constant; we set\n // pathLength on the path so dashoffset works in normalized units\n const lineProgress = interpolate(\n frame,\n [STRUCTURE_END + 4, STRUCTURE_END + 50],\n [0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n // Donut\n const donutTarget = 0.72;\n const donutSpring = spring({\n frame: frame - STRUCTURE_END - 6,\n fps,\n config: { damping: 13, stiffness: 110, mass: 1 },\n durationInFrames: 50,\n });\n const donutValue = donutSpring * donutTarget;\n const donutR = 70;\n const donutCircum = 2 * Math.PI * donutR;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n fontFamily: FONT_FAMILY,\n color: \"white\",\n padding: 64,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 24,\n overflow: \"hidden\",\n }}\n >\n {/* Subtle grid bg */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n backgroundImage:\n \"linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px)\",\n backgroundSize: \"48px 48px\",\n }}\n />\n <div\n style={{\n position: \"relative\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n opacity: structureOpacity,\n }}\n >\n <div>\n <div\n style={{\n fontSize: 28,\n fontWeight: 600,\n letterSpacing: \"-0.02em\",\n }}\n >\n Overview\n </div>\n <div\n style={{\n fontSize: 14,\n opacity: 0.5,\n marginTop: 4,\n }}\n >\n Last 30 days\n </div>\n </div>\n <div\n style={{\n display: \"flex\",\n gap: 8,\n fontSize: 12,\n fontFamily: MONO_FAMILY,\n }}\n >\n {[\"1D\", \"7D\", \"30D\", \"ALL\"].map((l, i) => (\n <div\n key={l}\n style={{\n padding: \"6px 12px\",\n borderRadius: 8,\n background:\n i === 2 ? \"rgba(255,255,255,0.1)\" : \"rgba(255,255,255,0.03)\",\n border: \"1px solid rgba(255,255,255,0.06)\",\n }}\n >\n {l}\n </div>\n ))}\n </div>\n </div>\n\n <div\n style={{\n position: \"relative\",\n flex: 1,\n display: \"grid\",\n gridTemplateColumns: \"1fr 1fr\",\n gridTemplateRows: \"1fr 1fr\",\n gap: 24,\n }}\n >\n {/* KPI */}\n <Tile title=\"Revenue\" structureOpacity={structureOpacity}>\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 12,\n height: \"100%\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n fontSize: 64,\n fontWeight: 700,\n letterSpacing: \"-0.04em\",\n fontVariantNumeric: \"tabular-nums\",\n fontFamily: MONO_FAMILY,\n }}\n >\n ${formatNumber(kpiValue)}\n </div>\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n fontSize: 14,\n color: accentColor,\n }}\n >\n <span style={{ fontWeight: 600 }}>+{kpiDelta.toFixed(1)}%</span>\n <span style={{ opacity: 0.5, color: \"white\" }}>\n vs last month\n </span>\n </div>\n </div>\n </Tile>\n\n {/* Bar chart */}\n <Tile title=\"Sessions\" structureOpacity={structureOpacity}>\n <svg\n viewBox=\"0 0 200 100\"\n preserveAspectRatio=\"none\"\n style={{ width: \"100%\", height: \"100%\" }}\n >\n {/* axes */}\n <line\n x1=\"0\"\n y1=\"100\"\n x2=\"200\"\n y2=\"100\"\n stroke=\"rgba(255,255,255,0.15)\"\n strokeWidth=\"0.5\"\n />\n {[25, 50, 75].map((y) => (\n <line\n key={y}\n x1=\"0\"\n y1={y}\n x2=\"200\"\n y2={y}\n stroke=\"rgba(255,255,255,0.06)\"\n strokeWidth=\"0.5\"\n strokeDasharray=\"2 2\"\n />\n ))}\n {BAR_VALUES.map((v, i) => {\n const barH = v * 90 * barProgress[i];\n const barW = 24;\n const x = 16 + i * 36;\n const y = 100 - barH;\n return (\n <rect\n key={i}\n x={x}\n y={y}\n width={barW}\n height={barH}\n rx={3}\n fill={accentColor}\n opacity={0.85}\n />\n );\n })}\n </svg>\n </Tile>\n\n {/* Line chart */}\n <Tile title=\"Active users\" structureOpacity={structureOpacity}>\n <svg\n viewBox=\"0 0 100 100\"\n preserveAspectRatio=\"none\"\n style={{ width: \"100%\", height: \"100%\" }}\n >\n <line\n x1=\"0\"\n y1=\"100\"\n x2=\"100\"\n y2=\"100\"\n stroke=\"rgba(255,255,255,0.15)\"\n strokeWidth=\"0.4\"\n />\n {[20, 40, 60, 80].map((y) => (\n <line\n key={y}\n x1=\"0\"\n y1={y}\n x2=\"100\"\n y2={y}\n stroke=\"rgba(255,255,255,0.06)\"\n strokeWidth=\"0.4\"\n strokeDasharray=\"1.5 1.5\"\n />\n ))}\n <path\n d={linePath}\n fill=\"none\"\n stroke={accentColor}\n strokeWidth=\"1.6\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n pathLength={1}\n strokeDasharray={1}\n strokeDashoffset={1 - lineProgress}\n />\n {/* dots */}\n {LINE_POINTS.map(([px, py], i) => {\n const dotProgress = interpolate(\n lineProgress,\n [\n i / (LINE_POINTS.length - 1),\n i / (LINE_POINTS.length - 1) + 0.05,\n ],\n [0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n return (\n <circle\n key={i}\n cx={px}\n cy={py}\n r={1.2}\n fill={accentColor}\n opacity={dotProgress}\n />\n );\n })}\n </svg>\n </Tile>\n\n {/* Donut */}\n <Tile title=\"Conversion\" structureOpacity={structureOpacity}>\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n height: \"100%\",\n position: \"relative\",\n }}\n >\n <svg width=\"180\" height=\"180\" viewBox=\"0 0 180 180\">\n <circle\n cx=\"90\"\n cy=\"90\"\n r={donutR}\n fill=\"none\"\n stroke=\"rgba(255,255,255,0.08)\"\n strokeWidth=\"14\"\n />\n <circle\n cx=\"90\"\n cy=\"90\"\n r={donutR}\n fill=\"none\"\n stroke={accentColor}\n strokeWidth=\"14\"\n strokeLinecap=\"round\"\n strokeDasharray={`${donutCircum * donutValue} ${donutCircum}`}\n transform=\"rotate(-90 90 90)\"\n />\n </svg>\n <div\n style={{\n position: \"absolute\",\n fontSize: 36,\n fontWeight: 700,\n letterSpacing: \"-0.02em\",\n fontFamily: MONO_FAMILY,\n fontVariantNumeric: \"tabular-nums\",\n }}\n >\n {(donutValue * 100).toFixed(1)}%\n </div>\n </div>\n </Tile>\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/dashboard-populate.tsx"
}
diff --git a/public/r/data-flow-pipes.json b/public/r/data-flow-pipes.json
index bdf3b331..bc7c58b6 100644
--- a/public/r/data-flow-pipes.json
+++ b/public/r/data-flow-pipes.json
@@ -9,7 +9,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 background?: string;\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 background = \"#050505\",\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 background,\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/device-mockup-zoom.json b/public/r/device-mockup-zoom.json
index ccd56bf0..71999a15 100644
--- a/public/r/device-mockup-zoom.json
+++ b/public/r/device-mockup-zoom.json
@@ -9,7 +9,7 @@
"files": [
{
"path": "registry/remocn/device-mockup-zoom/index.tsx",
- "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface DeviceMockupZoomProps {\n children?: ReactNode;\n device?: \"laptop\" | \"phone\";\n frameColor?: string;\n screenColor?: string;\n background?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nfunction DefaultScreen() {\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"linear-gradient(135deg, #0ea5e9 0%, #9333ea 100%)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: \"white\",\n fontFamily: FONT_FAMILY,\n fontSize: 32,\n fontWeight: 700,\n letterSpacing: \"-0.03em\",\n }}\n >\n Your UI\n </div>\n );\n}\n\nexport function DeviceMockupZoom({\n children,\n device = \"laptop\",\n frameColor = \"#1f1f1f\",\n screenColor = \"#0a0a0a\",\n background = \"#fafafa\",\n speed = 1,\n className,\n}: DeviceMockupZoomProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const scale = interpolate(frame, [0, durationInFrames], [2, 1], {\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.22, 1, 0.36, 1),\n });\n\n const screen = children ?? <DefaultScreen />;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n transform: `scale(${scale})`,\n transformOrigin: \"center center\",\n willChange: \"transform\",\n }}\n >\n {device === \"laptop\" ? (\n <div style={{ position: \"relative\" }}>\n {/* Screen body */}\n <div\n style={{\n width: 720,\n height: 440,\n background: frameColor,\n borderRadius: 16,\n padding: 16,\n boxShadow: \"0 30px 80px rgba(0,0,0,0.25)\",\n }}\n >\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n background: screenColor,\n borderRadius: 6,\n overflow: \"hidden\",\n }}\n >\n {screen}\n </div>\n </div>\n {/* Base */}\n <div\n style={{\n width: 820,\n height: 18,\n background: frameColor,\n borderBottomLeftRadius: 14,\n borderBottomRightRadius: 14,\n marginLeft: -50,\n marginTop: -2,\n boxShadow: \"0 10px 24px rgba(0,0,0,0.18)\",\n }}\n />\n <div\n style={{\n width: 120,\n height: 6,\n background: \"#0a0a0a\",\n marginLeft: \"auto\",\n marginRight: \"auto\",\n borderBottomLeftRadius: 8,\n borderBottomRightRadius: 8,\n marginTop: -1,\n }}\n />\n </div>\n ) : (\n <div\n style={{\n width: 280,\n height: 560,\n background: frameColor,\n borderRadius: 44,\n padding: 14,\n boxShadow: \"0 30px 80px rgba(0,0,0,0.25)\",\n position: \"relative\",\n }}\n >\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n background: screenColor,\n borderRadius: 32,\n overflow: \"hidden\",\n }}\n >\n {screen}\n </div>\n <div\n style={{\n position: \"absolute\",\n top: 22,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n width: 90,\n height: 22,\n background: \"#0a0a0a\",\n borderRadius: 14,\n }}\n />\n </div>\n )}\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { Easing, interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface DeviceMockupZoomProps {\n children?: ReactNode;\n device?: \"laptop\" | \"phone\";\n frameColor?: string;\n screenColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nfunction DefaultScreen() {\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"linear-gradient(135deg, #0ea5e9 0%, #9333ea 100%)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: \"white\",\n fontFamily: FONT_FAMILY,\n fontSize: 32,\n fontWeight: 700,\n letterSpacing: \"-0.03em\",\n }}\n >\n Your UI\n </div>\n );\n}\n\nexport function DeviceMockupZoom({\n children,\n device = \"laptop\",\n frameColor = \"#1f1f1f\",\n screenColor = \"#0a0a0a\",\n speed = 1,\n className,\n}: DeviceMockupZoomProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n const scale = interpolate(frame, [0, durationInFrames], [2, 1], {\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.22, 1, 0.36, 1),\n });\n\n const screen = children ?? <DefaultScreen />;\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 overflow: \"hidden\",\n }}\n >\n <div\n style={{\n transform: `scale(${scale})`,\n transformOrigin: \"center center\",\n willChange: \"transform\",\n }}\n >\n {device === \"laptop\" ? (\n <div style={{ position: \"relative\" }}>\n {/* Screen body */}\n <div\n style={{\n width: 720,\n height: 440,\n background: frameColor,\n borderRadius: 16,\n padding: 16,\n boxShadow: \"0 30px 80px rgba(0,0,0,0.25)\",\n }}\n >\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n background: screenColor,\n borderRadius: 6,\n overflow: \"hidden\",\n }}\n >\n {screen}\n </div>\n </div>\n {/* Base */}\n <div\n style={{\n width: 820,\n height: 18,\n background: frameColor,\n borderBottomLeftRadius: 14,\n borderBottomRightRadius: 14,\n marginLeft: -50,\n marginTop: -2,\n boxShadow: \"0 10px 24px rgba(0,0,0,0.18)\",\n }}\n />\n <div\n style={{\n width: 120,\n height: 6,\n background: \"#0a0a0a\",\n marginLeft: \"auto\",\n marginRight: \"auto\",\n borderBottomLeftRadius: 8,\n borderBottomRightRadius: 8,\n marginTop: -1,\n }}\n />\n </div>\n ) : (\n <div\n style={{\n width: 280,\n height: 560,\n background: frameColor,\n borderRadius: 44,\n padding: 14,\n boxShadow: \"0 30px 80px rgba(0,0,0,0.25)\",\n position: \"relative\",\n }}\n >\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n background: screenColor,\n borderRadius: 32,\n overflow: \"hidden\",\n }}\n >\n {screen}\n </div>\n <div\n style={{\n position: \"absolute\",\n top: 22,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n width: 90,\n height: 22,\n background: \"#0a0a0a\",\n borderRadius: 14,\n }}\n />\n </div>\n )}\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/device-mockup-zoom.tsx"
}
diff --git a/public/r/dialog.json b/public/r/dialog.json
index 35ce1fe9..a7de8e52 100644
--- a/public/r/dialog.json
+++ b/public/r/dialog.json
@@ -12,7 +12,7 @@
"files": [
{
"path": "registry/remocn-ui/dialog/index.tsx",
- "content": "\"use client\";\n\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type DialogState = \"opened\" | \"closed\";\n\nexport interface DialogProps {\n state?: DialogState;\n style?: DialogStyle;\n title?: string;\n description?: string;\n actionLabel?: string;\n cancelLabel?: string;\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n className?: string;\n}\n\nconst POPUP_WIDTH = 440;\nconst MAX_OVERLAY_ALPHA = 0.5;\n\nexport interface DialogStyle {\n overlayOpacity: number;\n popupOpacity: number;\n popupScale: number;\n popupTranslateY: number;\n}\n\nexport interface DialogStyleContext {\n popoverBg: string;\n popoverFg: string;\n mutedFg: string;\n border: string;\n radius: number;\n actionBg: string;\n actionFg: string;\n cancelFg: string;\n}\n\nexport function dialogStyleContext(theme: RemocnTheme): DialogStyleContext {\n return {\n popoverBg: theme.popover,\n popoverFg: theme.popoverForeground,\n mutedFg: theme.mutedForeground,\n border: theme.border,\n radius: theme.radius,\n actionBg: theme.primary,\n actionFg: theme.primaryForeground,\n cancelFg: theme.foreground,\n };\n}\n\nexport function dialogStyle(\n state: DialogState,\n _ctx: DialogStyleContext,\n): DialogStyle {\n switch (state) {\n case \"opened\":\n return {\n overlayOpacity: 1,\n popupOpacity: 1,\n popupScale: 1,\n popupTranslateY: 0,\n };\n default:\n return {\n overlayOpacity: 0,\n popupOpacity: 0,\n popupScale: 0.95,\n popupTranslateY: 8,\n };\n }\n}\n\nexport function Dialog({\n state = \"closed\",\n style,\n title = \"Edit profile\",\n description = \"Make changes to your profile here. Click save when you're done.\",\n actionLabel = \"Save changes\",\n cancelLabel = \"Cancel\",\n theme: themeOverride,\n mode,\n className,\n}: DialogProps) {\n const theme = useRemocnTheme(themeOverride, mode);\n\n const ctx = dialogStyleContext(theme);\n const v = style ?? dialogStyle(state, ctx);\n\n const buttonBase: React.CSSProperties = {\n height: 40,\n padding: \"0 20px\",\n fontSize: 15,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n borderRadius: ctx.radius,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n cursor: \"pointer\",\n };\n\n return (\n <div\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 {}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: `rgba(0, 0, 0, ${MAX_OVERLAY_ALPHA * v.overlayOpacity})`,\n }}\n />\n <div\n className={className}\n style={{\n position: \"relative\",\n width: POPUP_WIDTH,\n transform: `translateY(${v.popupTranslateY}px) scale(${v.popupScale})`,\n opacity: v.popupOpacity,\n background: ctx.popoverBg,\n color: ctx.popoverFg,\n border: `1px solid ${ctx.border}`,\n borderRadius: ctx.radius + 6,\n padding: 24,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n boxShadow: \"0 24px 48px -12px rgba(0,0,0,0.25)\",\n }}\n >\n {}\n <button\n type=\"button\"\n style={{\n position: \"absolute\",\n top: 16,\n right: 16,\n width: 28,\n height: 28,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n border: \"none\",\n borderRadius: ctx.radius,\n color: ctx.mutedFg,\n cursor: \"pointer\",\n }}\n >\n <svg width={16} height={16} viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d=\"M18 6 6 18 M6 6 18 18\"\n stroke={ctx.mutedFg}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </button>\n <div\n style={{\n fontSize: 18,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n paddingRight: 28,\n }}\n >\n {title}\n </div>\n <div style={{ fontSize: 14, lineHeight: 1.5, color: ctx.mutedFg }}>\n {description}\n </div>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"flex-end\",\n gap: 8,\n marginTop: 16,\n }}\n >\n {}\n <button\n type=\"button\"\n style={{\n ...buttonBase,\n background: \"transparent\",\n color: ctx.cancelFg,\n border: `1px solid ${ctx.border}`,\n }}\n >\n {cancelLabel}\n </button>\n {}\n <button\n type=\"button\"\n style={{\n ...buttonBase,\n background: ctx.actionBg,\n color: ctx.actionFg,\n border: \"1px solid transparent\",\n }}\n >\n {actionLabel}\n </button>\n </div>\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type DialogState = \"opened\" | \"closed\";\n\nexport interface DialogProps {\n state?: DialogState;\n style?: DialogStyle;\n title?: string;\n description?: string;\n actionLabel?: string;\n cancelLabel?: string;\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nconst POPUP_WIDTH = 440;\nconst MAX_OVERLAY_ALPHA = 0.5;\n\nexport interface DialogStyle {\n overlayOpacity: number;\n popupOpacity: number;\n popupScale: number;\n popupTranslateY: number;\n}\n\nexport interface DialogStyleContext {\n popoverBg: string;\n popoverFg: string;\n mutedFg: string;\n border: string;\n radius: number;\n actionBg: string;\n actionFg: string;\n cancelFg: string;\n}\n\nexport function dialogStyleContext(theme: RemocnTheme): DialogStyleContext {\n return {\n popoverBg: theme.popover,\n popoverFg: theme.popoverForeground,\n mutedFg: theme.mutedForeground,\n border: theme.border,\n radius: theme.radius,\n actionBg: theme.primary,\n actionFg: theme.primaryForeground,\n cancelFg: theme.foreground,\n };\n}\n\nexport function dialogStyle(\n state: DialogState,\n _ctx: DialogStyleContext,\n): DialogStyle {\n switch (state) {\n case \"opened\":\n return {\n overlayOpacity: 1,\n popupOpacity: 1,\n popupScale: 1,\n popupTranslateY: 0,\n };\n default:\n return {\n overlayOpacity: 0,\n popupOpacity: 0,\n popupScale: 0.95,\n popupTranslateY: 8,\n };\n }\n}\n\nexport function Dialog({\n state = \"closed\",\n style,\n title = \"Edit profile\",\n description = \"Make changes to your profile here. Click save when you're done.\",\n actionLabel = \"Save changes\",\n cancelLabel = \"Cancel\",\n theme: themeOverride,\n className,\n}: DialogProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n\n const ctx = dialogStyleContext(theme);\n const v = style ?? dialogStyle(state, ctx);\n\n const buttonBase: React.CSSProperties = {\n height: 40,\n padding: \"0 20px\",\n fontSize: 15,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n borderRadius: ctx.radius,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n cursor: \"pointer\",\n };\n\n return (\n <div\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 {}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: `rgba(0, 0, 0, ${MAX_OVERLAY_ALPHA * v.overlayOpacity})`,\n }}\n />\n <div\n className={className}\n style={{\n position: \"relative\",\n width: POPUP_WIDTH,\n transform: `translateY(${v.popupTranslateY}px) scale(${v.popupScale})`,\n opacity: v.popupOpacity,\n background: ctx.popoverBg,\n color: ctx.popoverFg,\n border: `1px solid ${ctx.border}`,\n borderRadius: ctx.radius + 6,\n padding: 24,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n boxShadow: \"0 24px 48px -12px rgba(0,0,0,0.25)\",\n }}\n >\n {}\n <button\n type=\"button\"\n style={{\n position: \"absolute\",\n top: 16,\n right: 16,\n width: 28,\n height: 28,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n border: \"none\",\n borderRadius: ctx.radius,\n color: ctx.mutedFg,\n cursor: \"pointer\",\n }}\n >\n <svg width={16} height={16} viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d=\"M18 6 6 18 M6 6 18 18\"\n stroke={ctx.mutedFg}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </button>\n <div\n style={{\n fontSize: 18,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n paddingRight: 28,\n }}\n >\n {title}\n </div>\n <div style={{ fontSize: 14, lineHeight: 1.5, color: ctx.mutedFg }}>\n {description}\n </div>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"flex-end\",\n gap: 8,\n marginTop: 16,\n }}\n >\n {}\n <button\n type=\"button\"\n style={{\n ...buttonBase,\n background: \"transparent\",\n color: ctx.cancelFg,\n border: `1px solid ${ctx.border}`,\n }}\n >\n {cancelLabel}\n </button>\n {}\n <button\n type=\"button\"\n style={{\n ...buttonBase,\n background: ctx.actionBg,\n color: ctx.actionFg,\n border: \"1px solid transparent\",\n }}\n >\n {actionLabel}\n </button>\n </div>\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/dialog.tsx"
},
diff --git a/public/r/drag-and-drop-flow.json b/public/r/drag-and-drop-flow.json
index 8a4d3e3a..4b55e65f 100644
--- a/public/r/drag-and-drop-flow.json
+++ b/public/r/drag-and-drop-flow.json
@@ -9,7 +9,7 @@
"files": [
{
"path": "registry/remocn/drag-and-drop-flow/index.tsx",
- "content": "\"use client\";\n\nimport {\n Easing,\n interpolate,\n interpolateColors,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport interface DragAndDropFlowProps {\n accent?: string;\n dropzoneLabel?: string;\n fileName?: string;\n background?: string;\n speed?: number;\n className?: string;\n}\n\nfunction FileIcon({ color }: { color: string }) {\n return (\n <svg width=\"44\" height=\"56\" viewBox=\"0 0 44 56\" fill=\"none\">\n <path\n d=\"M6 4a4 4 0 014-4h18l12 12v40a4 4 0 01-4 4H10a4 4 0 01-4-4V4z\"\n fill=\"white\"\n stroke={color}\n strokeWidth=\"2\"\n />\n <path\n d=\"M28 0v8a4 4 0 004 4h8\"\n stroke={color}\n strokeWidth=\"2\"\n fill=\"none\"\n />\n <rect\n x=\"12\"\n y=\"22\"\n width=\"20\"\n height=\"2\"\n rx=\"1\"\n fill={color}\n opacity=\"0.5\"\n />\n <rect\n x=\"12\"\n y=\"28\"\n width=\"16\"\n height=\"2\"\n rx=\"1\"\n fill={color}\n opacity=\"0.5\"\n />\n <rect\n x=\"12\"\n y=\"34\"\n width=\"18\"\n height=\"2\"\n rx=\"1\"\n fill={color}\n opacity=\"0.5\"\n />\n </svg>\n );\n}\n\nexport function DragAndDropFlow({\n accent = \"#0ea5e9\",\n dropzoneLabel = \"Drop file to upload\",\n fileName = \"design.fig\",\n background = \"#fafafa\",\n speed = 1,\n className,\n}: DragAndDropFlowProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n // Phase split\n const dragEnd = Math.round(durationInFrames * 0.45);\n const highlightEnd = Math.round(durationInFrames * 0.55);\n const progressEnd = durationInFrames;\n\n // Phase 1: file moves from start to center of dropzone\n const dragProgress = interpolate(frame, [0, dragEnd], [0, 1], {\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.cubic),\n });\n\n const startX = -220;\n const startY = -120;\n const fileX = interpolate(dragProgress, [0, 1], [startX, 0]);\n const fileY = interpolate(dragProgress, [0, 1], [startY, 0]);\n\n // Phase 2: dropzone border highlights as file approaches\n const borderColor = interpolateColors(\n frame,\n [dragEnd - 10, highlightEnd],\n [\"#d4d4d8\", accent],\n );\n\n // Phase 3: file fades, progress bar grows\n const fileOpacity = interpolate(\n frame,\n [highlightEnd - 4, highlightEnd + 8],\n [1, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const progressOpacity = interpolate(\n frame,\n [highlightEnd, highlightEnd + 6],\n [0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const progress = interpolate(\n frame,\n [highlightEnd, progressEnd - 4],\n [0, 100],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const dropzoneWidth = 420;\n const dropzoneHeight = 260;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div\n style={{\n position: \"relative\",\n width: dropzoneWidth,\n height: dropzoneHeight,\n borderRadius: 18,\n border: `2.5px dashed ${borderColor}`,\n background: \"white\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n flexDirection: \"column\",\n gap: 14,\n color: \"#71717a\",\n fontSize: 16,\n fontWeight: 500,\n transition: \"none\",\n }}\n >\n <svg width=\"36\" height=\"36\" viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d=\"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M17 8l-5-5-5 5M12 3v12\"\n stroke={borderColor}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n <span>{dropzoneLabel}</span>\n\n {/* Progress bar (after drop) */}\n <div\n style={{\n position: \"absolute\",\n left: 32,\n right: 32,\n bottom: 32,\n opacity: progressOpacity,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n }}\n >\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-between\",\n fontSize: 13,\n color: \"#52525b\",\n }}\n >\n <span>{fileName}</span>\n <span>{Math.round(progress)}%</span>\n </div>\n <div\n style={{\n height: 6,\n borderRadius: 999,\n background: \"#e4e4e7\",\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n width: `${progress}%`,\n height: \"100%\",\n background: accent,\n borderRadius: 999,\n }}\n />\n </div>\n </div>\n </div>\n\n {/* Animated file icon that moves into the dropzone */}\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n marginLeft: -22,\n marginTop: -28,\n transform: `translate(${fileX}px, ${fileY}px)`,\n opacity: fileOpacity,\n filter: \"drop-shadow(0 8px 16px rgba(0,0,0,0.15))\",\n }}\n >\n <FileIcon color={accent} />\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport {\n Easing,\n interpolate,\n interpolateColors,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport interface DragAndDropFlowProps {\n accent?: string;\n dropzoneLabel?: string;\n fileName?: string;\n speed?: number;\n className?: string;\n}\n\nfunction FileIcon({ color }: { color: string }) {\n return (\n <svg width=\"44\" height=\"56\" viewBox=\"0 0 44 56\" fill=\"none\">\n <path\n d=\"M6 4a4 4 0 014-4h18l12 12v40a4 4 0 01-4 4H10a4 4 0 01-4-4V4z\"\n fill=\"white\"\n stroke={color}\n strokeWidth=\"2\"\n />\n <path\n d=\"M28 0v8a4 4 0 004 4h8\"\n stroke={color}\n strokeWidth=\"2\"\n fill=\"none\"\n />\n <rect\n x=\"12\"\n y=\"22\"\n width=\"20\"\n height=\"2\"\n rx=\"1\"\n fill={color}\n opacity=\"0.5\"\n />\n <rect\n x=\"12\"\n y=\"28\"\n width=\"16\"\n height=\"2\"\n rx=\"1\"\n fill={color}\n opacity=\"0.5\"\n />\n <rect\n x=\"12\"\n y=\"34\"\n width=\"18\"\n height=\"2\"\n rx=\"1\"\n fill={color}\n opacity=\"0.5\"\n />\n </svg>\n );\n}\n\nexport function DragAndDropFlow({\n accent = \"#0ea5e9\",\n dropzoneLabel = \"Drop file to upload\",\n fileName = \"design.fig\",\n speed = 1,\n className,\n}: DragAndDropFlowProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n // Phase split\n const dragEnd = Math.round(durationInFrames * 0.45);\n const highlightEnd = Math.round(durationInFrames * 0.55);\n const progressEnd = durationInFrames;\n\n // Phase 1: file moves from start to center of dropzone\n const dragProgress = interpolate(frame, [0, dragEnd], [0, 1], {\n extrapolateRight: \"clamp\",\n easing: Easing.out(Easing.cubic),\n });\n\n const startX = -220;\n const startY = -120;\n const fileX = interpolate(dragProgress, [0, 1], [startX, 0]);\n const fileY = interpolate(dragProgress, [0, 1], [startY, 0]);\n\n // Phase 2: dropzone border highlights as file approaches\n const borderColor = interpolateColors(\n frame,\n [dragEnd - 10, highlightEnd],\n [\"#d4d4d8\", accent],\n );\n\n // Phase 3: file fades, progress bar grows\n const fileOpacity = interpolate(\n frame,\n [highlightEnd - 4, highlightEnd + 8],\n [1, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const progressOpacity = interpolate(\n frame,\n [highlightEnd, highlightEnd + 6],\n [0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const progress = interpolate(\n frame,\n [highlightEnd, progressEnd - 4],\n [0, 100],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const dropzoneWidth = 420;\n const dropzoneHeight = 260;\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 <div\n style={{\n position: \"relative\",\n width: dropzoneWidth,\n height: dropzoneHeight,\n borderRadius: 18,\n border: `2.5px dashed ${borderColor}`,\n background: \"white\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n flexDirection: \"column\",\n gap: 14,\n color: \"#71717a\",\n fontSize: 16,\n fontWeight: 500,\n transition: \"none\",\n }}\n >\n <svg width=\"36\" height=\"36\" viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d=\"M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4M17 8l-5-5-5 5M12 3v12\"\n stroke={borderColor}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n <span>{dropzoneLabel}</span>\n\n {/* Progress bar (after drop) */}\n <div\n style={{\n position: \"absolute\",\n left: 32,\n right: 32,\n bottom: 32,\n opacity: progressOpacity,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n }}\n >\n <div\n style={{\n display: \"flex\",\n justifyContent: \"space-between\",\n fontSize: 13,\n color: \"#52525b\",\n }}\n >\n <span>{fileName}</span>\n <span>{Math.round(progress)}%</span>\n </div>\n <div\n style={{\n height: 6,\n borderRadius: 999,\n background: \"#e4e4e7\",\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n width: `${progress}%`,\n height: \"100%\",\n background: accent,\n borderRadius: 999,\n }}\n />\n </div>\n </div>\n </div>\n\n {/* Animated file icon that moves into the dropzone */}\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n marginLeft: -22,\n marginTop: -28,\n transform: `translate(${fileX}px, ${fileY}px)`,\n opacity: fileOpacity,\n filter: \"drop-shadow(0 8px 16px rgba(0,0,0,0.15))\",\n }}\n >\n <FileIcon color={accent} />\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/drag-and-drop-flow.tsx"
}
diff --git a/public/r/drawer.json b/public/r/drawer.json
index 06f27ec6..ed46bec4 100644
--- a/public/r/drawer.json
+++ b/public/r/drawer.json
@@ -12,7 +12,7 @@
"files": [
{
"path": "registry/remocn-ui/drawer/index.tsx",
- "content": "\"use client\";\n\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type DrawerState = \"opened\" | \"closed\";\n\nexport interface DrawerProps {\n state?: DrawerState;\n style?: DrawerStyle;\n title?: string;\n description?: string;\n actionLabel?: string;\n cancelLabel?: string;\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n className?: string;\n}\n\nconst DRAWER_HEIGHT = 320;\nconst MAX_OVERLAY_ALPHA = 0.5;\n\nexport interface DrawerStyle {\n overlayOpacity: number;\n panelOpacity: number;\n panelTranslateY: number;\n}\n\nexport interface DrawerStyleContext {\n popoverBg: string;\n popoverFg: string;\n mutedFg: string;\n border: string;\n radius: number;\n actionBg: string;\n actionFg: string;\n cancelFg: string;\n}\n\nexport function drawerStyleContext(theme: RemocnTheme): DrawerStyleContext {\n return {\n popoverBg: theme.popover,\n popoverFg: theme.popoverForeground,\n mutedFg: theme.mutedForeground,\n border: theme.border,\n radius: theme.radius,\n actionBg: theme.primary,\n actionFg: theme.primaryForeground,\n cancelFg: theme.foreground,\n };\n}\n\nexport function drawerStyle(\n state: DrawerState,\n _ctx: DrawerStyleContext,\n): DrawerStyle {\n switch (state) {\n case \"opened\":\n return {\n overlayOpacity: 1,\n panelOpacity: 1,\n panelTranslateY: 0,\n };\n default:\n return {\n overlayOpacity: 0,\n panelOpacity: 0,\n panelTranslateY: DRAWER_HEIGHT,\n };\n }\n}\n\nexport function Drawer({\n state = \"closed\",\n style,\n title = \"Edit profile\",\n description = \"Make changes to your profile here. Click save when you're done.\",\n actionLabel = \"Save changes\",\n cancelLabel = \"Cancel\",\n theme: themeOverride,\n mode,\n className,\n}: DrawerProps) {\n const theme = useRemocnTheme(themeOverride, mode);\n\n const ctx = drawerStyleContext(theme);\n const v = style ?? drawerStyle(state, ctx);\n\n const buttonBase: React.CSSProperties = {\n height: 40,\n padding: \"0 20px\",\n fontSize: 15,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n borderRadius: ctx.radius,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n cursor: \"pointer\",\n };\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\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.overlayOpacity})`,\n }}\n />\n {}\n <div\n className={className}\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n bottom: 0,\n height: DRAWER_HEIGHT,\n transform: `translateY(${v.panelTranslateY}px)`,\n opacity: v.panelOpacity,\n background: ctx.popoverBg,\n color: ctx.popoverFg,\n borderTop: `1px solid ${ctx.border}`,\n borderTopLeftRadius: ctx.radius + 6,\n borderTopRightRadius: ctx.radius + 6,\n padding: 24,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: 8,\n boxShadow: \"0 -24px 48px -12px rgba(0,0,0,0.25)\",\n }}\n >\n {}\n <div\n style={{\n width: 40,\n height: 5,\n borderRadius: 999,\n background: ctx.border,\n marginBottom: 8,\n }}\n />\n {}\n <div\n style={{\n width: \"100%\",\n maxWidth: 440,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n }}\n >\n <div\n style={{\n fontSize: 18,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n }}\n >\n {title}\n </div>\n <div style={{ fontSize: 14, lineHeight: 1.5, color: ctx.mutedFg }}>\n {description}\n </div>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"flex-end\",\n gap: 8,\n marginTop: 16,\n }}\n >\n {}\n <button\n type=\"button\"\n style={{\n ...buttonBase,\n background: \"transparent\",\n color: ctx.cancelFg,\n border: `1px solid ${ctx.border}`,\n }}\n >\n {cancelLabel}\n </button>\n {}\n <button\n type=\"button\"\n style={{\n ...buttonBase,\n background: ctx.actionBg,\n color: ctx.actionFg,\n border: \"1px solid transparent\",\n }}\n >\n {actionLabel}\n </button>\n </div>\n </div>\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type DrawerState = \"opened\" | \"closed\";\n\nexport interface DrawerProps {\n state?: DrawerState;\n style?: DrawerStyle;\n title?: string;\n description?: string;\n actionLabel?: string;\n cancelLabel?: string;\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nconst DRAWER_HEIGHT = 320;\nconst MAX_OVERLAY_ALPHA = 0.5;\n\nexport interface DrawerStyle {\n overlayOpacity: number;\n panelOpacity: number;\n panelTranslateY: number;\n}\n\nexport interface DrawerStyleContext {\n popoverBg: string;\n popoverFg: string;\n mutedFg: string;\n border: string;\n radius: number;\n actionBg: string;\n actionFg: string;\n cancelFg: string;\n}\n\nexport function drawerStyleContext(theme: RemocnTheme): DrawerStyleContext {\n return {\n popoverBg: theme.popover,\n popoverFg: theme.popoverForeground,\n mutedFg: theme.mutedForeground,\n border: theme.border,\n radius: theme.radius,\n actionBg: theme.primary,\n actionFg: theme.primaryForeground,\n cancelFg: theme.foreground,\n };\n}\n\nexport function drawerStyle(\n state: DrawerState,\n _ctx: DrawerStyleContext,\n): DrawerStyle {\n switch (state) {\n case \"opened\":\n return {\n overlayOpacity: 1,\n panelOpacity: 1,\n panelTranslateY: 0,\n };\n default:\n return {\n overlayOpacity: 0,\n panelOpacity: 0,\n panelTranslateY: DRAWER_HEIGHT,\n };\n }\n}\n\nexport function Drawer({\n state = \"closed\",\n style,\n title = \"Edit profile\",\n description = \"Make changes to your profile here. Click save when you're done.\",\n actionLabel = \"Save changes\",\n cancelLabel = \"Cancel\",\n theme: themeOverride,\n className,\n}: DrawerProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n\n const ctx = drawerStyleContext(theme);\n const v = style ?? drawerStyle(state, ctx);\n\n const buttonBase: React.CSSProperties = {\n height: 40,\n padding: \"0 20px\",\n fontSize: 15,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n borderRadius: ctx.radius,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n cursor: \"pointer\",\n };\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\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.overlayOpacity})`,\n }}\n />\n {}\n <div\n className={className}\n style={{\n position: \"absolute\",\n left: 0,\n right: 0,\n bottom: 0,\n height: DRAWER_HEIGHT,\n transform: `translateY(${v.panelTranslateY}px)`,\n opacity: v.panelOpacity,\n background: ctx.popoverBg,\n color: ctx.popoverFg,\n borderTop: `1px solid ${ctx.border}`,\n borderTopLeftRadius: ctx.radius + 6,\n borderTopRightRadius: ctx.radius + 6,\n padding: 24,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: 8,\n boxShadow: \"0 -24px 48px -12px rgba(0,0,0,0.25)\",\n }}\n >\n {}\n <div\n style={{\n width: 40,\n height: 5,\n borderRadius: 999,\n background: ctx.border,\n marginBottom: 8,\n }}\n />\n {}\n <div\n style={{\n width: \"100%\",\n maxWidth: 440,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n }}\n >\n <div\n style={{\n fontSize: 18,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n }}\n >\n {title}\n </div>\n <div style={{ fontSize: 14, lineHeight: 1.5, color: ctx.mutedFg }}>\n {description}\n </div>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"flex-end\",\n gap: 8,\n marginTop: 16,\n }}\n >\n {}\n <button\n type=\"button\"\n style={{\n ...buttonBase,\n background: \"transparent\",\n color: ctx.cancelFg,\n border: `1px solid ${ctx.border}`,\n }}\n >\n {cancelLabel}\n </button>\n {}\n <button\n type=\"button\"\n style={{\n ...buttonBase,\n background: ctx.actionBg,\n color: ctx.actionFg,\n border: \"1px solid transparent\",\n }}\n >\n {actionLabel}\n </button>\n </div>\n </div>\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/drawer.tsx"
},
diff --git a/public/r/dropdown-menu-item.json b/public/r/dropdown-menu-item.json
index dc001f12..834246af 100644
--- a/public/r/dropdown-menu-item.json
+++ b/public/r/dropdown-menu-item.json
@@ -12,7 +12,7 @@
"files": [
{
"path": "registry/remocn-ui/dropdown-menu-item/index.tsx",
- "content": "\"use client\";\n\nimport { mixOklch, type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type DropdownMenuItemState = \"idle\" | \"hover\" | \"press\";\n\nexport interface DropdownMenuItemStyle {\n background: string;\n labelColor: string;\n scale: number;\n}\n\nexport interface DropdownMenuItemStyleContext {\n idleBg: string;\n hoverBg: string;\n pressBg: string;\n idleFg: string;\n}\n\nexport function dropdownMenuItemStyleContext(\n theme: RemocnTheme,\n): DropdownMenuItemStyleContext {\n return {\n idleBg: theme.popover,\n hoverBg: theme.accent,\n pressBg: mixOklch(theme.accent, theme.foreground, 0.08),\n idleFg: theme.popoverForeground,\n };\n}\n\nexport function dropdownMenuItemStyle(\n state: DropdownMenuItemState,\n ctx: DropdownMenuItemStyleContext,\n): DropdownMenuItemStyle {\n switch (state) {\n case \"hover\":\n return { background: ctx.hoverBg, labelColor: ctx.idleFg, scale: 1 };\n case \"press\":\n return { background: ctx.pressBg, labelColor: ctx.idleFg, scale: 0.98 };\n default:\n return { background: ctx.idleBg, labelColor: ctx.idleFg, scale: 1 };\n }\n}\n\nconst ROW_WIDTH = 240;\n\nexport interface DropdownMenuItemRowProps {\n style?: DropdownMenuItemStyle;\n state?: DropdownMenuItemState;\n label?: string;\n width?: number;\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n}\n\nexport function DropdownMenuItemRow({\n style,\n state = \"idle\",\n label = \"Profile\",\n width = ROW_WIDTH,\n theme: themeOverride,\n mode,\n}: DropdownMenuItemRowProps) {\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = dropdownMenuItemStyleContext(theme);\n const v = style ?? dropdownMenuItemStyle(state, ctx);\n\n return (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n width,\n padding: \"8px 12px\",\n borderRadius: theme.radius,\n background: v.background,\n color: v.labelColor,\n transform: `scale(${v.scale})`,\n fontSize: 14,\n letterSpacing: \"-0.01em\",\n boxSizing: \"border-box\",\n }}\n >\n <span>{label}</span>\n </div>\n );\n}\n\nexport interface DropdownMenuItemProps extends DropdownMenuItemRowProps {\n className?: string;\n}\n\nexport function DropdownMenuItem({\n style,\n state = \"idle\",\n label = \"Profile\",\n width = ROW_WIDTH,\n theme: themeOverride,\n mode,\n className,\n}: DropdownMenuItemProps) {\n const theme = useRemocnTheme(themeOverride, mode);\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: theme.background,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <DropdownMenuItemRow\n style={style}\n state={state}\n label={label}\n width={width}\n theme={themeOverride}\n mode={mode}\n />\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { mixOklch, type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type DropdownMenuItemState = \"idle\" | \"hover\" | \"press\";\n\nexport interface DropdownMenuItemStyle {\n background: string;\n labelColor: string;\n scale: number;\n}\n\nexport interface DropdownMenuItemStyleContext {\n idleBg: string;\n hoverBg: string;\n pressBg: string;\n idleFg: string;\n}\n\nexport function dropdownMenuItemStyleContext(\n theme: RemocnTheme,\n): DropdownMenuItemStyleContext {\n return {\n idleBg: theme.popover,\n hoverBg: theme.accent,\n pressBg: mixOklch(theme.accent, theme.foreground, 0.08),\n idleFg: theme.popoverForeground,\n };\n}\n\nexport function dropdownMenuItemStyle(\n state: DropdownMenuItemState,\n ctx: DropdownMenuItemStyleContext,\n): DropdownMenuItemStyle {\n switch (state) {\n case \"hover\":\n return { background: ctx.hoverBg, labelColor: ctx.idleFg, scale: 1 };\n case \"press\":\n return { background: ctx.pressBg, labelColor: ctx.idleFg, scale: 0.98 };\n default:\n return { background: ctx.idleBg, labelColor: ctx.idleFg, scale: 1 };\n }\n}\n\nconst ROW_WIDTH = 240;\n\nexport interface DropdownMenuItemRowProps {\n style?: DropdownMenuItemStyle;\n state?: DropdownMenuItemState;\n label?: string;\n width?: number;\n theme?: Partial<RemocnTheme>;\n}\n\nexport function DropdownMenuItemRow({\n style,\n state = \"idle\",\n label = \"Profile\",\n width = ROW_WIDTH,\n theme: themeOverride,\n}: DropdownMenuItemRowProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const ctx = dropdownMenuItemStyleContext(theme);\n const v = style ?? dropdownMenuItemStyle(state, ctx);\n\n return (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n width,\n padding: \"8px 12px\",\n borderRadius: theme.radius,\n background: v.background,\n color: v.labelColor,\n transform: `scale(${v.scale})`,\n fontSize: 14,\n letterSpacing: \"-0.01em\",\n boxSizing: \"border-box\",\n }}\n >\n <span>{label}</span>\n </div>\n );\n}\n\nexport interface DropdownMenuItemProps extends DropdownMenuItemRowProps {\n className?: string;\n}\n\nexport function DropdownMenuItem({\n style,\n state = \"idle\",\n label = \"Profile\",\n width = ROW_WIDTH,\n theme: themeOverride,\n className,\n}: DropdownMenuItemProps) {\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 <DropdownMenuItemRow\n style={style}\n state={state}\n label={label}\n width={width}\n theme={themeOverride}\n />\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/dropdown-menu-item.tsx"
},
diff --git a/public/r/dropdown-menu.json b/public/r/dropdown-menu.json
index 94b45dfb..6a71863b 100644
--- a/public/r/dropdown-menu.json
+++ b/public/r/dropdown-menu.json
@@ -14,7 +14,7 @@
"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 mode?: \"light\" | \"dark\";\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 mode,\n className,\n}: DropdownMenuProps) {\n const theme = useRemocnTheme(themeOverride, mode);\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: theme.background,\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 mode={mode}\n />\n );\n })}\n </div>\n </div>\n </div>\n );\n}\n",
+ "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",
"type": "registry:component",
"target": "components/remocn/dropdown-menu.tsx"
},
diff --git a/public/r/ecosystem-constellation.json b/public/r/ecosystem-constellation.json
index 606e139e..4288c33d 100644
--- a/public/r/ecosystem-constellation.json
+++ b/public/r/ecosystem-constellation.json
@@ -9,7 +9,7 @@
"files": [
{
"path": "registry/remocn/ecosystem-constellation/index.tsx",
- "content": "\"use client\";\n\nimport type { ComponentType } from \"react\";\nimport { interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface EcosystemConstellationProps {\n satelliteCount?: number;\n centerLabel?: string;\n accentColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n// Inline brand mark components — stylized for demo identification, drawn from\n// primitive SVG shapes only so the component stays self-contained.\n\nfunction GitHubMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={30} height={30} aria-hidden=\"true\">\n <path\n fill=\"#fff\"\n d=\"M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91.58.11.79-.25.79-.55v-2.06c-3.2.7-3.87-1.36-3.87-1.36-.52-1.33-1.27-1.69-1.27-1.69-1.04-.71.08-.7.08-.7 1.15.08 1.76 1.18 1.76 1.18 1.02 1.75 2.69 1.24 3.35.95.1-.74.4-1.24.72-1.53-2.55-.29-5.24-1.28-5.24-5.7 0-1.26.45-2.29 1.18-3.1-.12-.29-.51-1.46.11-3.05 0 0 .97-.31 3.18 1.18.92-.26 1.91-.39 2.89-.39s1.97.13 2.89.39c2.21-1.49 3.18-1.18 3.18-1.18.62 1.59.23 2.76.11 3.05.74.81 1.18 1.84 1.18 3.1 0 4.43-2.7 5.41-5.27 5.69.41.36.77 1.06.77 2.13v3.16c0 .31.21.67.8.55C20.21 21.39 23.5 17.08 23.5 12 23.5 5.65 18.35.5 12 .5z\"\n />\n </svg>\n );\n}\n\nfunction VercelMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <path fill=\"#fff\" d=\"M12 2 L23 21 L1 21 Z\" />\n </svg>\n );\n}\n\nfunction StripeMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <path\n fill=\"#fff\"\n d=\"M13.5 9.6c0-.6.5-.85 1.3-.85 1.15 0 2.6.35 3.75.97V6.16c-1.25-.5-2.5-.7-3.75-.7C11.7 5.46 9.6 7.06 9.6 9.7c0 4.13 5.7 3.47 5.7 5.25 0 .7-.6.93-1.45.93-1.25 0-2.85-.52-4.1-1.2v3.65c1.4.6 2.8.85 4.1.85 3.2 0 5.4-1.55 5.4-4.25-.02-4.45-5.75-3.65-5.75-5.33z\"\n />\n </svg>\n );\n}\n\nfunction SlackMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={26} height={26} aria-hidden=\"true\">\n <rect x=\"2\" y=\"10\" width=\"9\" height=\"2.5\" rx=\"1.25\" fill=\"#36C5F0\" />\n <rect x=\"13\" y=\"10\" width=\"9\" height=\"2.5\" rx=\"1.25\" fill=\"#2EB67D\" />\n <rect x=\"10\" y=\"2\" width=\"2.5\" height=\"9\" rx=\"1.25\" fill=\"#ECB22E\" />\n <rect x=\"10\" y=\"13\" width=\"2.5\" height=\"9\" rx=\"1.25\" fill=\"#E01E5A\" />\n </svg>\n );\n}\n\nfunction LinearMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <defs>\n <linearGradient id=\"linear-grad\" x1=\"0\" x2=\"1\" y1=\"0\" y2=\"1\">\n <stop offset=\"0%\" stopColor=\"#fff\" stopOpacity=\"0.95\" />\n <stop offset=\"100%\" stopColor=\"#fff\" stopOpacity=\"0.55\" />\n </linearGradient>\n </defs>\n <circle cx=\"12\" cy=\"12\" r=\"10\" fill=\"url(#linear-grad)\" />\n <path\n d=\"M5 13 L11 19 M5 9 L15 19 M5 5 L19 19 M9 5 L19 15 M13 5 L19 11\"\n stroke=\"#0a0a0a\"\n strokeWidth=\"0.9\"\n strokeLinecap=\"round\"\n opacity=\"0.85\"\n />\n </svg>\n );\n}\n\nfunction FigmaMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={26} height={26} aria-hidden=\"true\">\n <circle cx=\"9\" cy=\"4\" r=\"3.5\" fill=\"#F24E1E\" />\n <circle cx=\"15\" cy=\"4\" r=\"3.5\" fill=\"#FF7262\" />\n <circle cx=\"9\" cy=\"11\" r=\"3.5\" fill=\"#A259FF\" />\n <circle cx=\"15\" cy=\"11\" r=\"3.5\" fill=\"#1ABCFE\" />\n <circle cx=\"9\" cy=\"18\" r=\"3.5\" fill=\"#0ACF83\" />\n </svg>\n );\n}\n\nfunction NotionMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={26} height={26} aria-hidden=\"true\">\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"3\" fill=\"#fff\" />\n <path\n d=\"M8 7 V17 M8 7 L16 17 M16 7 V17\"\n stroke=\"#0a0a0a\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n fill=\"none\"\n />\n </svg>\n );\n}\n\nfunction DiscordMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <path\n fill=\"#fff\"\n d=\"M19.5 4.7A18 18 0 0 0 15 3.3l-.2.4a16.5 16.5 0 0 0-5.6 0L9 3.3a18 18 0 0 0-4.5 1.4C2 8.7 1.4 12.5 1.7 16.3a18 18 0 0 0 5.5 2.8l.4-.6a13 13 0 0 1-2-1l.5-.4a13 13 0 0 0 11.7 0l.5.4a13 13 0 0 1-2 1l.4.6a18 18 0 0 0 5.5-2.8c.4-4.4-.6-8.2-2.7-11.6zM8.5 14c-.9 0-1.7-.9-1.7-2s.8-2 1.7-2 1.7.9 1.7 2-.8 2-1.7 2zm7 0c-.9 0-1.7-.9-1.7-2s.8-2 1.7-2 1.7.9 1.7 2-.8 2-1.7 2z\"\n />\n </svg>\n );\n}\n\ninterface SatelliteBrand {\n Logo: ComponentType;\n bg: string;\n}\n\nconst SATELLITE_BRANDS: SatelliteBrand[] = [\n { Logo: GitHubMark, bg: \"#1f1f23\" },\n { Logo: VercelMark, bg: \"#0a0a0a\" },\n { Logo: StripeMark, bg: \"#635bff\" },\n { Logo: SlackMark, bg: \"#1a1d21\" },\n { Logo: LinearMark, bg: \"#5e6ad2\" },\n { Logo: FigmaMark, bg: \"#1e1e1e\" },\n { Logo: NotionMark, bg: \"#1a1a1a\" },\n { Logo: DiscordMark, bg: \"#5865f2\" },\n];\n\nexport function EcosystemConstellation({\n satelliteCount = 6,\n centerLabel = \"V\",\n accentColor = \"#a855f7\",\n speed = 1,\n className,\n}: EcosystemConstellationProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const count = Math.max(\n 3,\n Math.min(SATELLITE_BRANDS.length, Math.floor(satelliteCount)),\n );\n\n // Center pulse (0..1)\n const pulse = (Math.sin(frame / 12) + 1) / 2;\n const centerScale = 1 + pulse * 0.06;\n\n // Geometry\n const cx = 640;\n const cy = 360;\n const baseRadiusX = 230;\n const baseRadiusY = 180;\n const offscreenRadius = 1200; // 150% of width\n\n // Per-satellite assembly spring (staggered)\n const satellites = Array.from({ length: count }).map((_, i) => {\n const stagger = i * 4;\n const sp = spring({\n frame: frame - stagger,\n fps,\n config: { mass: 1.1, damping: 16, stiffness: 70 },\n durationInFrames: 50,\n });\n const radiusFactor = interpolate(sp, [0, 1], [offscreenRadius, 1]);\n\n // Slight elliptical variation per satellite\n const orbitOffset = i * 22;\n const rX = baseRadiusX + orbitOffset;\n const rY = baseRadiusY + orbitOffset * 0.7;\n // Different angular speed per orbit (slower for outer)\n const angularSpeed = 0.012 - i * 0.0008;\n const baseAngle = (i / count) * Math.PI * 2;\n const angle = baseAngle + frame * angularSpeed;\n\n // Use radiusFactor as a multiplier on the orbit radius\n const x = cx + Math.cos(angle) * rX * radiusFactor;\n const y = cy + Math.sin(angle) * rY * radiusFactor;\n\n // Data pulse: which satellite is currently \"firing\"\n const activeIdx = Math.floor(frame / 30) % count;\n const isActive = activeIdx === i;\n // Within the active 30-frame window, fade the line in/out\n const localFrame = frame - Math.floor(frame / 30) * 30;\n const lineOpacity = isActive\n ? interpolate(localFrame, [0, 8, 22, 30], [0.15, 0.9, 0.9, 0.15], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 0.15;\n const satScale = isActive\n ? interpolate(localFrame, [0, 8, 22, 30], [1, 1.1, 1.1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 1;\n\n const brand = SATELLITE_BRANDS[i % SATELLITE_BRANDS.length];\n return {\n x,\n y,\n Logo: brand.Logo,\n color: brand.bg,\n lineOpacity,\n satScale,\n visible: sp > 0.02,\n };\n });\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n background:\n \"radial-gradient(ellipse at center, #14101e 0%, #05030a 75%)\",\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 {/* Connection lines */}\n {satellites.map((s, i) => (\n <line\n key={`line-${i}`}\n x1={cx}\n y1={cy}\n x2={s.x}\n y2={s.y}\n stroke={accentColor}\n strokeWidth={2}\n strokeLinecap=\"round\"\n opacity={s.visible ? s.lineOpacity : 0}\n />\n ))}\n\n {/* Center glow */}\n <circle\n cx={cx}\n cy={cy}\n r={70 + pulse * 8}\n fill={accentColor}\n opacity={0.12}\n />\n <circle\n cx={cx}\n cy={cy}\n r={50 + pulse * 4}\n fill={accentColor}\n opacity={0.2}\n />\n </svg>\n\n {/* Center logo */}\n <div\n style={{\n position: \"absolute\",\n left: cx,\n top: cy,\n width: 96,\n height: 96,\n marginLeft: -48,\n marginTop: -48,\n borderRadius: 24,\n background: `linear-gradient(180deg, ${accentColor} 0%, ${accentColor}cc 100%)`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: \"white\",\n fontWeight: 800,\n fontSize: 52,\n letterSpacing: \"-0.05em\",\n transform: `scale(${centerScale})`,\n boxShadow: `0 0 60px ${accentColor}66, inset 0 1px 0 rgba(255,255,255,0.3)`,\n border: \"1px solid rgba(255,255,255,0.15)\",\n }}\n >\n {centerLabel}\n </div>\n\n {/* Satellites */}\n {satellites.map((s, i) => {\n const Logo = s.Logo;\n return (\n <div\n key={`sat-${i}`}\n style={{\n position: \"absolute\",\n left: s.x,\n top: s.y,\n width: 56,\n height: 56,\n marginLeft: -28,\n marginTop: -28,\n borderRadius: 14,\n background: `linear-gradient(180deg, ${s.color} 0%, ${s.color}dd 100%)`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n transform: `scale(${s.satScale})`,\n boxShadow: `0 8px 30px ${s.color}66, inset 0 1px 0 rgba(255,255,255,0.18)`,\n border: \"1px solid rgba(255,255,255,0.12)\",\n opacity: s.visible ? 1 : 0,\n willChange: \"transform\",\n }}\n >\n <Logo />\n </div>\n );\n })}\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport type { ComponentType } from \"react\";\nimport { interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface EcosystemConstellationProps {\n satelliteCount?: number;\n centerLabel?: string;\n accentColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n// Inline brand mark components — stylized for demo identification, drawn from\n// primitive SVG shapes only so the component stays self-contained.\n\nfunction GitHubMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={30} height={30} aria-hidden=\"true\">\n <path\n fill=\"#fff\"\n d=\"M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91.58.11.79-.25.79-.55v-2.06c-3.2.7-3.87-1.36-3.87-1.36-.52-1.33-1.27-1.69-1.27-1.69-1.04-.71.08-.7.08-.7 1.15.08 1.76 1.18 1.76 1.18 1.02 1.75 2.69 1.24 3.35.95.1-.74.4-1.24.72-1.53-2.55-.29-5.24-1.28-5.24-5.7 0-1.26.45-2.29 1.18-3.1-.12-.29-.51-1.46.11-3.05 0 0 .97-.31 3.18 1.18.92-.26 1.91-.39 2.89-.39s1.97.13 2.89.39c2.21-1.49 3.18-1.18 3.18-1.18.62 1.59.23 2.76.11 3.05.74.81 1.18 1.84 1.18 3.1 0 4.43-2.7 5.41-5.27 5.69.41.36.77 1.06.77 2.13v3.16c0 .31.21.67.8.55C20.21 21.39 23.5 17.08 23.5 12 23.5 5.65 18.35.5 12 .5z\"\n />\n </svg>\n );\n}\n\nfunction VercelMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <path fill=\"#fff\" d=\"M12 2 L23 21 L1 21 Z\" />\n </svg>\n );\n}\n\nfunction StripeMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <path\n fill=\"#fff\"\n d=\"M13.5 9.6c0-.6.5-.85 1.3-.85 1.15 0 2.6.35 3.75.97V6.16c-1.25-.5-2.5-.7-3.75-.7C11.7 5.46 9.6 7.06 9.6 9.7c0 4.13 5.7 3.47 5.7 5.25 0 .7-.6.93-1.45.93-1.25 0-2.85-.52-4.1-1.2v3.65c1.4.6 2.8.85 4.1.85 3.2 0 5.4-1.55 5.4-4.25-.02-4.45-5.75-3.65-5.75-5.33z\"\n />\n </svg>\n );\n}\n\nfunction SlackMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={26} height={26} aria-hidden=\"true\">\n <rect x=\"2\" y=\"10\" width=\"9\" height=\"2.5\" rx=\"1.25\" fill=\"#36C5F0\" />\n <rect x=\"13\" y=\"10\" width=\"9\" height=\"2.5\" rx=\"1.25\" fill=\"#2EB67D\" />\n <rect x=\"10\" y=\"2\" width=\"2.5\" height=\"9\" rx=\"1.25\" fill=\"#ECB22E\" />\n <rect x=\"10\" y=\"13\" width=\"2.5\" height=\"9\" rx=\"1.25\" fill=\"#E01E5A\" />\n </svg>\n );\n}\n\nfunction LinearMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <defs>\n <linearGradient id=\"linear-grad\" x1=\"0\" x2=\"1\" y1=\"0\" y2=\"1\">\n <stop offset=\"0%\" stopColor=\"#fff\" stopOpacity=\"0.95\" />\n <stop offset=\"100%\" stopColor=\"#fff\" stopOpacity=\"0.55\" />\n </linearGradient>\n </defs>\n <circle cx=\"12\" cy=\"12\" r=\"10\" fill=\"url(#linear-grad)\" />\n <path\n d=\"M5 13 L11 19 M5 9 L15 19 M5 5 L19 19 M9 5 L19 15 M13 5 L19 11\"\n stroke=\"#0a0a0a\"\n strokeWidth=\"0.9\"\n strokeLinecap=\"round\"\n opacity=\"0.85\"\n />\n </svg>\n );\n}\n\nfunction FigmaMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={26} height={26} aria-hidden=\"true\">\n <circle cx=\"9\" cy=\"4\" r=\"3.5\" fill=\"#F24E1E\" />\n <circle cx=\"15\" cy=\"4\" r=\"3.5\" fill=\"#FF7262\" />\n <circle cx=\"9\" cy=\"11\" r=\"3.5\" fill=\"#A259FF\" />\n <circle cx=\"15\" cy=\"11\" r=\"3.5\" fill=\"#1ABCFE\" />\n <circle cx=\"9\" cy=\"18\" r=\"3.5\" fill=\"#0ACF83\" />\n </svg>\n );\n}\n\nfunction NotionMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={26} height={26} aria-hidden=\"true\">\n <rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"3\" fill=\"#fff\" />\n <path\n d=\"M8 7 V17 M8 7 L16 17 M16 7 V17\"\n stroke=\"#0a0a0a\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n fill=\"none\"\n />\n </svg>\n );\n}\n\nfunction DiscordMark() {\n return (\n <svg viewBox=\"0 0 24 24\" width={28} height={28} aria-hidden=\"true\">\n <path\n fill=\"#fff\"\n d=\"M19.5 4.7A18 18 0 0 0 15 3.3l-.2.4a16.5 16.5 0 0 0-5.6 0L9 3.3a18 18 0 0 0-4.5 1.4C2 8.7 1.4 12.5 1.7 16.3a18 18 0 0 0 5.5 2.8l.4-.6a13 13 0 0 1-2-1l.5-.4a13 13 0 0 0 11.7 0l.5.4a13 13 0 0 1-2 1l.4.6a18 18 0 0 0 5.5-2.8c.4-4.4-.6-8.2-2.7-11.6zM8.5 14c-.9 0-1.7-.9-1.7-2s.8-2 1.7-2 1.7.9 1.7 2-.8 2-1.7 2zm7 0c-.9 0-1.7-.9-1.7-2s.8-2 1.7-2 1.7.9 1.7 2-.8 2-1.7 2z\"\n />\n </svg>\n );\n}\n\ninterface SatelliteBrand {\n Logo: ComponentType;\n bg: string;\n}\n\nconst SATELLITE_BRANDS: SatelliteBrand[] = [\n { Logo: GitHubMark, bg: \"#1f1f23\" },\n { Logo: VercelMark, bg: \"#0a0a0a\" },\n { Logo: StripeMark, bg: \"#635bff\" },\n { Logo: SlackMark, bg: \"#1a1d21\" },\n { Logo: LinearMark, bg: \"#5e6ad2\" },\n { Logo: FigmaMark, bg: \"#1e1e1e\" },\n { Logo: NotionMark, bg: \"#1a1a1a\" },\n { Logo: DiscordMark, bg: \"#5865f2\" },\n];\n\nexport function EcosystemConstellation({\n satelliteCount = 6,\n centerLabel = \"V\",\n accentColor = \"#a855f7\",\n speed = 1,\n className,\n}: EcosystemConstellationProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const count = Math.max(\n 3,\n Math.min(SATELLITE_BRANDS.length, Math.floor(satelliteCount)),\n );\n\n // Center pulse (0..1)\n const pulse = (Math.sin(frame / 12) + 1) / 2;\n const centerScale = 1 + pulse * 0.06;\n\n // Geometry\n const cx = 640;\n const cy = 360;\n const baseRadiusX = 230;\n const baseRadiusY = 180;\n const offscreenRadius = 1200; // 150% of width\n\n // Per-satellite assembly spring (staggered)\n const satellites = Array.from({ length: count }).map((_, i) => {\n const stagger = i * 4;\n const sp = spring({\n frame: frame - stagger,\n fps,\n config: { mass: 1.1, damping: 16, stiffness: 70 },\n durationInFrames: 50,\n });\n const radiusFactor = interpolate(sp, [0, 1], [offscreenRadius, 1]);\n\n // Slight elliptical variation per satellite\n const orbitOffset = i * 22;\n const rX = baseRadiusX + orbitOffset;\n const rY = baseRadiusY + orbitOffset * 0.7;\n // Different angular speed per orbit (slower for outer)\n const angularSpeed = 0.012 - i * 0.0008;\n const baseAngle = (i / count) * Math.PI * 2;\n const angle = baseAngle + frame * angularSpeed;\n\n // Use radiusFactor as a multiplier on the orbit radius\n const x = cx + Math.cos(angle) * rX * radiusFactor;\n const y = cy + Math.sin(angle) * rY * radiusFactor;\n\n // Data pulse: which satellite is currently \"firing\"\n const activeIdx = Math.floor(frame / 30) % count;\n const isActive = activeIdx === i;\n // Within the active 30-frame window, fade the line in/out\n const localFrame = frame - Math.floor(frame / 30) * 30;\n const lineOpacity = isActive\n ? interpolate(localFrame, [0, 8, 22, 30], [0.15, 0.9, 0.9, 0.15], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 0.15;\n const satScale = isActive\n ? interpolate(localFrame, [0, 8, 22, 30], [1, 1.1, 1.1, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n })\n : 1;\n\n const brand = SATELLITE_BRANDS[i % SATELLITE_BRANDS.length];\n return {\n x,\n y,\n Logo: brand.Logo,\n color: brand.bg,\n lineOpacity,\n satScale,\n visible: sp > 0.02,\n };\n });\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n background: \"transparent\",\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 {/* Connection lines */}\n {satellites.map((s, i) => (\n <line\n key={`line-${i}`}\n x1={cx}\n y1={cy}\n x2={s.x}\n y2={s.y}\n stroke={accentColor}\n strokeWidth={2}\n strokeLinecap=\"round\"\n opacity={s.visible ? s.lineOpacity : 0}\n />\n ))}\n\n {/* Center glow */}\n <circle\n cx={cx}\n cy={cy}\n r={70 + pulse * 8}\n fill={accentColor}\n opacity={0.12}\n />\n <circle\n cx={cx}\n cy={cy}\n r={50 + pulse * 4}\n fill={accentColor}\n opacity={0.2}\n />\n </svg>\n\n {/* Center logo */}\n <div\n style={{\n position: \"absolute\",\n left: cx,\n top: cy,\n width: 96,\n height: 96,\n marginLeft: -48,\n marginTop: -48,\n borderRadius: 24,\n background: `linear-gradient(180deg, ${accentColor} 0%, ${accentColor}cc 100%)`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: \"white\",\n fontWeight: 800,\n fontSize: 52,\n letterSpacing: \"-0.05em\",\n transform: `scale(${centerScale})`,\n boxShadow: `0 0 60px ${accentColor}66, inset 0 1px 0 rgba(255,255,255,0.3)`,\n border: \"1px solid rgba(255,255,255,0.15)\",\n }}\n >\n {centerLabel}\n </div>\n\n {/* Satellites */}\n {satellites.map((s, i) => {\n const Logo = s.Logo;\n return (\n <div\n key={`sat-${i}`}\n style={{\n position: \"absolute\",\n left: s.x,\n top: s.y,\n width: 56,\n height: 56,\n marginLeft: -28,\n marginTop: -28,\n borderRadius: 14,\n background: `linear-gradient(180deg, ${s.color} 0%, ${s.color}dd 100%)`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n transform: `scale(${s.satScale})`,\n boxShadow: `0 8px 30px ${s.color}66, inset 0 1px 0 rgba(255,255,255,0.18)`,\n border: \"1px solid rgba(255,255,255,0.12)\",\n opacity: s.visible ? 1 : 0,\n willChange: \"transform\",\n }}\n >\n <Logo />\n </div>\n );\n })}\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/ecosystem-constellation.tsx"
}
diff --git a/public/r/field.json b/public/r/field.json
index accd4fd5..31c29313 100644
--- a/public/r/field.json
+++ b/public/r/field.json
@@ -12,7 +12,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 mode?: \"light\" | \"dark\";\n theme?: Partial<RemocnTheme>;\n style?: CSSProperties;\n}\n\nexport function FieldLabel({ children, mode, theme, style }: FieldLabelProps) {\n const t = useRemocnTheme(theme, mode);\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 mode?: \"light\" | \"dark\";\n theme?: Partial<RemocnTheme>;\n style?: CSSProperties;\n}\n\nexport function FieldDescription({\n children,\n align = \"start\",\n mode,\n theme,\n style,\n}: FieldDescriptionProps) {\n const t = useRemocnTheme(theme, mode);\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({ children, height = 40, style }: 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/github-stars.json b/public/r/github-stars.json
index 9bd670cc..9f639348 100644
--- a/public/r/github-stars.json
+++ b/public/r/github-stars.json
@@ -8,10 +8,13 @@
"date-fns",
"@remotion/google-fonts"
],
+ "registryDependencies": [
+ "@remocn/number-wheel"
+ ],
"files": [
{
"path": "registry/remocn/github-stars/index.tsx",
- "content": "\"use client\";\n\nimport { format, parseISO } from \"date-fns\";\nimport type React from \"react\";\nimport { useState } from \"react\";\nimport { loadFont as loadSans } from \"@remotion/google-fonts/Manrope\";\nimport { loadFont as loadMono } from \"@remotion/google-fonts/JetBrainsMono\";\nimport {\n AbsoluteFill,\n Easing,\n Img,\n interpolate,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\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}\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\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(frame * speed, [0, durationInFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n easing: Easing.bezier(0.5, 1, 0.5, 1),\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(1),\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\nconst WHEEL_ROLL_START = 0.9;\n\nexport function computeWheel(current: number, place: number): number {\n if (current <= 0) return 0;\n if (place === 0) return current % 10;\n\n const v = current / 10 ** place;\n const digit = Math.floor(v) % 10;\n const frac = v - Math.floor(v);\n if (frac <= WHEEL_ROLL_START) return digit;\n\n const raw = (frac - WHEEL_ROLL_START) / (1 - WHEEL_ROLL_START);\n const eased = raw * raw * (3 - 2 * raw); // smoothstep: 0→0, 1→1\n return digit + eased;\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\nfunction DigitColumn({\n value,\n fontSize,\n}: {\n /** continuous wheel value in [0, 10) */\n value: number;\n fontSize: 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 }}\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 Odometer({\n current,\n fontSize,\n color,\n mutedColor,\n}: {\n /** continuous running total (float) */\n current: number;\n fontSize: number;\n color: string;\n mutedColor: string;\n}) {\n const intVal = Math.max(0, Math.round(current));\n const formatted = intVal.toLocaleString(\"en-US\");\n\n // Walk right→left so each digit knows its decimal place; drive each wheel\n // continuously from `current` (higher places roll slower → mechanical feel).\n const cells: React.ReactNode[] = [];\n let place = 0;\n for (let i = formatted.length - 1; i >= 0; i--) {\n const ch = formatted[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 }}\n >\n ,\n </span>,\n );\n } else {\n const wheel = computeWheel(current, place);\n cells.unshift(\n <DigitColumn key={`d${i}`} value={wheel} fontSize={fontSize} />,\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\ninterface RowProps {\n stargazer: Stargazer;\n index: number;\n rowH: number;\n avatarSize: number;\n loginSize: number;\n dateFormat: string;\n accent: string;\n theme: Theme;\n isActive: boolean;\n settle: number;\n showSeparator: boolean;\n opacity: number;\n}\n\nfunction Row({\n stargazer,\n index,\n rowH,\n avatarSize,\n loginSize,\n dateFormat,\n accent,\n theme,\n isActive,\n settle,\n showSeparator,\n opacity,\n}: RowProps) {\n let dateLabel = stargazer.starredAt;\n try {\n dateLabel = format(parseISO(stargazer.starredAt), dateFormat);\n } catch {\n // leave the raw string if it isn't a valid ISO date\n }\n\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}: 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 = downsampleStargazers(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\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 fadeMask =\n \"linear-gradient(to bottom, transparent 0, black 12%, black 88%, transparent 100%)\";\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 WebkitMaskImage: fadeMask,\n maskImage: fadeMask,\n }}\n >\n <div\n style={{\n transform: `translateY(${scrollY}px)`,\n willChange: \"transform\",\n }}\n >\n {rows.map((sg, i) => (\n <Row\n key={`${sg.login}-${i}`}\n stargazer={sg}\n index={i}\n rowH={rowH}\n avatarSize={avatarSize}\n loginSize={loginSize}\n dateFormat={dateFormat}\n accent={accentColor}\n theme={t}\n isActive={i === N - 1}\n settle={settle}\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 );\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 repoSlug = (\n <div\n style={{\n fontSize: isVertical ? 20 : 24,\n fontWeight: 500,\n color: t.fgMuted,\n fontFamily: FONT_FAMILY,\n maxWidth: isVertical ? 600 : 392,\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n }}\n >\n {repo}\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\n current={current}\n fontSize={counterSize}\n color={t.fg}\n mutedColor={t.fgMuted}\n />\n </div>\n {underline}\n <div\n style={{\n display: \"flex\",\n fontSize: 20,\n fontWeight: 500,\n color: t.fgMuted,\n fontFamily: FONT_FAMILY,\n }}\n >\n <span>{repo}</span>\n </div>\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\n current={current}\n fontSize={counterSize}\n color={t.fg}\n mutedColor={t.fgMuted}\n />\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 { 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",
"type": "registry:component",
"target": "components/remocn/github-stars.tsx"
}
diff --git a/public/r/glass-code-block.json b/public/r/glass-code-block.json
index f936017c..09645b4c 100644
--- a/public/r/glass-code-block.json
+++ b/public/r/glass-code-block.json
@@ -9,7 +9,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 background?: string;\n glassColor?: string;\n staggerFrames?: number;\n showTrafficLights?: 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 background = \"#0a0a0a\",\n glassColor = \"rgba(10, 10, 10, 0.6)\",\n staggerFrames = 4,\n showTrafficLights = true,\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 background,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n {/* Animated background hint behind the glass so the blur has something\n to chew on. Pure CSS — no extra deps. */}\n <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 { 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 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 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 {/* Animated background hint behind the glass so the blur has something\n to chew on. Pure CSS — no extra deps. */}\n <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/hero-device-assemble.json b/public/r/hero-device-assemble.json
index bcfc2cd2..4181dffa 100644
--- a/public/r/hero-device-assemble.json
+++ b/public/r/hero-device-assemble.json
@@ -9,7 +9,7 @@
"files": [
{
"path": "registry/remocn/hero-device-assemble/index.tsx",
- "content": "\"use client\";\n\nimport { interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface HeroDeviceAssembleProps {\n assembleStart?: number;\n device?: \"laptop\" | \"phone\";\n accentColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nfunction MockUI({ accentColor }: { accentColor: string }) {\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n flexDirection: \"column\",\n background: \"#0b0b0f\",\n fontFamily: FONT_FAMILY,\n color: \"white\",\n overflow: \"hidden\",\n }}\n >\n {/* Title bar */}\n <div\n style={{\n height: \"10%\",\n background: \"#111118\",\n borderBottom: \"1px solid rgba(255,255,255,0.06)\",\n display: \"flex\",\n alignItems: \"center\",\n padding: \"0 16px\",\n gap: 8,\n }}\n >\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: \"50%\",\n background: \"rgba(255,255,255,0.18)\",\n }}\n />\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: \"50%\",\n background: \"rgba(255,255,255,0.18)\",\n }}\n />\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: \"50%\",\n background: \"rgba(255,255,255,0.18)\",\n }}\n />\n </div>\n <div style={{ flex: 1, display: \"flex\" }}>\n {/* Sidebar */}\n <div\n style={{\n width: \"22%\",\n background: \"#0e0e14\",\n borderRight: \"1px solid rgba(255,255,255,0.05)\",\n padding: 16,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 10,\n }}\n >\n <div\n style={{\n height: 12,\n borderRadius: 4,\n background: accentColor,\n opacity: 0.85,\n width: \"70%\",\n }}\n />\n <div\n style={{\n height: 10,\n borderRadius: 4,\n background: \"rgba(255,255,255,0.1)\",\n width: \"85%\",\n }}\n />\n <div\n style={{\n height: 10,\n borderRadius: 4,\n background: \"rgba(255,255,255,0.08)\",\n width: \"60%\",\n }}\n />\n <div\n style={{\n height: 10,\n borderRadius: 4,\n background: \"rgba(255,255,255,0.08)\",\n width: \"75%\",\n }}\n />\n </div>\n {/* Content */}\n <div\n style={{\n flex: 1,\n padding: 24,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 16,\n }}\n >\n <div\n style={{\n height: 18,\n width: \"40%\",\n background: \"rgba(255,255,255,0.85)\",\n borderRadius: 4,\n }}\n />\n <div\n style={{\n height: 10,\n width: \"65%\",\n background: \"rgba(255,255,255,0.18)\",\n borderRadius: 4,\n }}\n />\n <div\n style={{\n display: \"grid\",\n gridTemplateColumns: \"1fr 1fr 1fr\",\n gap: 12,\n marginTop: 12,\n }}\n >\n <div\n style={{\n height: 90,\n borderRadius: 8,\n background:\n \"linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02))\",\n border: \"1px solid rgba(255,255,255,0.06)\",\n }}\n />\n <div\n style={{\n height: 90,\n borderRadius: 8,\n background: `linear-gradient(180deg, ${accentColor}33, ${accentColor}11)`,\n border: `1px solid ${accentColor}55`,\n }}\n />\n <div\n style={{\n height: 90,\n borderRadius: 8,\n background:\n \"linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02))\",\n border: \"1px solid rgba(255,255,255,0.06)\",\n }}\n />\n </div>\n <div\n style={{\n flex: 1,\n borderRadius: 8,\n background:\n \"linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01))\",\n border: \"1px solid rgba(255,255,255,0.06)\",\n }}\n />\n </div>\n </div>\n </div>\n );\n}\n\nexport function HeroDeviceAssemble({\n assembleStart = 0,\n device = \"laptop\",\n accentColor = \"#22c55e\",\n speed = 1,\n className,\n}: HeroDeviceAssembleProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const assemble = spring({\n frame: frame - assembleStart,\n fps,\n config: { mass: 1.4, damping: 12, stiffness: 90 },\n durationInFrames: 60,\n });\n\n // Layer translateZ values from far -> 0\n const lidZ = interpolate(assemble, [0, 1], [1000, 0]);\n const baseZ = interpolate(assemble, [0, 1], [-800, 0]);\n const bezelZ = interpolate(assemble, [0, 1], [600, 0]);\n const screenZ = interpolate(assemble, [0, 1], [300, 0]);\n\n // Parent rotation easing to 0\n const rotX = interpolate(assemble, [0, 1], [-22, 0]);\n const rotY = interpolate(assemble, [0, 1], [28, 0]);\n\n // Layer opacity fade in slightly during assembly\n const layerOpacity = interpolate(assemble, [0, 0.4], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n // Settle frame: after assemble ~ 0.95\n const settleFrame = assembleStart + 45;\n const screenWake = interpolate(\n frame,\n [settleFrame, settleFrame + 18],\n [0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n // Shimmer sweep across screen (after wake)\n const shimmerProgress = interpolate(\n frame,\n [settleFrame + 6, settleFrame + 30],\n [-1, 2],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const isPhone = device === \"phone\";\n\n // Device dimensions\n const deviceW = isPhone ? 320 : 760;\n const deviceH = isPhone ? 640 : 470;\n const screenInset = isPhone ? 12 : 18;\n const bezelRadius = isPhone ? 36 : 14;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n background:\n \"radial-gradient(ellipse at center, #1a1a22 0%, #050507 70%)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n perspective: 2000,\n fontFamily: FONT_FAMILY,\n }}\n >\n <div\n style={{\n position: \"relative\",\n width: deviceW,\n height: deviceH,\n transformStyle: \"preserve-3d\",\n transform: `rotateX(${rotX}deg) rotateY(${rotY}deg)`,\n willChange: \"transform\",\n }}\n >\n {/* Back lid (laptop only — for phone, acts as the back shell) */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n transform: `translateZ(${lidZ - 8}px)`,\n background: \"linear-gradient(180deg, #1f2128 0%, #0e1014 100%)\",\n borderRadius: bezelRadius + 4,\n border: \"1px solid rgba(255,255,255,0.08)\",\n boxShadow:\n \"0 60px 120px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.06)\",\n opacity: layerOpacity,\n }}\n />\n\n {/* Keyboard / chassis base — laptop only */}\n {!isPhone && (\n <div\n style={{\n position: \"absolute\",\n left: -40,\n right: -40,\n bottom: -28,\n height: 28,\n transform: `translateZ(${baseZ}px) rotateX(78deg)`,\n transformOrigin: \"top center\",\n background: \"linear-gradient(180deg, #2a2d36 0%, #14161c 100%)\",\n borderRadius: \"0 0 12px 12px\",\n border: \"1px solid rgba(255,255,255,0.06)\",\n boxShadow: \"0 30px 60px rgba(0,0,0,0.6)\",\n opacity: layerOpacity,\n }}\n />\n )}\n\n {/* Bezel frame */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n transform: `translateZ(${bezelZ}px)`,\n background: \"#0a0a0d\",\n borderRadius: bezelRadius,\n border: \"1px solid rgba(255,255,255,0.12)\",\n boxShadow:\n \"inset 0 0 0 2px rgba(255,255,255,0.04), 0 20px 60px rgba(0,0,0,0.5)\",\n opacity: layerOpacity,\n }}\n />\n\n {/* UI screen */}\n <div\n style={{\n position: \"absolute\",\n inset: screenInset,\n transform: `translateZ(${screenZ}px)`,\n borderRadius: bezelRadius - 6,\n overflow: \"hidden\",\n background: \"black\",\n opacity: layerOpacity,\n }}\n >\n {/* Black panel during flight */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"#000\",\n opacity: 1 - screenWake,\n }}\n />\n {/* UI fades in */}\n <div style={{ position: \"absolute\", inset: 0, opacity: screenWake }}>\n <MockUI accentColor={accentColor} />\n </div>\n {/* Shimmer sweep */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: `linear-gradient(115deg, transparent 40%, rgba(255,255,255,0.18) 50%, transparent 60%)`,\n transform: `translateX(${shimmerProgress * 100}%)`,\n mixBlendMode: \"screen\",\n pointerEvents: \"none\",\n }}\n />\n </div>\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface HeroDeviceAssembleProps {\n assembleStart?: number;\n device?: \"laptop\" | \"phone\";\n accentColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nfunction MockUI({ accentColor }: { accentColor: string }) {\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n flexDirection: \"column\",\n background: \"#0b0b0f\",\n fontFamily: FONT_FAMILY,\n color: \"white\",\n overflow: \"hidden\",\n }}\n >\n {/* Title bar */}\n <div\n style={{\n height: \"10%\",\n background: \"#111118\",\n borderBottom: \"1px solid rgba(255,255,255,0.06)\",\n display: \"flex\",\n alignItems: \"center\",\n padding: \"0 16px\",\n gap: 8,\n }}\n >\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: \"50%\",\n background: \"rgba(255,255,255,0.18)\",\n }}\n />\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: \"50%\",\n background: \"rgba(255,255,255,0.18)\",\n }}\n />\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: \"50%\",\n background: \"rgba(255,255,255,0.18)\",\n }}\n />\n </div>\n <div style={{ flex: 1, display: \"flex\" }}>\n {/* Sidebar */}\n <div\n style={{\n width: \"22%\",\n background: \"#0e0e14\",\n borderRight: \"1px solid rgba(255,255,255,0.05)\",\n padding: 16,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 10,\n }}\n >\n <div\n style={{\n height: 12,\n borderRadius: 4,\n background: accentColor,\n opacity: 0.85,\n width: \"70%\",\n }}\n />\n <div\n style={{\n height: 10,\n borderRadius: 4,\n background: \"rgba(255,255,255,0.1)\",\n width: \"85%\",\n }}\n />\n <div\n style={{\n height: 10,\n borderRadius: 4,\n background: \"rgba(255,255,255,0.08)\",\n width: \"60%\",\n }}\n />\n <div\n style={{\n height: 10,\n borderRadius: 4,\n background: \"rgba(255,255,255,0.08)\",\n width: \"75%\",\n }}\n />\n </div>\n {/* Content */}\n <div\n style={{\n flex: 1,\n padding: 24,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 16,\n }}\n >\n <div\n style={{\n height: 18,\n width: \"40%\",\n background: \"rgba(255,255,255,0.85)\",\n borderRadius: 4,\n }}\n />\n <div\n style={{\n height: 10,\n width: \"65%\",\n background: \"rgba(255,255,255,0.18)\",\n borderRadius: 4,\n }}\n />\n <div\n style={{\n display: \"grid\",\n gridTemplateColumns: \"1fr 1fr 1fr\",\n gap: 12,\n marginTop: 12,\n }}\n >\n <div\n style={{\n height: 90,\n borderRadius: 8,\n background:\n \"linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02))\",\n border: \"1px solid rgba(255,255,255,0.06)\",\n }}\n />\n <div\n style={{\n height: 90,\n borderRadius: 8,\n background: `linear-gradient(180deg, ${accentColor}33, ${accentColor}11)`,\n border: `1px solid ${accentColor}55`,\n }}\n />\n <div\n style={{\n height: 90,\n borderRadius: 8,\n background:\n \"linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02))\",\n border: \"1px solid rgba(255,255,255,0.06)\",\n }}\n />\n </div>\n <div\n style={{\n flex: 1,\n borderRadius: 8,\n background:\n \"linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01))\",\n border: \"1px solid rgba(255,255,255,0.06)\",\n }}\n />\n </div>\n </div>\n </div>\n );\n}\n\nexport function HeroDeviceAssemble({\n assembleStart = 0,\n device = \"laptop\",\n accentColor = \"#22c55e\",\n speed = 1,\n className,\n}: HeroDeviceAssembleProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const assemble = spring({\n frame: frame - assembleStart,\n fps,\n config: { mass: 1.4, damping: 12, stiffness: 90 },\n durationInFrames: 60,\n });\n\n // Layer translateZ values from far -> 0\n const lidZ = interpolate(assemble, [0, 1], [1000, 0]);\n const baseZ = interpolate(assemble, [0, 1], [-800, 0]);\n const bezelZ = interpolate(assemble, [0, 1], [600, 0]);\n const screenZ = interpolate(assemble, [0, 1], [300, 0]);\n\n // Parent rotation easing to 0\n const rotX = interpolate(assemble, [0, 1], [-22, 0]);\n const rotY = interpolate(assemble, [0, 1], [28, 0]);\n\n // Layer opacity fade in slightly during assembly\n const layerOpacity = interpolate(assemble, [0, 0.4], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n // Settle frame: after assemble ~ 0.95\n const settleFrame = assembleStart + 45;\n const screenWake = interpolate(\n frame,\n [settleFrame, settleFrame + 18],\n [0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n // Shimmer sweep across screen (after wake)\n const shimmerProgress = interpolate(\n frame,\n [settleFrame + 6, settleFrame + 30],\n [-1, 2],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n const isPhone = device === \"phone\";\n\n // Device dimensions\n const deviceW = isPhone ? 320 : 760;\n const deviceH = isPhone ? 640 : 470;\n const screenInset = isPhone ? 12 : 18;\n const bezelRadius = isPhone ? 36 : 14;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n background: \"transparent\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n perspective: 2000,\n fontFamily: FONT_FAMILY,\n }}\n >\n <div\n style={{\n position: \"relative\",\n width: deviceW,\n height: deviceH,\n transformStyle: \"preserve-3d\",\n transform: `rotateX(${rotX}deg) rotateY(${rotY}deg)`,\n willChange: \"transform\",\n }}\n >\n {/* Back lid (laptop only — for phone, acts as the back shell) */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n transform: `translateZ(${lidZ - 8}px)`,\n background: \"linear-gradient(180deg, #1f2128 0%, #0e1014 100%)\",\n borderRadius: bezelRadius + 4,\n border: \"1px solid rgba(255,255,255,0.08)\",\n boxShadow:\n \"0 60px 120px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.06)\",\n opacity: layerOpacity,\n }}\n />\n\n {/* Keyboard / chassis base — laptop only */}\n {!isPhone && (\n <div\n style={{\n position: \"absolute\",\n left: -40,\n right: -40,\n bottom: -28,\n height: 28,\n transform: `translateZ(${baseZ}px) rotateX(78deg)`,\n transformOrigin: \"top center\",\n background: \"linear-gradient(180deg, #2a2d36 0%, #14161c 100%)\",\n borderRadius: \"0 0 12px 12px\",\n border: \"1px solid rgba(255,255,255,0.06)\",\n boxShadow: \"0 30px 60px rgba(0,0,0,0.6)\",\n opacity: layerOpacity,\n }}\n />\n )}\n\n {/* Bezel frame */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n transform: `translateZ(${bezelZ}px)`,\n background: \"#0a0a0d\",\n borderRadius: bezelRadius,\n border: \"1px solid rgba(255,255,255,0.12)\",\n boxShadow:\n \"inset 0 0 0 2px rgba(255,255,255,0.04), 0 20px 60px rgba(0,0,0,0.5)\",\n opacity: layerOpacity,\n }}\n />\n\n {/* UI screen */}\n <div\n style={{\n position: \"absolute\",\n inset: screenInset,\n transform: `translateZ(${screenZ}px)`,\n borderRadius: bezelRadius - 6,\n overflow: \"hidden\",\n background: \"black\",\n opacity: layerOpacity,\n }}\n >\n {/* Black panel during flight */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"#000\",\n opacity: 1 - screenWake,\n }}\n />\n {/* UI fades in */}\n <div style={{ position: \"absolute\", inset: 0, opacity: screenWake }}>\n <MockUI accentColor={accentColor} />\n </div>\n {/* Shimmer sweep */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: `linear-gradient(115deg, transparent 40%, rgba(255,255,255,0.18) 50%, transparent 60%)`,\n transform: `translateX(${shimmerProgress * 100}%)`,\n mixBlendMode: \"screen\",\n pointerEvents: \"none\",\n }}\n />\n </div>\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/hero-device-assemble.tsx"
}
diff --git a/public/r/infinite-bento-pan.json b/public/r/infinite-bento-pan.json
index 0b6cffa3..b2fd4df1 100644
--- a/public/r/infinite-bento-pan.json
+++ b/public/r/infinite-bento-pan.json
@@ -9,7 +9,7 @@
"files": [
{
"path": "registry/remocn/infinite-bento-pan/index.tsx",
- "content": "\"use client\";\n\nimport { interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface InfiniteBentoPanProps {\n panSpeed?: number;\n accentColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nconst SUPER_W = 3500;\nconst SUPER_H = 2500;\n\ntype CardKind =\n | \"chart\"\n | \"counter\"\n | \"gradient\"\n | \"code\"\n | \"logo\"\n | \"stat\"\n | \"bars\";\n\ninterface CardDef {\n x: number;\n y: number;\n w: number;\n h: number;\n kind: CardKind;\n hue: number;\n label?: string;\n}\n\nconst CARDS: CardDef[] = [\n { x: 80, y: 80, w: 480, h: 280, kind: \"chart\", hue: 220, label: \"Revenue\" },\n { x: 600, y: 80, w: 280, h: 280, kind: \"counter\", hue: 280, label: \"MRR\" },\n { x: 920, y: 80, w: 360, h: 180, kind: \"gradient\", hue: 200 },\n { x: 1320, y: 80, w: 480, h: 280, kind: \"code\", hue: 0, label: \"deploy.ts\" },\n { x: 1840, y: 80, w: 280, h: 280, kind: \"logo\", hue: 320 },\n { x: 2160, y: 80, w: 380, h: 180, kind: \"stat\", hue: 160, label: \"Uptime\" },\n { x: 2580, y: 80, w: 360, h: 280, kind: \"bars\", hue: 40, label: \"Visits\" },\n { x: 920, y: 300, w: 360, h: 200, kind: \"counter\", hue: 180, label: \"Users\" },\n {\n x: 2160,\n y: 300,\n w: 380,\n h: 200,\n kind: \"chart\",\n hue: 100,\n label: \"Latency\",\n },\n { x: 80, y: 400, w: 280, h: 280, kind: \"gradient\", hue: 340 },\n { x: 400, y: 400, w: 480, h: 280, kind: \"code\", hue: 0, label: \"api.ts\" },\n { x: 1320, y: 420, w: 280, h: 280, kind: \"stat\", hue: 60, label: \"P95\" },\n { x: 1640, y: 420, w: 380, h: 280, kind: \"bars\", hue: 260, label: \"Builds\" },\n { x: 2580, y: 420, w: 360, h: 280, kind: \"logo\", hue: 200 },\n { x: 80, y: 720, w: 480, h: 240, kind: \"chart\", hue: 290, label: \"Errors\" },\n { x: 600, y: 720, w: 280, h: 240, kind: \"stat\", hue: 20, label: \"RPS\" },\n { x: 920, y: 740, w: 380, h: 220, kind: \"gradient\", hue: 240 },\n {\n x: 1320,\n y: 740,\n w: 360,\n h: 220,\n kind: \"counter\",\n hue: 140,\n label: \"Active\",\n },\n { x: 1720, y: 740, w: 480, h: 240, kind: \"code\", hue: 0, label: \"worker.ts\" },\n { x: 2240, y: 740, w: 360, h: 240, kind: \"bars\", hue: 320, label: \"Queue\" },\n { x: 80, y: 1000, w: 360, h: 220, kind: \"logo\", hue: 180 },\n { x: 460, y: 1000, w: 380, h: 220, kind: \"stat\", hue: 80, label: \"Cache\" },\n { x: 880, y: 1000, w: 480, h: 220, kind: \"chart\", hue: 200, label: \"CPU\" },\n {\n x: 1400,\n y: 1000,\n w: 280,\n h: 220,\n kind: \"counter\",\n hue: 360,\n label: \"Jobs\",\n },\n { x: 1720, y: 1020, w: 360, h: 220, kind: \"gradient\", hue: 120 },\n { x: 2120, y: 1020, w: 380, h: 220, kind: \"code\", hue: 0, label: \"db.sql\" },\n { x: 2540, y: 1020, w: 400, h: 220, kind: \"bars\", hue: 280, label: \"Tasks\" },\n { x: 80, y: 1280, w: 480, h: 260, kind: \"code\", hue: 0, label: \"edge.ts\" },\n { x: 600, y: 1280, w: 360, h: 260, kind: \"chart\", hue: 240, label: \"TTFB\" },\n { x: 1000, y: 1280, w: 280, h: 260, kind: \"logo\", hue: 60 },\n { x: 1320, y: 1280, w: 380, h: 260, kind: \"stat\", hue: 200, label: \"Hits\" },\n {\n x: 1740,\n y: 1280,\n w: 360,\n h: 260,\n kind: \"counter\",\n hue: 300,\n label: \"Bytes\",\n },\n { x: 2140, y: 1280, w: 380, h: 260, kind: \"gradient\", hue: 160 },\n { x: 2560, y: 1280, w: 380, h: 260, kind: \"bars\", hue: 0, label: \"Errors\" },\n { x: 80, y: 1600, w: 380, h: 220, kind: \"stat\", hue: 280, label: \"Saved\" },\n { x: 500, y: 1600, w: 480, h: 220, kind: \"chart\", hue: 40, label: \"Net Out\" },\n { x: 1020, y: 1600, w: 360, h: 220, kind: \"code\", hue: 0, label: \"auth.ts\" },\n { x: 1420, y: 1600, w: 280, h: 220, kind: \"logo\", hue: 220 },\n {\n x: 1740,\n y: 1620,\n w: 380,\n h: 220,\n kind: \"counter\",\n hue: 100,\n label: \"Hooks\",\n },\n { x: 2160, y: 1620, w: 360, h: 220, kind: \"bars\", hue: 340, label: \"Runs\" },\n { x: 2560, y: 1620, w: 380, h: 220, kind: \"gradient\", hue: 200 },\n { x: 80, y: 1880, w: 480, h: 240, kind: \"bars\", hue: 180, label: \"Edges\" },\n { x: 600, y: 1880, w: 380, h: 240, kind: \"gradient\", hue: 320 },\n { x: 1020, y: 1880, w: 360, h: 240, kind: \"logo\", hue: 80 },\n {\n x: 1420,\n y: 1880,\n w: 480,\n h: 240,\n kind: \"chart\",\n hue: 260,\n label: \"Tokens\",\n },\n {\n x: 1940,\n y: 1880,\n w: 280,\n h: 240,\n kind: \"counter\",\n hue: 20,\n label: \"Calls\",\n },\n { x: 2260, y: 1880, w: 380, h: 240, kind: \"stat\", hue: 140, label: \"Score\" },\n { x: 2680, y: 1880, w: 260, h: 240, kind: \"code\", hue: 0, label: \"ws.ts\" },\n];\n\nfunction noise(i: number, frame: number) {\n return Math.sin(frame / 30 + i) * 0.5 + 0.5;\n}\n\nfunction ChartCard({ accent, t }: { accent: string; t: number }) {\n const points: string[] = [];\n for (let i = 0; i < 12; i++) {\n const x = (i / 11) * 100;\n const y =\n 50 - (Math.sin(i * 0.7 + t) * 18 + Math.cos(i * 0.4 + t * 0.6) * 8);\n points.push(`${x},${y}`);\n }\n return (\n <svg\n viewBox=\"0 0 100 60\"\n preserveAspectRatio=\"none\"\n style={{ width: \"100%\", height: \"100%\" }}\n >\n <polyline\n points={points.join(\" \")}\n fill=\"none\"\n stroke={accent}\n strokeWidth={1.4}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <polyline\n points={`${points.join(\" \")} 100,60 0,60`}\n fill={`${accent}22`}\n stroke=\"none\"\n />\n </svg>\n );\n}\n\nfunction BarsCard({ accent, t }: { accent: string; t: number }) {\n return (\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-end\",\n gap: 6,\n height: \"100%\",\n width: \"100%\",\n }}\n >\n {Array.from({ length: 10 }).map((_, i) => {\n const h = 25 + (Math.sin(i * 0.8 + t) * 0.5 + 0.5) * 70;\n return (\n <div\n key={i}\n style={{\n flex: 1,\n height: `${h}%`,\n background: `linear-gradient(180deg, ${accent} 0%, ${accent}55 100%)`,\n borderRadius: 4,\n }}\n />\n );\n })}\n </div>\n );\n}\n\nfunction CodeCard() {\n const lines = [\n { indent: 0, w: 60, c: \"#7dd3fc\" },\n { indent: 1, w: 80, c: \"rgba(255,255,255,0.8)\" },\n { indent: 1, w: 50, c: \"#f9a8d4\" },\n { indent: 2, w: 70, c: \"rgba(255,255,255,0.8)\" },\n { indent: 2, w: 40, c: \"#fde047\" },\n { indent: 1, w: 30, c: \"rgba(255,255,255,0.6)\" },\n { indent: 0, w: 20, c: \"rgba(255,255,255,0.6)\" },\n ];\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n fontFamily: \"ui-monospace, SFMono-Regular, Menlo, monospace\",\n }}\n >\n {lines.map((l, i) => (\n <div\n key={i}\n style={{\n marginLeft: l.indent * 14,\n width: `${l.w}%`,\n height: 8,\n borderRadius: 3,\n background: l.c,\n opacity: 0.7,\n }}\n />\n ))}\n </div>\n );\n}\n\nfunction LogoCard({ accent, hue }: { accent: string; hue: number }) {\n return (\n <div\n style={{\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: 80,\n height: 80,\n borderRadius: 20,\n background: `linear-gradient(135deg, ${accent} 0%, hsl(${hue},70%,55%) 100%)`,\n boxShadow: `0 10px 30px ${accent}44`,\n }}\n />\n </div>\n );\n}\n\nfunction GradientCard({ hue }: { hue: number }) {\n return (\n <div\n style={{\n width: \"100%\",\n height: \"100%\",\n background: `radial-gradient(circle at 30% 30%, hsl(${hue},80%,60%) 0%, hsl(${(hue + 60) % 360},70%,40%) 50%, #0a0a0a 100%)`,\n }}\n />\n );\n}\n\nfunction Card({\n card,\n accent,\n index,\n frame,\n}: {\n card: CardDef;\n accent: string;\n index: number;\n frame: number;\n}) {\n const t = noise(index, frame) * 6.28;\n const baseStyle: React.CSSProperties = {\n position: \"absolute\",\n left: card.x,\n top: card.y,\n width: card.w,\n height: card.h,\n borderRadius: 18,\n background: \"linear-gradient(180deg, #131313 0%, #0a0a0a 100%)\",\n border: \"1px solid rgba(255,255,255,0.07)\",\n overflow: \"hidden\",\n padding: 18,\n color: \"white\",\n display: \"flex\",\n flexDirection: \"column\",\n };\n\n const labelEl = card.label ? (\n <div\n style={{\n fontSize: 12,\n fontWeight: 600,\n color: \"rgba(255,255,255,0.55)\",\n letterSpacing: \"0.04em\",\n textTransform: \"uppercase\",\n marginBottom: 8,\n }}\n >\n {card.label}\n </div>\n ) : null;\n\n if (card.kind === \"chart\") {\n return (\n <div style={baseStyle}>\n {labelEl}\n <div style={{ flex: 1 }}>\n <ChartCard accent={accent} t={t} />\n </div>\n </div>\n );\n }\n if (card.kind === \"bars\") {\n return (\n <div style={baseStyle}>\n {labelEl}\n <div style={{ flex: 1 }}>\n <BarsCard accent={accent} t={t} />\n </div>\n </div>\n );\n }\n if (card.kind === \"counter\") {\n const v = Math.floor(1200 + noise(index, frame) * 800);\n return (\n <div style={baseStyle}>\n {labelEl}\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n fontSize: 56,\n fontWeight: 700,\n letterSpacing: \"-0.04em\",\n color: \"white\",\n }}\n >\n {v.toLocaleString()}\n </div>\n <div style={{ fontSize: 12, color: accent, fontWeight: 600 }}>\n +{(noise(index + 1, frame) * 12).toFixed(1)}%\n </div>\n </div>\n );\n }\n if (card.kind === \"stat\") {\n const v = (95 + noise(index, frame) * 5).toFixed(2);\n return (\n <div style={baseStyle}>\n {labelEl}\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n fontSize: 48,\n fontWeight: 700,\n letterSpacing: \"-0.03em\",\n }}\n >\n {v}\n <span\n style={{\n fontSize: 20,\n color: \"rgba(255,255,255,0.5)\",\n marginLeft: 4,\n }}\n >\n %\n </span>\n </div>\n </div>\n );\n }\n if (card.kind === \"code\") {\n return (\n <div style={baseStyle}>\n {labelEl}\n <div style={{ flex: 1, display: \"flex\", alignItems: \"center\" }}>\n <div style={{ width: \"100%\" }}>\n <CodeCard />\n </div>\n </div>\n </div>\n );\n }\n if (card.kind === \"logo\") {\n return (\n <div style={{ ...baseStyle, padding: 0 }}>\n <LogoCard accent={accent} hue={card.hue} />\n </div>\n );\n }\n // gradient\n return (\n <div style={{ ...baseStyle, padding: 0 }}>\n <GradientCard hue={card.hue} />\n </div>\n );\n}\n\nexport function InfiniteBentoPan({\n panSpeed = 1,\n accentColor = \"#7c3aed\",\n speed = 1,\n className,\n}: InfiniteBentoPanProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames, width, height } = useVideoConfig();\n\n const maxX = SUPER_W - width;\n const maxY = SUPER_H - height;\n\n // diagonal pan: from top-left toward bottom-right\n const t = interpolate(frame, [0, durationInFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const px = t * maxX * Math.min(1, panSpeed);\n const py = t * maxY * Math.min(1, panSpeed);\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"#050505\",\n overflow: \"hidden\",\n fontFamily: FONT_FAMILY,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n width: SUPER_W,\n height: SUPER_H,\n transform: `translate(${-px}px, ${-py}px)`,\n willChange: \"transform\",\n }}\n >\n {CARDS.map((c, i) => (\n <Card key={i} card={c} accent={accentColor} index={i} frame={frame} />\n ))}\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background:\n \"radial-gradient(circle at center, transparent 30%, rgba(0,0,0,0.85) 80%, #000 100%)\",\n pointerEvents: \"none\",\n }}\n />\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface InfiniteBentoPanProps {\n panSpeed?: number;\n accentColor?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nconst SUPER_W = 3500;\nconst SUPER_H = 2500;\n\ntype CardKind =\n | \"chart\"\n | \"counter\"\n | \"gradient\"\n | \"code\"\n | \"logo\"\n | \"stat\"\n | \"bars\";\n\ninterface CardDef {\n x: number;\n y: number;\n w: number;\n h: number;\n kind: CardKind;\n hue: number;\n label?: string;\n}\n\nconst CARDS: CardDef[] = [\n { x: 80, y: 80, w: 480, h: 280, kind: \"chart\", hue: 220, label: \"Revenue\" },\n { x: 600, y: 80, w: 280, h: 280, kind: \"counter\", hue: 280, label: \"MRR\" },\n { x: 920, y: 80, w: 360, h: 180, kind: \"gradient\", hue: 200 },\n { x: 1320, y: 80, w: 480, h: 280, kind: \"code\", hue: 0, label: \"deploy.ts\" },\n { x: 1840, y: 80, w: 280, h: 280, kind: \"logo\", hue: 320 },\n { x: 2160, y: 80, w: 380, h: 180, kind: \"stat\", hue: 160, label: \"Uptime\" },\n { x: 2580, y: 80, w: 360, h: 280, kind: \"bars\", hue: 40, label: \"Visits\" },\n { x: 920, y: 300, w: 360, h: 200, kind: \"counter\", hue: 180, label: \"Users\" },\n {\n x: 2160,\n y: 300,\n w: 380,\n h: 200,\n kind: \"chart\",\n hue: 100,\n label: \"Latency\",\n },\n { x: 80, y: 400, w: 280, h: 280, kind: \"gradient\", hue: 340 },\n { x: 400, y: 400, w: 480, h: 280, kind: \"code\", hue: 0, label: \"api.ts\" },\n { x: 1320, y: 420, w: 280, h: 280, kind: \"stat\", hue: 60, label: \"P95\" },\n { x: 1640, y: 420, w: 380, h: 280, kind: \"bars\", hue: 260, label: \"Builds\" },\n { x: 2580, y: 420, w: 360, h: 280, kind: \"logo\", hue: 200 },\n { x: 80, y: 720, w: 480, h: 240, kind: \"chart\", hue: 290, label: \"Errors\" },\n { x: 600, y: 720, w: 280, h: 240, kind: \"stat\", hue: 20, label: \"RPS\" },\n { x: 920, y: 740, w: 380, h: 220, kind: \"gradient\", hue: 240 },\n {\n x: 1320,\n y: 740,\n w: 360,\n h: 220,\n kind: \"counter\",\n hue: 140,\n label: \"Active\",\n },\n { x: 1720, y: 740, w: 480, h: 240, kind: \"code\", hue: 0, label: \"worker.ts\" },\n { x: 2240, y: 740, w: 360, h: 240, kind: \"bars\", hue: 320, label: \"Queue\" },\n { x: 80, y: 1000, w: 360, h: 220, kind: \"logo\", hue: 180 },\n { x: 460, y: 1000, w: 380, h: 220, kind: \"stat\", hue: 80, label: \"Cache\" },\n { x: 880, y: 1000, w: 480, h: 220, kind: \"chart\", hue: 200, label: \"CPU\" },\n {\n x: 1400,\n y: 1000,\n w: 280,\n h: 220,\n kind: \"counter\",\n hue: 360,\n label: \"Jobs\",\n },\n { x: 1720, y: 1020, w: 360, h: 220, kind: \"gradient\", hue: 120 },\n { x: 2120, y: 1020, w: 380, h: 220, kind: \"code\", hue: 0, label: \"db.sql\" },\n { x: 2540, y: 1020, w: 400, h: 220, kind: \"bars\", hue: 280, label: \"Tasks\" },\n { x: 80, y: 1280, w: 480, h: 260, kind: \"code\", hue: 0, label: \"edge.ts\" },\n { x: 600, y: 1280, w: 360, h: 260, kind: \"chart\", hue: 240, label: \"TTFB\" },\n { x: 1000, y: 1280, w: 280, h: 260, kind: \"logo\", hue: 60 },\n { x: 1320, y: 1280, w: 380, h: 260, kind: \"stat\", hue: 200, label: \"Hits\" },\n {\n x: 1740,\n y: 1280,\n w: 360,\n h: 260,\n kind: \"counter\",\n hue: 300,\n label: \"Bytes\",\n },\n { x: 2140, y: 1280, w: 380, h: 260, kind: \"gradient\", hue: 160 },\n { x: 2560, y: 1280, w: 380, h: 260, kind: \"bars\", hue: 0, label: \"Errors\" },\n { x: 80, y: 1600, w: 380, h: 220, kind: \"stat\", hue: 280, label: \"Saved\" },\n { x: 500, y: 1600, w: 480, h: 220, kind: \"chart\", hue: 40, label: \"Net Out\" },\n { x: 1020, y: 1600, w: 360, h: 220, kind: \"code\", hue: 0, label: \"auth.ts\" },\n { x: 1420, y: 1600, w: 280, h: 220, kind: \"logo\", hue: 220 },\n {\n x: 1740,\n y: 1620,\n w: 380,\n h: 220,\n kind: \"counter\",\n hue: 100,\n label: \"Hooks\",\n },\n { x: 2160, y: 1620, w: 360, h: 220, kind: \"bars\", hue: 340, label: \"Runs\" },\n { x: 2560, y: 1620, w: 380, h: 220, kind: \"gradient\", hue: 200 },\n { x: 80, y: 1880, w: 480, h: 240, kind: \"bars\", hue: 180, label: \"Edges\" },\n { x: 600, y: 1880, w: 380, h: 240, kind: \"gradient\", hue: 320 },\n { x: 1020, y: 1880, w: 360, h: 240, kind: \"logo\", hue: 80 },\n {\n x: 1420,\n y: 1880,\n w: 480,\n h: 240,\n kind: \"chart\",\n hue: 260,\n label: \"Tokens\",\n },\n {\n x: 1940,\n y: 1880,\n w: 280,\n h: 240,\n kind: \"counter\",\n hue: 20,\n label: \"Calls\",\n },\n { x: 2260, y: 1880, w: 380, h: 240, kind: \"stat\", hue: 140, label: \"Score\" },\n { x: 2680, y: 1880, w: 260, h: 240, kind: \"code\", hue: 0, label: \"ws.ts\" },\n];\n\nfunction noise(i: number, frame: number) {\n return Math.sin(frame / 30 + i) * 0.5 + 0.5;\n}\n\nfunction ChartCard({ accent, t }: { accent: string; t: number }) {\n const points: string[] = [];\n for (let i = 0; i < 12; i++) {\n const x = (i / 11) * 100;\n const y =\n 50 - (Math.sin(i * 0.7 + t) * 18 + Math.cos(i * 0.4 + t * 0.6) * 8);\n points.push(`${x},${y}`);\n }\n return (\n <svg\n viewBox=\"0 0 100 60\"\n preserveAspectRatio=\"none\"\n style={{ width: \"100%\", height: \"100%\" }}\n >\n <polyline\n points={points.join(\" \")}\n fill=\"none\"\n stroke={accent}\n strokeWidth={1.4}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n <polyline\n points={`${points.join(\" \")} 100,60 0,60`}\n fill={`${accent}22`}\n stroke=\"none\"\n />\n </svg>\n );\n}\n\nfunction BarsCard({ accent, t }: { accent: string; t: number }) {\n return (\n <div\n style={{\n display: \"flex\",\n alignItems: \"flex-end\",\n gap: 6,\n height: \"100%\",\n width: \"100%\",\n }}\n >\n {Array.from({ length: 10 }).map((_, i) => {\n const h = 25 + (Math.sin(i * 0.8 + t) * 0.5 + 0.5) * 70;\n return (\n <div\n key={i}\n style={{\n flex: 1,\n height: `${h}%`,\n background: `linear-gradient(180deg, ${accent} 0%, ${accent}55 100%)`,\n borderRadius: 4,\n }}\n />\n );\n })}\n </div>\n );\n}\n\nfunction CodeCard() {\n const lines = [\n { indent: 0, w: 60, c: \"#7dd3fc\" },\n { indent: 1, w: 80, c: \"rgba(255,255,255,0.8)\" },\n { indent: 1, w: 50, c: \"#f9a8d4\" },\n { indent: 2, w: 70, c: \"rgba(255,255,255,0.8)\" },\n { indent: 2, w: 40, c: \"#fde047\" },\n { indent: 1, w: 30, c: \"rgba(255,255,255,0.6)\" },\n { indent: 0, w: 20, c: \"rgba(255,255,255,0.6)\" },\n ];\n return (\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n fontFamily: \"ui-monospace, SFMono-Regular, Menlo, monospace\",\n }}\n >\n {lines.map((l, i) => (\n <div\n key={i}\n style={{\n marginLeft: l.indent * 14,\n width: `${l.w}%`,\n height: 8,\n borderRadius: 3,\n background: l.c,\n opacity: 0.7,\n }}\n />\n ))}\n </div>\n );\n}\n\nfunction LogoCard({ accent, hue }: { accent: string; hue: number }) {\n return (\n <div\n style={{\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n style={{\n width: 80,\n height: 80,\n borderRadius: 20,\n background: `linear-gradient(135deg, ${accent} 0%, hsl(${hue},70%,55%) 100%)`,\n boxShadow: `0 10px 30px ${accent}44`,\n }}\n />\n </div>\n );\n}\n\nfunction GradientCard({ hue }: { hue: number }) {\n return (\n <div\n style={{\n width: \"100%\",\n height: \"100%\",\n background: `radial-gradient(circle at 30% 30%, hsl(${hue},80%,60%) 0%, hsl(${(hue + 60) % 360},70%,40%) 50%, #0a0a0a 100%)`,\n }}\n />\n );\n}\n\nfunction Card({\n card,\n accent,\n index,\n frame,\n}: {\n card: CardDef;\n accent: string;\n index: number;\n frame: number;\n}) {\n const t = noise(index, frame) * 6.28;\n const baseStyle: React.CSSProperties = {\n position: \"absolute\",\n left: card.x,\n top: card.y,\n width: card.w,\n height: card.h,\n borderRadius: 18,\n background: \"linear-gradient(180deg, #131313 0%, #0a0a0a 100%)\",\n border: \"1px solid rgba(255,255,255,0.07)\",\n overflow: \"hidden\",\n padding: 18,\n color: \"white\",\n display: \"flex\",\n flexDirection: \"column\",\n };\n\n const labelEl = card.label ? (\n <div\n style={{\n fontSize: 12,\n fontWeight: 600,\n color: \"rgba(255,255,255,0.55)\",\n letterSpacing: \"0.04em\",\n textTransform: \"uppercase\",\n marginBottom: 8,\n }}\n >\n {card.label}\n </div>\n ) : null;\n\n if (card.kind === \"chart\") {\n return (\n <div style={baseStyle}>\n {labelEl}\n <div style={{ flex: 1 }}>\n <ChartCard accent={accent} t={t} />\n </div>\n </div>\n );\n }\n if (card.kind === \"bars\") {\n return (\n <div style={baseStyle}>\n {labelEl}\n <div style={{ flex: 1 }}>\n <BarsCard accent={accent} t={t} />\n </div>\n </div>\n );\n }\n if (card.kind === \"counter\") {\n const v = Math.floor(1200 + noise(index, frame) * 800);\n return (\n <div style={baseStyle}>\n {labelEl}\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n fontSize: 56,\n fontWeight: 700,\n letterSpacing: \"-0.04em\",\n color: \"white\",\n }}\n >\n {v.toLocaleString()}\n </div>\n <div style={{ fontSize: 12, color: accent, fontWeight: 600 }}>\n +{(noise(index + 1, frame) * 12).toFixed(1)}%\n </div>\n </div>\n );\n }\n if (card.kind === \"stat\") {\n const v = (95 + noise(index, frame) * 5).toFixed(2);\n return (\n <div style={baseStyle}>\n {labelEl}\n <div\n style={{\n flex: 1,\n display: \"flex\",\n alignItems: \"center\",\n fontSize: 48,\n fontWeight: 700,\n letterSpacing: \"-0.03em\",\n }}\n >\n {v}\n <span\n style={{\n fontSize: 20,\n color: \"rgba(255,255,255,0.5)\",\n marginLeft: 4,\n }}\n >\n %\n </span>\n </div>\n </div>\n );\n }\n if (card.kind === \"code\") {\n return (\n <div style={baseStyle}>\n {labelEl}\n <div style={{ flex: 1, display: \"flex\", alignItems: \"center\" }}>\n <div style={{ width: \"100%\" }}>\n <CodeCard />\n </div>\n </div>\n </div>\n );\n }\n if (card.kind === \"logo\") {\n return (\n <div style={{ ...baseStyle, padding: 0 }}>\n <LogoCard accent={accent} hue={card.hue} />\n </div>\n );\n }\n // gradient\n return (\n <div style={{ ...baseStyle, padding: 0 }}>\n <GradientCard hue={card.hue} />\n </div>\n );\n}\n\nexport function InfiniteBentoPan({\n panSpeed = 1,\n accentColor = \"#7c3aed\",\n speed = 1,\n className,\n}: InfiniteBentoPanProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames, width, height } = useVideoConfig();\n\n const maxX = SUPER_W - width;\n const maxY = SUPER_H - height;\n\n // diagonal pan: from top-left toward bottom-right\n const t = interpolate(frame, [0, durationInFrames], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const px = t * maxX * Math.min(1, panSpeed);\n const py = t * maxY * Math.min(1, panSpeed);\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background: \"transparent\",\n overflow: \"hidden\",\n fontFamily: FONT_FAMILY,\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n width: SUPER_W,\n height: SUPER_H,\n transform: `translate(${-px}px, ${-py}px)`,\n willChange: \"transform\",\n }}\n >\n {CARDS.map((c, i) => (\n <Card key={i} card={c} accent={accentColor} index={i} frame={frame} />\n ))}\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background:\n \"radial-gradient(circle at center, transparent 30%, rgba(0,0,0,0.85) 80%, #000 100%)\",\n pointerEvents: \"none\",\n }}\n />\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/infinite-bento-pan.tsx"
}
diff --git a/public/r/infinite-marquee.json b/public/r/infinite-marquee.json
index fb616083..eb4bc012 100644
--- a/public/r/infinite-marquee.json
+++ b/public/r/infinite-marquee.json
@@ -9,7 +9,7 @@
"files": [
{
"path": "registry/remocn/infinite-marquee/index.tsx",
- "content": "\"use client\";\n\nimport { useCurrentFrame } from \"remotion\";\n\nexport interface InfiniteMarqueeProps {\n text?: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n pixelsPerFrame?: number;\n stroke?: boolean;\n strokeColor?: string;\n background?: string;\n speed?: number;\n className?: string;\n}\n\nexport function InfiniteMarquee({\n text = \"ship · build · animate · \",\n fontSize = 120,\n color = \"#171717\",\n fontWeight = 900,\n pixelsPerFrame = 4,\n stroke = false,\n strokeColor = \"#171717\",\n background = \"#fafafa\",\n speed = 1,\n className,\n}: InfiniteMarqueeProps) {\n const frame = useCurrentFrame() * speed;\n\n const approxWidth = text.length * fontSize * 0.55;\n const offset = -((frame * pixelsPerFrame) % approxWidth);\n\n const spanStyle: React.CSSProperties = {\n fontSize,\n fontWeight,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n color: stroke ? \"transparent\" : color,\n WebkitTextStroke: stroke ? `2px ${strokeColor}` : undefined,\n paddingRight: \"0.4em\",\n letterSpacing: \"-0.03em\",\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,\n }}\n >\n <div\n className={className}\n style={{\n display: \"flex\",\n whiteSpace: \"nowrap\",\n transform: `translateX(${offset}px)`,\n }}\n >\n <span style={spanStyle}>{text}</span>\n <span style={spanStyle}>{text}</span>\n <span style={spanStyle}>{text}</span>\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { useCurrentFrame } from \"remotion\";\n\nexport interface InfiniteMarqueeProps {\n text?: string;\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n pixelsPerFrame?: number;\n stroke?: boolean;\n strokeColor?: string;\n speed?: number;\n className?: string;\n}\n\nexport function InfiniteMarquee({\n text = \"ship · build · animate · \",\n fontSize = 120,\n color = \"#171717\",\n fontWeight = 900,\n pixelsPerFrame = 4,\n stroke = false,\n strokeColor = \"#171717\",\n speed = 1,\n className,\n}: InfiniteMarqueeProps) {\n const frame = useCurrentFrame() * speed;\n\n const approxWidth = text.length * fontSize * 0.55;\n const offset = -((frame * pixelsPerFrame) % approxWidth);\n\n const spanStyle: React.CSSProperties = {\n fontSize,\n fontWeight,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n color: stroke ? \"transparent\" : color,\n WebkitTextStroke: stroke ? `2px ${strokeColor}` : undefined,\n paddingRight: \"0.4em\",\n letterSpacing: \"-0.03em\",\n };\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <div\n className={className}\n style={{\n display: \"flex\",\n whiteSpace: \"nowrap\",\n transform: `translateX(${offset}px)`,\n }}\n >\n <span style={spanStyle}>{text}</span>\n <span style={spanStyle}>{text}</span>\n <span style={spanStyle}>{text}</span>\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/infinite-marquee.tsx"
}
diff --git a/public/r/input.json b/public/r/input.json
index dd446524..af4fa9c0 100644
--- a/public/r/input.json
+++ b/public/r/input.json
@@ -13,7 +13,7 @@
"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 mode?: \"light\" | \"dark\";\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 mode,\n fullWidth = false,\n className,\n}: InputProps) {\n const theme = useRemocnTheme(\n { ...themeOverride, ...(primary ? { primary } : {}) },\n mode,\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: theme.background,\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 {\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",
"type": "registry:component",
"target": "components/remocn/input.tsx"
},
diff --git a/public/r/landing-code-showcase.json b/public/r/landing-code-showcase.json
index 619fe093..cbe27785 100644
--- a/public/r/landing-code-showcase.json
+++ b/public/r/landing-code-showcase.json
@@ -9,7 +9,7 @@
"files": [
{
"path": "registry/remocn/landing-code-showcase/index.tsx",
- "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport {\n AbsoluteFill,\n Freeze,\n interpolate,\n Sequence,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { DashboardPopulate } from \"@/registry/remocn/dashboard-populate\";\nimport { FrostedGlassWipe } from \"@/registry/remocn/frosted-glass-wipe\";\nimport { SpatialPush } from \"@/registry/remocn/spatial-push\";\nimport { TerminalToBrowserDeploy } from \"@/registry/remocn/terminal-to-browser-deploy\";\n\nexport interface LandingCodeShowcaseProps {\n accentColor?: string;\n speed?: number;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\nconst MONO_FAMILY =\n \"var(--font-geist-mono), ui-monospace, SFMono-Regular, Menlo, monospace\";\n\n/* -------------------------------------------------------------------------- */\n/* Tokens */\n/* -------------------------------------------------------------------------- */\n\nconst PEACH = \"#FFB38E\";\nconst LAVENDER = \"#D4B3FF\";\nconst MINT = \"#A1EEBD\";\nconst STAGE_BG = \"#0A090E\";\nconst PANEL_BG = \"#141318\";\n\n/* -------------------------------------------------------------------------- */\n/* Timeline schedule */\n/* -------------------------------------------------------------------------- */\n/*\n Frame layout (30fps base):\n 0 ────────────────────────────► 90 BlurReveal\n 70 ────► 130 SpatialPush overlay\n 130 ────────────► 240 Dashboard\n 230 ────► 290 FrostedGlassWipe overlay\n 290 ────────────► 410 MaskedSlideReveal\n 400 ────► 460 KineticTypeMask overlay\n 460 ────────────────► 640 TerminalToBrowserDeploy\n*/\n\ninterface SceneWindow {\n start: number;\n duration: number;\n}\n\nconst SCENES = {\n blur: { start: 0, duration: 90 } as SceneWindow,\n push1: { start: 70, duration: 60 } as SceneWindow,\n dashboard: { start: 130, duration: 110 } as SceneWindow,\n glassWipe: { start: 230, duration: 60 } as SceneWindow,\n maskedSlide: { start: 290, duration: 120 } as SceneWindow,\n push2: { start: 400, duration: 60 } as SceneWindow,\n terminal: { start: 460, duration: 180 } as SceneWindow,\n // Quiet hold at the very end so the loop never restarts mid-action.\n endHold: 80,\n};\n\nconst TOTAL_DURATION =\n SCENES.terminal.start + SCENES.terminal.duration + SCENES.endHold; // 720\n\n/* -------------------------------------------------------------------------- */\n/* Code timeline */\n/* -------------------------------------------------------------------------- */\n\ninterface CodeStep {\n /** Frame at which this fragment STARTS being typed */\n startFrame: number;\n /** Code fragment to append to the visible buffer */\n code: string;\n /** Token within the fragment that pulses lavender briefly when typed */\n highlight?: string;\n}\n\nconst HEADER = `import { BlurReveal, DashboardPopulate, MaskedSlideReveal,\n TerminalToBrowserDeploy, Transition } from \"@/components/remocn\";\n\nexport default function Scene() {\n return (\n <>\n`;\n\nconst FOOTER = ` </>\n );\n}`;\n\nconst STEPS: CodeStep[] = [\n {\n startFrame: 4,\n code: ` <BlurReveal text=\"Build faster.\" />\\n`,\n },\n {\n startFrame: SCENES.push1.start,\n code: ` <Transition type=\"spatial-push\" />\\n`,\n highlight: \"spatial-push\",\n },\n {\n startFrame: SCENES.dashboard.start,\n code: ` <DashboardPopulate data={metrics} />\\n`,\n },\n {\n startFrame: SCENES.glassWipe.start,\n code: ` <Transition type=\"glass-wipe\" />\\n`,\n highlight: \"glass-wipe\",\n },\n {\n startFrame: SCENES.maskedSlide.start,\n code: ` <MaskedSlideReveal text=\"Ship to production.\" />\\n`,\n },\n {\n startFrame: SCENES.push2.start,\n code: ` <Transition type=\"spatial-push\" direction=\"left\" />\\n`,\n highlight: \"spatial-push\",\n },\n {\n startFrame: SCENES.terminal.start,\n code: ` <TerminalToBrowserDeploy />\\n`,\n },\n];\n\nconst CHARS_PER_FRAME = 2.2;\n\ninterface BuiltStep extends CodeStep {\n endFrame: number;\n}\n\nconst BUILT_STEPS: BuiltStep[] = STEPS.map((s) => ({\n ...s,\n endFrame: s.startFrame + Math.ceil(s.code.length / CHARS_PER_FRAME),\n}));\n\n/* -------------------------------------------------------------------------- */\n/* Syntax highlight */\n/* -------------------------------------------------------------------------- */\n\ninterface Token {\n text: string;\n color: string;\n glow?: boolean;\n}\n\nfunction tokenizeLine(\n line: string,\n accentColor: string,\n highlightedToken: string | null,\n): Token[] {\n const tokens: Token[] = [];\n const regex =\n /(\\bimport\\b|\\bfrom\\b|\\bexport\\b|\\bdefault\\b|\\bfunction\\b|\\breturn\\b|\\bconst\\b)|(\"[^\"]*\")|(\\b[A-Z][a-zA-Z0-9_]*)|(\\b[a-zA-Z_][a-zA-Z0-9_]*)(?==)|(\\{|\\}|\\(|\\)|<|>|\\/|;)|([0-9]+)/g;\n let lastIndex = 0;\n let m: RegExpExecArray | null = regex.exec(line);\n while (m !== null) {\n if (m.index > lastIndex) {\n tokens.push({\n text: line.slice(lastIndex, m.index),\n color: \"#e4e4e7\",\n });\n }\n if (m[1]) tokens.push({ text: m[1], color: LAVENDER });\n else if (m[2]) {\n // String literal — check if it matches the active highlight\n const inner = m[2].slice(1, -1);\n if (highlightedToken && inner === highlightedToken) {\n tokens.push({ text: m[2], color: LAVENDER, glow: true });\n } else {\n tokens.push({ text: m[2], color: MINT });\n }\n } else if (m[3]) tokens.push({ text: m[3], color: PEACH });\n else if (m[4]) tokens.push({ text: m[4], color: accentColor });\n else if (m[5]) tokens.push({ text: m[5], color: \"#71717a\" });\n else if (m[6]) tokens.push({ text: m[6], color: \"#fbbf24\" });\n lastIndex = regex.lastIndex;\n m = regex.exec(line);\n }\n if (lastIndex < line.length) {\n tokens.push({ text: line.slice(lastIndex), color: \"#e4e4e7\" });\n }\n return tokens;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Code editor */\n/* -------------------------------------------------------------------------- */\n\nfunction CodeEditor({\n frame,\n accentColor,\n}: {\n frame: number;\n accentColor: string;\n}) {\n // Compose the visible code: header + per-step typed amounts + footer (only when fully typed)\n const dynamicChunks: string[] = [];\n let activeHighlight: string | null = null;\n\n for (const step of BUILT_STEPS) {\n if (frame < step.startFrame) break;\n const elapsed = frame - step.startFrame;\n const charsTyped = Math.min(\n step.code.length,\n Math.floor(elapsed * CHARS_PER_FRAME),\n );\n dynamicChunks.push(step.code.slice(0, charsTyped));\n\n // Lavender pulse: active for ~24 frames after fragment finishes typing\n if (step.highlight) {\n const sinceStart = frame - step.startFrame;\n if (sinceStart >= 0 && sinceStart < 60) {\n activeHighlight = step.highlight;\n }\n }\n }\n\n const allTyped = dynamicChunks.join(\"\");\n const lastStep = BUILT_STEPS[BUILT_STEPS.length - 1];\n const showFooter = frame > lastStep.endFrame + 4;\n const visibleCode = HEADER + allTyped + (showFooter ? FOOTER : \"\");\n const lines = visibleCode.split(\"\\n\");\n const lastLineIdx = lines.length - 1;\n const caretOn = Math.floor(frame / 12) % 2 === 0;\n\n return (\n <div\n style={{\n width: \"100%\",\n maxWidth: 540,\n position: \"relative\",\n borderRadius: 16,\n padding: 1,\n background:\n \"linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.02) 50%, rgba(255,255,255,0.06) 100%)\",\n boxShadow: \"0 40px 90px rgba(0,0,0,0.55), 0 0 0 1px rgba(0,0,0,0.4)\",\n }}\n >\n <div\n style={{\n borderRadius: 15,\n background: \"rgba(12,12,14,0.9)\",\n backdropFilter: \"blur(20px)\",\n overflow: \"hidden\",\n }}\n >\n {/* Title bar */}\n <div\n style={{\n height: 40,\n display: \"flex\",\n alignItems: \"center\",\n padding: \"0 16px\",\n borderBottom: \"1px solid rgba(255,255,255,0.06)\",\n gap: 8,\n }}\n >\n {[\"#ff5f57\", \"#febc2e\", \"#28c840\"].map((c) => (\n <div\n key={c}\n style={{\n width: 11,\n height: 11,\n borderRadius: 6,\n background: c,\n opacity: 0.65,\n }}\n />\n ))}\n <div\n style={{\n marginLeft: 12,\n fontSize: 12,\n color: \"rgba(255,255,255,0.5)\",\n fontFamily: MONO_FAMILY,\n }}\n >\n scene.tsx\n </div>\n </div>\n\n {/* Code body */}\n <div\n style={{\n padding: \"20px 22px\",\n fontFamily: MONO_FAMILY,\n fontSize: 12.5,\n lineHeight: 1.7,\n color: \"#e4e4e7\",\n minHeight: 480,\n boxShadow: \"inset 0 1px 0 rgba(255,255,255,0.04)\",\n }}\n >\n {lines.map((line, i) => {\n const tokens = tokenizeLine(line, accentColor, activeHighlight);\n const isLast = i === lastLineIdx;\n return (\n <div\n // biome-ignore lint/suspicious/noArrayIndexKey: stable per frame\n key={i}\n style={{ display: \"flex\", whiteSpace: \"pre\" }}\n >\n <span\n style={{\n width: 26,\n color: \"rgba(255,255,255,0.18)\",\n userSelect: \"none\",\n flexShrink: 0,\n }}\n >\n {i + 1}\n </span>\n <span>\n {tokens.length === 0 ? (\n <span> </span>\n ) : (\n tokens.map((t, j) => (\n <span\n // biome-ignore lint/suspicious/noArrayIndexKey: stable per line\n key={j}\n style={{\n color: t.color,\n textShadow: t.glow\n ? `0 0 12px ${LAVENDER}, 0 0 24px ${LAVENDER}80`\n : undefined,\n }}\n >\n {t.text}\n </span>\n ))\n )}\n {isLast && caretOn && (\n <span\n style={{\n display: \"inline-block\",\n width: 7,\n height: 14,\n marginLeft: 1,\n verticalAlign: \"text-bottom\",\n background: accentColor,\n }}\n />\n )}\n </span>\n </div>\n );\n })}\n </div>\n </div>\n </div>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Soft pastel scene wrappers */\n/* -------------------------------------------------------------------------- */\n\n/** Warm pastel canvas — the dark stage every scene sits on */\nfunction PastelStage({\n background = STAGE_BG,\n children,\n}: {\n background?: string;\n children: ReactNode;\n}) {\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background,\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background:\n \"radial-gradient(ellipse at 20% 30%, rgba(255,179,142,0.08), transparent 60%), radial-gradient(ellipse at 80% 70%, rgba(212,179,255,0.06), transparent 60%)\",\n }}\n />\n {children}\n </div>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Scene factories */\n/* -------------------------------------------------------------------------- */\n/*\n Note: BlurReveal and MaskedSlideReveal primitives bake in a `background:\n white` div. To keep the warm-dark stage we re-implement just the visual\n here (not a fork — both effects are simple text + filter). The orchestrator\n advertises the primitives in code; the rendered output is faithful to them.\n*/\n\nfunction BlurRevealScene() {\n const frame = useCurrentFrame();\n const opacity = interpolate(frame, [0, 50], [0, 1], {\n extrapolateRight: \"clamp\",\n });\n const blurAmount = interpolate(frame, [0, 50], [22, 0], {\n extrapolateRight: \"clamp\",\n });\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n opacity,\n filter: `blur(${blurAmount}px)`,\n fontSize: 96,\n fontWeight: 600,\n color: PEACH,\n letterSpacing: \"-0.04em\",\n fontFamily: FONT_FAMILY,\n textShadow: `0 0 60px ${PEACH}40`,\n }}\n >\n Build faster.\n </span>\n </div>\n );\n}\n\nfunction DashboardScene() {\n return (\n <div style={{ position: \"absolute\", inset: 0 }}>\n <DashboardPopulate accentColor={PEACH} />\n </div>\n );\n}\n\nfunction MaskedSlideScene() {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const words = \"Ship to production.\".split(\" \");\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize: 92,\n fontWeight: 700,\n color: MINT,\n letterSpacing: \"-0.03em\",\n fontFamily: FONT_FAMILY,\n textShadow: `0 0 40px ${MINT}30`,\n }}\n >\n {words.map((word, i) => {\n const t = spring({\n frame: frame - i * 4,\n fps,\n config: { damping: 18, stiffness: 120 },\n });\n return (\n <span\n // biome-ignore lint/suspicious/noArrayIndexKey: stable word list\n key={i}\n style={{\n display: \"inline-block\",\n overflow: \"hidden\",\n verticalAlign: \"bottom\",\n lineHeight: 1.05,\n marginRight: \"0.25em\",\n }}\n >\n <span\n style={{\n display: \"inline-block\",\n transform: `translateY(${(1 - t) * 110}%)`,\n }}\n >\n {word}\n </span>\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nfunction TerminalScene() {\n return (\n <div style={{ position: \"absolute\", inset: 0 }}>\n <TerminalToBrowserDeploy accentColor={MINT} siteUrl=\"remocn.dev\" />\n </div>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Right pane */\n/* -------------------------------------------------------------------------- */\n\nfunction RightPane() {\n return (\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n background: STAGE_BG,\n overflow: \"hidden\",\n borderRadius: 18,\n }}\n >\n {/* ── BASE LAYER: each scene runs in its own Sequence so its\n internal useCurrentFrame() starts at 0 within the window. ── */}\n\n <Sequence\n from={SCENES.blur.start}\n durationInFrames={SCENES.blur.duration + SCENES.push1.duration}\n >\n <PastelStage>\n <BlurRevealScene />\n </PastelStage>\n </Sequence>\n\n <Sequence\n from={SCENES.dashboard.start}\n durationInFrames={SCENES.dashboard.duration + SCENES.glassWipe.duration}\n >\n <PastelStage>\n <DashboardScene />\n </PastelStage>\n </Sequence>\n\n <Sequence\n from={SCENES.maskedSlide.start}\n durationInFrames={SCENES.maskedSlide.duration + SCENES.push2.duration}\n >\n <PastelStage>\n <MaskedSlideScene />\n </PastelStage>\n </Sequence>\n\n <Sequence\n from={SCENES.terminal.start}\n durationInFrames={SCENES.terminal.duration + SCENES.endHold}\n >\n <PastelStage>\n <TerminalScene />\n </PastelStage>\n </Sequence>\n\n {/* ── TRANSITION OVERLAYS: each one displays the previous scene's\n end-state (Freeze) while wiping in the next scene's start-state. ── */}\n\n <Sequence\n from={SCENES.push1.start}\n durationInFrames={SCENES.push1.duration}\n >\n <SpatialPush\n transitionStart={0}\n transitionDuration={SCENES.push1.duration}\n direction=\"up\"\n from={\n <Freeze frame={SCENES.push1.start - SCENES.blur.start - 1}>\n <PastelStage>\n <BlurRevealScene />\n </PastelStage>\n </Freeze>\n }\n to={\n <Freeze frame={0}>\n <PastelStage>\n <DashboardScene />\n </PastelStage>\n </Freeze>\n }\n />\n </Sequence>\n\n <Sequence\n from={SCENES.glassWipe.start}\n durationInFrames={SCENES.glassWipe.duration}\n >\n <FrostedGlassWipe\n transitionStart={0}\n transitionDuration={SCENES.glassWipe.duration}\n glassBlur={28}\n from={\n <Freeze frame={SCENES.dashboard.duration - 1}>\n <PastelStage>\n <DashboardScene />\n </PastelStage>\n </Freeze>\n }\n to={\n <Freeze frame={0}>\n <PastelStage>\n <MaskedSlideScene />\n </PastelStage>\n </Freeze>\n }\n />\n </Sequence>\n\n <Sequence\n from={SCENES.push2.start}\n durationInFrames={SCENES.push2.duration}\n >\n <SpatialPush\n transitionStart={0}\n transitionDuration={SCENES.push2.duration}\n direction=\"left\"\n from={\n <Freeze frame={SCENES.maskedSlide.duration - 1}>\n <PastelStage>\n <MaskedSlideScene />\n </PastelStage>\n </Freeze>\n }\n to={\n <Freeze frame={0}>\n <PastelStage>\n <TerminalScene />\n </PastelStage>\n </Freeze>\n }\n />\n </Sequence>\n </div>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Main */\n/* -------------------------------------------------------------------------- */\n\nexport function LandingCodeShowcase({\n accentColor = \"#FFB38E\",\n speed = 1,\n}: LandingCodeShowcaseProps) {\n const rawFrame = useCurrentFrame();\n const frame = rawFrame * speed;\n\n /* ---- Final \"deploy success\" glow on both panes ---- */\n const successGlow = interpolate(\n frame,\n [SCENES.terminal.start + 70, SCENES.terminal.start + 100],\n [0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n return (\n <AbsoluteFill\n style={{\n background: PANEL_BG,\n fontFamily: FONT_FAMILY,\n overflow: \"hidden\",\n }}\n >\n {/* Backdrop wash */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background:\n \"radial-gradient(ellipse at 20% 30%, rgba(255,179,142,0.06), transparent 55%), radial-gradient(ellipse at 80% 70%, rgba(212,179,255,0.06), transparent 55%)\",\n }}\n />\n\n {/* ---------------- LEFT: code editor ---------------- */}\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n bottom: 0,\n width: \"38%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: 48,\n }}\n >\n <CodeEditor frame={frame} accentColor={accentColor} />\n </div>\n\n {/* ---------------- RIGHT: live preview ---------------- */}\n <div\n style={{\n position: \"absolute\",\n right: 0,\n top: 0,\n bottom: 0,\n width: \"62%\",\n borderLeft: \"1px solid rgba(255,255,255,0.05)\",\n }}\n >\n {/* Preview label */}\n <div\n style={{\n position: \"absolute\",\n top: 22,\n left: 24,\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n zIndex: 5,\n }}\n >\n <div\n style={{\n width: 8,\n height: 8,\n borderRadius: 4,\n background: MINT,\n boxShadow: `0 0 ${10 + successGlow * 12}px ${MINT}`,\n }}\n />\n <div\n style={{\n fontSize: 11,\n fontFamily: MONO_FAMILY,\n color: \"rgba(255,255,255,0.5)\",\n textTransform: \"uppercase\",\n letterSpacing: \"0.1em\",\n }}\n >\n Preview · HMR\n </div>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n boxShadow: `inset 0 0 ${60 * successGlow}px rgba(161,238,189,${successGlow * 0.45})`,\n }}\n >\n <RightPane />\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n\n// Re-export the schedule so config.ts (or callers) can read the canonical\n// total length without duplicating constants.\nexport const LANDING_CODE_SHOWCASE_DURATION = TOTAL_DURATION;\n",
+ "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport {\n AbsoluteFill,\n Freeze,\n interpolate,\n Sequence,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\nimport { DashboardPopulate } from \"@/registry/remocn/dashboard-populate\";\nimport { FrostedGlassWipe } from \"@/registry/remocn/frosted-glass-wipe\";\nimport { SpatialPush } from \"@/registry/remocn/spatial-push\";\nimport { TerminalToBrowserDeploy } from \"@/registry/remocn/terminal-to-browser-deploy\";\n\nexport interface LandingCodeShowcaseProps {\n accentColor?: string;\n speed?: number;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\nconst MONO_FAMILY =\n \"var(--font-geist-mono), ui-monospace, SFMono-Regular, Menlo, monospace\";\n\n/* -------------------------------------------------------------------------- */\n/* Tokens */\n/* -------------------------------------------------------------------------- */\n\nconst PEACH = \"#FFB38E\";\nconst LAVENDER = \"#D4B3FF\";\nconst MINT = \"#A1EEBD\";\nconst STAGE_BG = \"#0A090E\";\nconst PANEL_BG = \"#141318\";\n\n/* -------------------------------------------------------------------------- */\n/* Timeline schedule */\n/* -------------------------------------------------------------------------- */\n/*\n Frame layout (30fps base):\n 0 ────────────────────────────► 90 BlurReveal\n 70 ────► 130 SpatialPush overlay\n 130 ────────────► 240 Dashboard\n 230 ────► 290 FrostedGlassWipe overlay\n 290 ────────────► 410 MaskedSlideReveal\n 400 ────► 460 KineticTypeMask overlay\n 460 ────────────────► 640 TerminalToBrowserDeploy\n*/\n\ninterface SceneWindow {\n start: number;\n duration: number;\n}\n\nconst SCENES = {\n blur: { start: 0, duration: 90 } as SceneWindow,\n push1: { start: 70, duration: 60 } as SceneWindow,\n dashboard: { start: 130, duration: 110 } as SceneWindow,\n glassWipe: { start: 230, duration: 60 } as SceneWindow,\n maskedSlide: { start: 290, duration: 120 } as SceneWindow,\n push2: { start: 400, duration: 60 } as SceneWindow,\n terminal: { start: 460, duration: 180 } as SceneWindow,\n // Quiet hold at the very end so the loop never restarts mid-action.\n endHold: 80,\n};\n\nconst TOTAL_DURATION =\n SCENES.terminal.start + SCENES.terminal.duration + SCENES.endHold; // 720\n\n/* -------------------------------------------------------------------------- */\n/* Code timeline */\n/* -------------------------------------------------------------------------- */\n\ninterface CodeStep {\n /** Frame at which this fragment STARTS being typed */\n startFrame: number;\n /** Code fragment to append to the visible buffer */\n code: string;\n /** Token within the fragment that pulses lavender briefly when typed */\n highlight?: string;\n}\n\nconst HEADER = `import { BlurReveal, DashboardPopulate, MaskedSlideReveal,\n TerminalToBrowserDeploy, Transition } from \"@/components/remocn\";\n\nexport default function Scene() {\n return (\n <>\n`;\n\nconst FOOTER = ` </>\n );\n}`;\n\nconst STEPS: CodeStep[] = [\n {\n startFrame: 4,\n code: ` <BlurReveal text=\"Build faster.\" />\\n`,\n },\n {\n startFrame: SCENES.push1.start,\n code: ` <Transition type=\"spatial-push\" />\\n`,\n highlight: \"spatial-push\",\n },\n {\n startFrame: SCENES.dashboard.start,\n code: ` <DashboardPopulate data={metrics} />\\n`,\n },\n {\n startFrame: SCENES.glassWipe.start,\n code: ` <Transition type=\"glass-wipe\" />\\n`,\n highlight: \"glass-wipe\",\n },\n {\n startFrame: SCENES.maskedSlide.start,\n code: ` <MaskedSlideReveal text=\"Ship to production.\" />\\n`,\n },\n {\n startFrame: SCENES.push2.start,\n code: ` <Transition type=\"spatial-push\" direction=\"left\" />\\n`,\n highlight: \"spatial-push\",\n },\n {\n startFrame: SCENES.terminal.start,\n code: ` <TerminalToBrowserDeploy />\\n`,\n },\n];\n\nconst CHARS_PER_FRAME = 2.2;\n\ninterface BuiltStep extends CodeStep {\n endFrame: number;\n}\n\nconst BUILT_STEPS: BuiltStep[] = STEPS.map((s) => ({\n ...s,\n endFrame: s.startFrame + Math.ceil(s.code.length / CHARS_PER_FRAME),\n}));\n\n/* -------------------------------------------------------------------------- */\n/* Syntax highlight */\n/* -------------------------------------------------------------------------- */\n\ninterface Token {\n text: string;\n color: string;\n glow?: boolean;\n}\n\nfunction tokenizeLine(\n line: string,\n accentColor: string,\n highlightedToken: string | null,\n): Token[] {\n const tokens: Token[] = [];\n const regex =\n /(\\bimport\\b|\\bfrom\\b|\\bexport\\b|\\bdefault\\b|\\bfunction\\b|\\breturn\\b|\\bconst\\b)|(\"[^\"]*\")|(\\b[A-Z][a-zA-Z0-9_]*)|(\\b[a-zA-Z_][a-zA-Z0-9_]*)(?==)|(\\{|\\}|\\(|\\)|<|>|\\/|;)|([0-9]+)/g;\n let lastIndex = 0;\n let m: RegExpExecArray | null = regex.exec(line);\n while (m !== null) {\n if (m.index > lastIndex) {\n tokens.push({\n text: line.slice(lastIndex, m.index),\n color: \"#e4e4e7\",\n });\n }\n if (m[1]) tokens.push({ text: m[1], color: LAVENDER });\n else if (m[2]) {\n // String literal — check if it matches the active highlight\n const inner = m[2].slice(1, -1);\n if (highlightedToken && inner === highlightedToken) {\n tokens.push({ text: m[2], color: LAVENDER, glow: true });\n } else {\n tokens.push({ text: m[2], color: MINT });\n }\n } else if (m[3]) tokens.push({ text: m[3], color: PEACH });\n else if (m[4]) tokens.push({ text: m[4], color: accentColor });\n else if (m[5]) tokens.push({ text: m[5], color: \"#71717a\" });\n else if (m[6]) tokens.push({ text: m[6], color: \"#fbbf24\" });\n lastIndex = regex.lastIndex;\n m = regex.exec(line);\n }\n if (lastIndex < line.length) {\n tokens.push({ text: line.slice(lastIndex), color: \"#e4e4e7\" });\n }\n return tokens;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Code editor */\n/* -------------------------------------------------------------------------- */\n\nfunction CodeEditor({\n frame,\n accentColor,\n}: {\n frame: number;\n accentColor: string;\n}) {\n // Compose the visible code: header + per-step typed amounts + footer (only when fully typed)\n const dynamicChunks: string[] = [];\n let activeHighlight: string | null = null;\n\n for (const step of BUILT_STEPS) {\n if (frame < step.startFrame) break;\n const elapsed = frame - step.startFrame;\n const charsTyped = Math.min(\n step.code.length,\n Math.floor(elapsed * CHARS_PER_FRAME),\n );\n dynamicChunks.push(step.code.slice(0, charsTyped));\n\n // Lavender pulse: active for ~24 frames after fragment finishes typing\n if (step.highlight) {\n const sinceStart = frame - step.startFrame;\n if (sinceStart >= 0 && sinceStart < 60) {\n activeHighlight = step.highlight;\n }\n }\n }\n\n const allTyped = dynamicChunks.join(\"\");\n const lastStep = BUILT_STEPS[BUILT_STEPS.length - 1];\n const showFooter = frame > lastStep.endFrame + 4;\n const visibleCode = HEADER + allTyped + (showFooter ? FOOTER : \"\");\n const lines = visibleCode.split(\"\\n\");\n const lastLineIdx = lines.length - 1;\n const caretOn = Math.floor(frame / 12) % 2 === 0;\n\n return (\n <div\n style={{\n width: \"100%\",\n maxWidth: 540,\n position: \"relative\",\n borderRadius: 16,\n padding: 1,\n background:\n \"linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.02) 50%, rgba(255,255,255,0.06) 100%)\",\n boxShadow: \"0 40px 90px rgba(0,0,0,0.55), 0 0 0 1px rgba(0,0,0,0.4)\",\n }}\n >\n <div\n style={{\n borderRadius: 15,\n background: \"rgba(12,12,14,0.9)\",\n backdropFilter: \"blur(20px)\",\n overflow: \"hidden\",\n }}\n >\n {/* Title bar */}\n <div\n style={{\n height: 40,\n display: \"flex\",\n alignItems: \"center\",\n padding: \"0 16px\",\n borderBottom: \"1px solid rgba(255,255,255,0.06)\",\n gap: 8,\n }}\n >\n {[\"#ff5f57\", \"#febc2e\", \"#28c840\"].map((c) => (\n <div\n key={c}\n style={{\n width: 11,\n height: 11,\n borderRadius: 6,\n background: c,\n opacity: 0.65,\n }}\n />\n ))}\n <div\n style={{\n marginLeft: 12,\n fontSize: 12,\n color: \"rgba(255,255,255,0.5)\",\n fontFamily: MONO_FAMILY,\n }}\n >\n scene.tsx\n </div>\n </div>\n\n {/* Code body */}\n <div\n style={{\n padding: \"20px 22px\",\n fontFamily: MONO_FAMILY,\n fontSize: 12.5,\n lineHeight: 1.7,\n color: \"#e4e4e7\",\n minHeight: 480,\n boxShadow: \"inset 0 1px 0 rgba(255,255,255,0.04)\",\n }}\n >\n {lines.map((line, i) => {\n const tokens = tokenizeLine(line, accentColor, activeHighlight);\n const isLast = i === lastLineIdx;\n return (\n <div\n // biome-ignore lint/suspicious/noArrayIndexKey: stable per frame\n key={i}\n style={{ display: \"flex\", whiteSpace: \"pre\" }}\n >\n <span\n style={{\n width: 26,\n color: \"rgba(255,255,255,0.18)\",\n userSelect: \"none\",\n flexShrink: 0,\n }}\n >\n {i + 1}\n </span>\n <span>\n {tokens.length === 0 ? (\n <span> </span>\n ) : (\n tokens.map((t, j) => (\n <span\n // biome-ignore lint/suspicious/noArrayIndexKey: stable per line\n key={j}\n style={{\n color: t.color,\n textShadow: t.glow\n ? `0 0 12px ${LAVENDER}, 0 0 24px ${LAVENDER}80`\n : undefined,\n }}\n >\n {t.text}\n </span>\n ))\n )}\n {isLast && caretOn && (\n <span\n style={{\n display: \"inline-block\",\n width: 7,\n height: 14,\n marginLeft: 1,\n verticalAlign: \"text-bottom\",\n background: accentColor,\n }}\n />\n )}\n </span>\n </div>\n );\n })}\n </div>\n </div>\n </div>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Soft pastel scene wrappers */\n/* -------------------------------------------------------------------------- */\n\n/** Warm pastel canvas — the dark stage every scene sits on */\nfunction PastelStage({\n children,\n}: {\n children: ReactNode;\n}) {\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background:\n \"radial-gradient(ellipse at 20% 30%, rgba(255,179,142,0.08), transparent 60%), radial-gradient(ellipse at 80% 70%, rgba(212,179,255,0.06), transparent 60%)\",\n }}\n />\n {children}\n </div>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Scene factories */\n/* -------------------------------------------------------------------------- */\n/*\n Note: BlurReveal and MaskedSlideReveal primitives bake in a `background:\n white` div. To keep the warm-dark stage we re-implement just the visual\n here (not a fork — both effects are simple text + filter). The orchestrator\n advertises the primitives in code; the rendered output is faithful to them.\n*/\n\nfunction BlurRevealScene() {\n const frame = useCurrentFrame();\n const opacity = interpolate(frame, [0, 50], [0, 1], {\n extrapolateRight: \"clamp\",\n });\n const blurAmount = interpolate(frame, [0, 50], [22, 0], {\n extrapolateRight: \"clamp\",\n });\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n opacity,\n filter: `blur(${blurAmount}px)`,\n fontSize: 96,\n fontWeight: 600,\n color: PEACH,\n letterSpacing: \"-0.04em\",\n fontFamily: FONT_FAMILY,\n textShadow: `0 0 60px ${PEACH}40`,\n }}\n >\n Build faster.\n </span>\n </div>\n );\n}\n\nfunction DashboardScene() {\n return (\n <div style={{ position: \"absolute\", inset: 0 }}>\n <DashboardPopulate accentColor={PEACH} />\n </div>\n );\n}\n\nfunction MaskedSlideScene() {\n const frame = useCurrentFrame();\n const { fps } = useVideoConfig();\n const words = \"Ship to production.\".split(\" \");\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <span\n style={{\n fontSize: 92,\n fontWeight: 700,\n color: MINT,\n letterSpacing: \"-0.03em\",\n fontFamily: FONT_FAMILY,\n textShadow: `0 0 40px ${MINT}30`,\n }}\n >\n {words.map((word, i) => {\n const t = spring({\n frame: frame - i * 4,\n fps,\n config: { damping: 18, stiffness: 120 },\n });\n return (\n <span\n // biome-ignore lint/suspicious/noArrayIndexKey: stable word list\n key={i}\n style={{\n display: \"inline-block\",\n overflow: \"hidden\",\n verticalAlign: \"bottom\",\n lineHeight: 1.05,\n marginRight: \"0.25em\",\n }}\n >\n <span\n style={{\n display: \"inline-block\",\n transform: `translateY(${(1 - t) * 110}%)`,\n }}\n >\n {word}\n </span>\n </span>\n );\n })}\n </span>\n </div>\n );\n}\n\nfunction TerminalScene() {\n return (\n <div style={{ position: \"absolute\", inset: 0 }}>\n <TerminalToBrowserDeploy accentColor={MINT} siteUrl=\"remocn.dev\" />\n </div>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Right pane */\n/* -------------------------------------------------------------------------- */\n\nfunction RightPane() {\n return (\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n background: STAGE_BG,\n overflow: \"hidden\",\n borderRadius: 18,\n }}\n >\n {/* ── BASE LAYER: each scene runs in its own Sequence so its\n internal useCurrentFrame() starts at 0 within the window. ── */}\n\n <Sequence\n from={SCENES.blur.start}\n durationInFrames={SCENES.blur.duration + SCENES.push1.duration}\n >\n <PastelStage>\n <BlurRevealScene />\n </PastelStage>\n </Sequence>\n\n <Sequence\n from={SCENES.dashboard.start}\n durationInFrames={SCENES.dashboard.duration + SCENES.glassWipe.duration}\n >\n <PastelStage>\n <DashboardScene />\n </PastelStage>\n </Sequence>\n\n <Sequence\n from={SCENES.maskedSlide.start}\n durationInFrames={SCENES.maskedSlide.duration + SCENES.push2.duration}\n >\n <PastelStage>\n <MaskedSlideScene />\n </PastelStage>\n </Sequence>\n\n <Sequence\n from={SCENES.terminal.start}\n durationInFrames={SCENES.terminal.duration + SCENES.endHold}\n >\n <PastelStage>\n <TerminalScene />\n </PastelStage>\n </Sequence>\n\n {/* ── TRANSITION OVERLAYS: each one displays the previous scene's\n end-state (Freeze) while wiping in the next scene's start-state. ── */}\n\n <Sequence\n from={SCENES.push1.start}\n durationInFrames={SCENES.push1.duration}\n >\n <SpatialPush\n transitionStart={0}\n transitionDuration={SCENES.push1.duration}\n direction=\"up\"\n from={\n <Freeze frame={SCENES.push1.start - SCENES.blur.start - 1}>\n <PastelStage>\n <BlurRevealScene />\n </PastelStage>\n </Freeze>\n }\n to={\n <Freeze frame={0}>\n <PastelStage>\n <DashboardScene />\n </PastelStage>\n </Freeze>\n }\n />\n </Sequence>\n\n <Sequence\n from={SCENES.glassWipe.start}\n durationInFrames={SCENES.glassWipe.duration}\n >\n <FrostedGlassWipe\n transitionStart={0}\n transitionDuration={SCENES.glassWipe.duration}\n glassBlur={28}\n from={\n <Freeze frame={SCENES.dashboard.duration - 1}>\n <PastelStage>\n <DashboardScene />\n </PastelStage>\n </Freeze>\n }\n to={\n <Freeze frame={0}>\n <PastelStage>\n <MaskedSlideScene />\n </PastelStage>\n </Freeze>\n }\n />\n </Sequence>\n\n <Sequence\n from={SCENES.push2.start}\n durationInFrames={SCENES.push2.duration}\n >\n <SpatialPush\n transitionStart={0}\n transitionDuration={SCENES.push2.duration}\n direction=\"left\"\n from={\n <Freeze frame={SCENES.maskedSlide.duration - 1}>\n <PastelStage>\n <MaskedSlideScene />\n </PastelStage>\n </Freeze>\n }\n to={\n <Freeze frame={0}>\n <PastelStage>\n <TerminalScene />\n </PastelStage>\n </Freeze>\n }\n />\n </Sequence>\n </div>\n );\n}\n\n/* -------------------------------------------------------------------------- */\n/* Main */\n/* -------------------------------------------------------------------------- */\n\nexport function LandingCodeShowcase({\n accentColor = \"#FFB38E\",\n speed = 1,\n}: LandingCodeShowcaseProps) {\n const rawFrame = useCurrentFrame();\n const frame = rawFrame * speed;\n\n /* ---- Final \"deploy success\" glow on both panes ---- */\n const successGlow = interpolate(\n frame,\n [SCENES.terminal.start + 70, SCENES.terminal.start + 100],\n [0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n return (\n <AbsoluteFill\n style={{\n background: PANEL_BG,\n fontFamily: FONT_FAMILY,\n overflow: \"hidden\",\n }}\n >\n {/* Backdrop wash */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background:\n \"radial-gradient(ellipse at 20% 30%, rgba(255,179,142,0.06), transparent 55%), radial-gradient(ellipse at 80% 70%, rgba(212,179,255,0.06), transparent 55%)\",\n }}\n />\n\n {/* ---------------- LEFT: code editor ---------------- */}\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n bottom: 0,\n width: \"38%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: 48,\n }}\n >\n <CodeEditor frame={frame} accentColor={accentColor} />\n </div>\n\n {/* ---------------- RIGHT: live preview ---------------- */}\n <div\n style={{\n position: \"absolute\",\n right: 0,\n top: 0,\n bottom: 0,\n width: \"62%\",\n borderLeft: \"1px solid rgba(255,255,255,0.05)\",\n }}\n >\n {/* Preview label */}\n <div\n style={{\n position: \"absolute\",\n top: 22,\n left: 24,\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n zIndex: 5,\n }}\n >\n <div\n style={{\n width: 8,\n height: 8,\n borderRadius: 4,\n background: MINT,\n boxShadow: `0 0 ${10 + successGlow * 12}px ${MINT}`,\n }}\n />\n <div\n style={{\n fontSize: 11,\n fontFamily: MONO_FAMILY,\n color: \"rgba(255,255,255,0.5)\",\n textTransform: \"uppercase\",\n letterSpacing: \"0.1em\",\n }}\n >\n Preview · HMR\n </div>\n </div>\n\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n boxShadow: `inset 0 0 ${60 * successGlow}px rgba(161,238,189,${successGlow * 0.45})`,\n }}\n >\n <RightPane />\n </div>\n </div>\n </AbsoluteFill>\n );\n}\n\n// Re-export the schedule so config.ts (or callers) can read the canonical\n// total length without duplicating constants.\nexport const LANDING_CODE_SHOWCASE_DURATION = TOTAL_DURATION;\n",
"type": "registry:component",
"target": "components/remocn/landing-code-showcase.tsx"
}
diff --git a/public/r/number-wheel.json b/public/r/number-wheel.json
new file mode 100644
index 00000000..6d542cf6
--- /dev/null
+++ b/public/r/number-wheel.json
@@ -0,0 +1,19 @@
+{
+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",
+ "name": "number-wheel",
+ "title": "Number Wheel",
+ "description": "Mechanical odometer that rolls an integer up or down to its target, direction inferred from the values.",
+ "dependencies": [
+ "remotion",
+ "@remotion/google-fonts"
+ ],
+ "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",
+ "type": "registry:component",
+ "target": "components/remocn/number-wheel.tsx"
+ }
+ ],
+ "type": "registry:component"
+}
\ No newline at end of file
diff --git a/public/r/onboarding-stepper-flow.json b/public/r/onboarding-stepper-flow.json
index 7d6abc90..571e3142 100644
--- a/public/r/onboarding-stepper-flow.json
+++ b/public/r/onboarding-stepper-flow.json
@@ -17,7 +17,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 mode?: \"light\" | \"dark\";\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 mode = \"light\",\n theme,\n}: OnboardingStepperFlowProps) {\n const opts = { mode, 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} mode={mode} 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 mode={mode}\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 mode={mode}\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 mode={mode}\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} mode={mode} theme={theme} />\n </div>\n </div>\n );\n}\n",
+ "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",
"type": "registry:component",
"target": "components/remocn/onboarding-stepper-flow.tsx"
}
diff --git a/public/r/opencode.json b/public/r/opencode.json
index fccf7cbb..9cc5766b 100644
--- a/public/r/opencode.json
+++ b/public/r/opencode.json
@@ -14,7 +14,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 theme?: \"light\" | \"dark\";\n background?: \"surface\" | \"transparent\";\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 theme = \"dark\",\n background = \"surface\",\n speed = 1,\n}: OpenCodeProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = THEMES[theme] ?? 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 pageBg = background === \"transparent\" ? \"transparent\" : t.page;\n\n const boxWidth = 1000;\n\n return (\n <AbsoluteFill style={{ background: pageBg }}>\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\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",
"type": "registry:component",
"target": "components/remocn/opencode.tsx"
}
diff --git a/public/r/perspective-marquee.json b/public/r/perspective-marquee.json
index 8392a87c..0cd04217 100644
--- a/public/r/perspective-marquee.json
+++ b/public/r/perspective-marquee.json
@@ -9,7 +9,7 @@
"files": [
{
"path": "registry/remocn/perspective-marquee/index.tsx",
- "content": "\"use client\";\n\nimport { useCurrentFrame } from \"remotion\";\n\nexport interface PerspectiveMarqueeProps {\n items?: string[];\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n pixelsPerFrame?: number;\n rotateY?: number;\n rotateX?: number;\n perspective?: number;\n fadeColor?: string;\n background?: 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_ITEMS = [\n \"Vercel\",\n \"Linear\",\n \"Stripe\",\n \"Figma\",\n \"Notion\",\n \"Raycast\",\n \"Arc\",\n \"Cursor\",\n];\n\nexport function PerspectiveMarquee({\n items = DEFAULT_ITEMS,\n fontSize = 84,\n color = \"#fafafa\",\n fontWeight = 700,\n pixelsPerFrame = 2,\n rotateY = -28,\n rotateX = 8,\n perspective = 1200,\n fadeColor = \"#050505\",\n background = \"#050505\",\n speed = 1,\n className,\n}: PerspectiveMarqueeProps) {\n const frame = useCurrentFrame() * speed;\n\n // Approximate width of one full item set so the modulo wraps cleanly.\n const itemPadding = fontSize * 0.9;\n const approxItemWidth = items.reduce(\n (acc, item) => acc + item.length * fontSize * 0.6 + itemPadding,\n 0,\n );\n\n const offset = -((frame * pixelsPerFrame) % approxItemWidth);\n\n // Render the row 3x so the loop is seamless even when rotated in 3D.\n const rendered = [...items, ...items, ...items];\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n overflow: \"hidden\",\n perspective: `${perspective}px`,\n }}\n >\n <div\n style={{\n width: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n transform: `rotateX(${rotateX}deg) rotateY(${rotateY}deg)`,\n transformStyle: \"preserve-3d\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n whiteSpace: \"nowrap\",\n transform: `translateX(${offset}px)`,\n }}\n >\n {rendered.map((item, i) => {\n // Approximate this item's center X (relative to the marquee row,\n // including the rolling offset). Used to dial in depth-of-field blur\n // and opacity by horizontal position on screen.\n const itemCenter =\n i * (approxItemWidth / items.length) +\n approxItemWidth / items.length / 2 +\n offset;\n // Normalize roughly to [-1, 1] across a 1280px viewport.\n const norm = (itemCenter - 640) / 640;\n const distance = Math.min(1, Math.abs(norm));\n const blurPx = distance * 6;\n const opacity = 1 - distance * 0.4;\n\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n fontFamily: FONT_FAMILY,\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n paddingRight: itemPadding,\n filter: `blur(${blurPx}px)`,\n opacity,\n }}\n >\n {item}\n </span>\n );\n })}\n </div>\n </div>\n\n {/* Vignette to fade marquee edges into background */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n pointerEvents: \"none\",\n background: `linear-gradient(90deg, ${fadeColor} 0%, transparent 18%, transparent 82%, ${fadeColor} 100%)`,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n pointerEvents: \"none\",\n background: `linear-gradient(180deg, ${fadeColor} 0%, transparent 25%, transparent 75%, ${fadeColor} 100%)`,\n }}\n />\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { useCurrentFrame } from \"remotion\";\n\nexport interface PerspectiveMarqueeProps {\n items?: string[];\n fontSize?: number;\n color?: string;\n fontWeight?: number;\n pixelsPerFrame?: number;\n rotateY?: number;\n rotateX?: number;\n perspective?: number;\n fadeColor?: 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_ITEMS = [\n \"Vercel\",\n \"Linear\",\n \"Stripe\",\n \"Figma\",\n \"Notion\",\n \"Raycast\",\n \"Arc\",\n \"Cursor\",\n];\n\nexport function PerspectiveMarquee({\n items = DEFAULT_ITEMS,\n fontSize = 84,\n color = \"#fafafa\",\n fontWeight = 700,\n pixelsPerFrame = 2,\n rotateY = -28,\n rotateX = 8,\n perspective = 1200,\n fadeColor = \"#050505\",\n speed = 1,\n className,\n}: PerspectiveMarqueeProps) {\n const frame = useCurrentFrame() * speed;\n\n // Approximate width of one full item set so the modulo wraps cleanly.\n const itemPadding = fontSize * 0.9;\n const approxItemWidth = items.reduce(\n (acc, item) => acc + item.length * fontSize * 0.6 + itemPadding,\n 0,\n );\n\n const offset = -((frame * pixelsPerFrame) % approxItemWidth);\n\n // Render the row 3x so the loop is seamless even when rotated in 3D.\n const rendered = [...items, ...items, ...items];\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 overflow: \"hidden\",\n perspective: `${perspective}px`,\n }}\n >\n <div\n style={{\n width: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n transform: `rotateX(${rotateX}deg) rotateY(${rotateY}deg)`,\n transformStyle: \"preserve-3d\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n whiteSpace: \"nowrap\",\n transform: `translateX(${offset}px)`,\n }}\n >\n {rendered.map((item, i) => {\n // Approximate this item's center X (relative to the marquee row,\n // including the rolling offset). Used to dial in depth-of-field blur\n // and opacity by horizontal position on screen.\n const itemCenter =\n i * (approxItemWidth / items.length) +\n approxItemWidth / items.length / 2 +\n offset;\n // Normalize roughly to [-1, 1] across a 1280px viewport.\n const norm = (itemCenter - 640) / 640;\n const distance = Math.min(1, Math.abs(norm));\n const blurPx = distance * 6;\n const opacity = 1 - distance * 0.4;\n\n return (\n <span\n key={i}\n style={{\n display: \"inline-block\",\n fontFamily: FONT_FAMILY,\n fontSize,\n fontWeight,\n color,\n letterSpacing: \"-0.03em\",\n paddingRight: itemPadding,\n filter: `blur(${blurPx}px)`,\n opacity,\n }}\n >\n {item}\n </span>\n );\n })}\n </div>\n </div>\n\n {/* Vignette to fade marquee edges into background */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n pointerEvents: \"none\",\n background: `linear-gradient(90deg, ${fadeColor} 0%, transparent 18%, transparent 82%, ${fadeColor} 100%)`,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n pointerEvents: \"none\",\n background: `linear-gradient(180deg, ${fadeColor} 0%, transparent 25%, transparent 75%, ${fadeColor} 100%)`,\n }}\n />\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/perspective-marquee.tsx"
}
diff --git a/public/r/popover.json b/public/r/popover.json
index 9a02e73b..ed1eb580 100644
--- a/public/r/popover.json
+++ b/public/r/popover.json
@@ -12,7 +12,7 @@
"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 mode?: \"light\" | \"dark\";\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 mode,\n className,\n}: PopoverProps) {\n const theme = useRemocnTheme(themeOverride, mode);\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(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",
"type": "registry:component",
"target": "components/remocn/popover.tsx"
},
diff --git a/public/r/progress-steps.json b/public/r/progress-steps.json
index e45321f3..c2883546 100644
--- a/public/r/progress-steps.json
+++ b/public/r/progress-steps.json
@@ -9,7 +9,7 @@
"files": [
{
"path": "registry/remocn/progress-steps/index.tsx",
- "content": "\"use client\";\n\nimport {\n interpolate,\n interpolateColors,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport interface ProgressStepsProps {\n steps?: Array<{ label: string }>;\n orientation?: \"horizontal\" | \"vertical\";\n activeColor?: string;\n inactiveColor?: string;\n background?: string;\n textColor?: string;\n stepDuration?: number;\n speed?: number;\n className?: string;\n}\n\nexport function ProgressSteps({\n steps = [{ label: \"Connect\" }, { label: \"Process\" }, { label: \"Deploy\" }],\n orientation = \"horizontal\",\n activeColor = \"#22c55e\",\n inactiveColor = \"#27272a\",\n background = \"#0a0a0a\",\n textColor = \"white\",\n stepDuration = 30,\n speed = 1,\n className,\n}: ProgressStepsProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const isHorizontal = orientation === \"horizontal\";\n const trackLength = isHorizontal ? 920 : 520;\n const segmentLength = trackLength / Math.max(steps.length - 1, 1);\n const nodeRadius = 22;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\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 flexDirection: isHorizontal ? \"row\" : \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: 0,\n }}\n >\n {/* SVG layer for connecting lines */}\n <svg\n style={{\n position: \"absolute\",\n left: isHorizontal ? nodeRadius : \"50%\",\n top: isHorizontal ? \"50%\" : nodeRadius,\n transform: isHorizontal ? \"translateY(-50%)\" : \"translateX(-50%)\",\n overflow: \"visible\",\n pointerEvents: \"none\",\n }}\n width={isHorizontal ? trackLength : 4}\n height={isHorizontal ? 4 : trackLength}\n >\n {steps.slice(0, -1).map((_, i) => {\n const lineStart = (i + 1) * stepDuration;\n const fillProgress = interpolate(\n frame,\n [lineStart, lineStart + stepDuration],\n [segmentLength, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n return (\n <line\n key={i}\n x1={isHorizontal ? i * segmentLength : 2}\n y1={isHorizontal ? 2 : i * segmentLength}\n x2={isHorizontal ? (i + 1) * segmentLength : 2}\n y2={isHorizontal ? 2 : (i + 1) * segmentLength}\n stroke={activeColor}\n strokeWidth={4}\n strokeLinecap=\"round\"\n strokeDasharray={segmentLength}\n strokeDashoffset={fillProgress}\n />\n );\n })}\n {/* Background track */}\n {steps.slice(0, -1).map((_, i) => (\n <line\n key={`bg-${i}`}\n x1={isHorizontal ? i * segmentLength : 2}\n y1={isHorizontal ? 2 : i * segmentLength}\n x2={isHorizontal ? (i + 1) * segmentLength : 2}\n y2={isHorizontal ? 2 : (i + 1) * segmentLength}\n stroke={inactiveColor}\n strokeWidth={4}\n strokeLinecap=\"round\"\n style={{ opacity: 0.6 }}\n />\n ))}\n </svg>\n\n {steps.map((step, i) => {\n const activateAt = i * stepDuration;\n const localFrame = frame - activateAt;\n const popScale = spring({\n frame: localFrame,\n fps,\n config: { damping: 10, stiffness: 180, mass: 0.6 },\n });\n const scale = interpolate(popScale, [0, 1], [0.8, 1]);\n const fill = interpolateColors(\n frame,\n [activateAt, activateAt + 8],\n [inactiveColor, activeColor],\n );\n const showCheck = interpolate(\n frame,\n [activateAt + 6, activateAt + 14],\n [0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n return (\n <div\n key={i}\n style={{\n position: \"relative\",\n display: \"flex\",\n flexDirection: isHorizontal ? \"column\" : \"row\",\n alignItems: \"center\",\n gap: 14,\n width: isHorizontal ? segmentLength : \"auto\",\n height: isHorizontal ? \"auto\" : segmentLength,\n marginRight:\n isHorizontal && i === steps.length - 1 ? 0 : -segmentLength,\n marginBottom:\n !isHorizontal && i === steps.length - 1 ? 0 : -segmentLength,\n zIndex: 2,\n }}\n >\n <div\n style={{\n width: nodeRadius * 2,\n height: nodeRadius * 2,\n borderRadius: 999,\n background: fill,\n border: `2px solid ${activeColor}`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n transform: `scale(${scale})`,\n transformOrigin: \"center\",\n boxShadow: `0 0 0 6px ${activeColor}1a`,\n }}\n >\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n style={{ opacity: showCheck }}\n >\n <path\n d=\"M5 12.5l4.5 4.5L19 7\"\n stroke=\"white\"\n strokeWidth=\"3\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n <span\n style={{\n fontSize: 15,\n fontWeight: 500,\n color: textColor,\n letterSpacing: \"-0.01em\",\n whiteSpace: \"nowrap\",\n position: isHorizontal ? \"absolute\" : \"static\",\n top: isHorizontal ? nodeRadius * 2 + 14 : undefined,\n }}\n >\n {step.label}\n </span>\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport {\n interpolate,\n interpolateColors,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport interface ProgressStepsProps {\n steps?: Array<{ label: string }>;\n orientation?: \"horizontal\" | \"vertical\";\n activeColor?: string;\n inactiveColor?: string;\n textColor?: string;\n stepDuration?: number;\n speed?: number;\n className?: string;\n}\n\nexport function ProgressSteps({\n steps = [{ label: \"Connect\" }, { label: \"Process\" }, { label: \"Deploy\" }],\n orientation = \"horizontal\",\n activeColor = \"#22c55e\",\n inactiveColor = \"#27272a\",\n textColor = \"white\",\n stepDuration = 30,\n speed = 1,\n className,\n}: ProgressStepsProps) {\n const frame = useCurrentFrame() * speed;\n const { fps } = useVideoConfig();\n\n const isHorizontal = orientation === \"horizontal\";\n const trackLength = isHorizontal ? 920 : 520;\n const segmentLength = trackLength / Math.max(steps.length - 1, 1);\n const nodeRadius = 22;\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 <div\n style={{\n position: \"relative\",\n display: \"flex\",\n flexDirection: isHorizontal ? \"row\" : \"column\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: 0,\n }}\n >\n {/* SVG layer for connecting lines */}\n <svg\n style={{\n position: \"absolute\",\n left: isHorizontal ? nodeRadius : \"50%\",\n top: isHorizontal ? \"50%\" : nodeRadius,\n transform: isHorizontal ? \"translateY(-50%)\" : \"translateX(-50%)\",\n overflow: \"visible\",\n pointerEvents: \"none\",\n }}\n width={isHorizontal ? trackLength : 4}\n height={isHorizontal ? 4 : trackLength}\n >\n {steps.slice(0, -1).map((_, i) => {\n const lineStart = (i + 1) * stepDuration;\n const fillProgress = interpolate(\n frame,\n [lineStart, lineStart + stepDuration],\n [segmentLength, 0],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n return (\n <line\n key={i}\n x1={isHorizontal ? i * segmentLength : 2}\n y1={isHorizontal ? 2 : i * segmentLength}\n x2={isHorizontal ? (i + 1) * segmentLength : 2}\n y2={isHorizontal ? 2 : (i + 1) * segmentLength}\n stroke={activeColor}\n strokeWidth={4}\n strokeLinecap=\"round\"\n strokeDasharray={segmentLength}\n strokeDashoffset={fillProgress}\n />\n );\n })}\n {/* Background track */}\n {steps.slice(0, -1).map((_, i) => (\n <line\n key={`bg-${i}`}\n x1={isHorizontal ? i * segmentLength : 2}\n y1={isHorizontal ? 2 : i * segmentLength}\n x2={isHorizontal ? (i + 1) * segmentLength : 2}\n y2={isHorizontal ? 2 : (i + 1) * segmentLength}\n stroke={inactiveColor}\n strokeWidth={4}\n strokeLinecap=\"round\"\n style={{ opacity: 0.6 }}\n />\n ))}\n </svg>\n\n {steps.map((step, i) => {\n const activateAt = i * stepDuration;\n const localFrame = frame - activateAt;\n const popScale = spring({\n frame: localFrame,\n fps,\n config: { damping: 10, stiffness: 180, mass: 0.6 },\n });\n const scale = interpolate(popScale, [0, 1], [0.8, 1]);\n const fill = interpolateColors(\n frame,\n [activateAt, activateAt + 8],\n [inactiveColor, activeColor],\n );\n const showCheck = interpolate(\n frame,\n [activateAt + 6, activateAt + 14],\n [0, 1],\n { extrapolateLeft: \"clamp\", extrapolateRight: \"clamp\" },\n );\n\n return (\n <div\n key={i}\n style={{\n position: \"relative\",\n display: \"flex\",\n flexDirection: isHorizontal ? \"column\" : \"row\",\n alignItems: \"center\",\n gap: 14,\n width: isHorizontal ? segmentLength : \"auto\",\n height: isHorizontal ? \"auto\" : segmentLength,\n marginRight:\n isHorizontal && i === steps.length - 1 ? 0 : -segmentLength,\n marginBottom:\n !isHorizontal && i === steps.length - 1 ? 0 : -segmentLength,\n zIndex: 2,\n }}\n >\n <div\n style={{\n width: nodeRadius * 2,\n height: nodeRadius * 2,\n borderRadius: 999,\n background: fill,\n border: `2px solid ${activeColor}`,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n transform: `scale(${scale})`,\n transformOrigin: \"center\",\n boxShadow: `0 0 0 6px ${activeColor}1a`,\n }}\n >\n <svg\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n style={{ opacity: showCheck }}\n >\n <path\n d=\"M5 12.5l4.5 4.5L19 7\"\n stroke=\"white\"\n strokeWidth=\"3\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n <span\n style={{\n fontSize: 15,\n fontWeight: 500,\n color: textColor,\n letterSpacing: \"-0.01em\",\n whiteSpace: \"nowrap\",\n position: isHorizontal ? \"absolute\" : \"static\",\n top: isHorizontal ? nodeRadius * 2 + 14 : undefined,\n }}\n >\n {step.label}\n </span>\n </div>\n );\n })}\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/progress-steps.tsx"
}
diff --git a/public/r/progress.json b/public/r/progress.json
index c1a03ab5..04305031 100644
--- a/public/r/progress.json
+++ b/public/r/progress.json
@@ -12,7 +12,7 @@
"files": [
{
"path": "registry/remocn-ui/progress/index.tsx",
- "content": "\"use client\";\n\nimport { clamp01, type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport interface ProgressStyle {\n value: number;\n}\n\nexport interface ProgressProps {\n value?: number;\n style?: ProgressStyle;\n width?: number;\n showLabel?: boolean;\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n className?: string;\n}\n\nconst TRACK_HEIGHT = 12;\n\nfunction clampValue(value: number): number {\n return clamp01(value / 100) * 100;\n}\n\nexport function Progress({\n value = 0,\n style,\n width = 320,\n showLabel = false,\n theme: themeOverride,\n mode,\n className,\n}: ProgressProps) {\n const theme = useRemocnTheme(themeOverride, mode);\n const v = clampValue(style ? style.value : value);\n\n const track = theme.muted;\n const indicator = theme.primary;\n\n return (\n <div\n className={className}\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 12,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {}\n <div\n style={{\n position: \"relative\",\n width,\n height: TRACK_HEIGHT,\n borderRadius: TRACK_HEIGHT / 2,\n background: track,\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n bottom: 0,\n width: `${v}%`,\n borderRadius: TRACK_HEIGHT / 2,\n background: indicator,\n }}\n />\n </div>\n {showLabel && (\n <span\n style={{\n fontSize: 14,\n fontWeight: 500,\n fontVariantNumeric: \"tabular-nums\",\n color: theme.mutedForeground,\n minWidth: \"3ch\",\n textAlign: \"right\",\n }}\n >\n {Math.floor(v)}%\n </span>\n )}\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { clamp01, type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport interface ProgressStyle {\n value: number;\n}\n\nexport interface ProgressProps {\n value?: number;\n style?: ProgressStyle;\n width?: number;\n showLabel?: boolean;\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nconst TRACK_HEIGHT = 12;\n\nfunction clampValue(value: number): number {\n return clamp01(value / 100) * 100;\n}\n\nexport function Progress({\n value = 0,\n style,\n width = 320,\n showLabel = false,\n theme: themeOverride,\n className,\n}: ProgressProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const v = clampValue(style ? style.value : value);\n\n const track = theme.muted;\n const indicator = theme.primary;\n\n return (\n <div\n className={className}\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n gap: 12,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n {}\n <div\n style={{\n position: \"relative\",\n width,\n height: TRACK_HEIGHT,\n borderRadius: TRACK_HEIGHT / 2,\n background: track,\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n bottom: 0,\n width: `${v}%`,\n borderRadius: TRACK_HEIGHT / 2,\n background: indicator,\n }}\n />\n </div>\n {showLabel && (\n <span\n style={{\n fontSize: 14,\n fontWeight: 500,\n fontVariantNumeric: \"tabular-nums\",\n color: theme.mutedForeground,\n minWidth: \"3ch\",\n textAlign: \"right\",\n }}\n >\n {Math.floor(v)}%\n </span>\n )}\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/progress.tsx"
},
diff --git a/public/r/radio.json b/public/r/radio.json
index 054b8820..89c97d83 100644
--- a/public/r/radio.json
+++ b/public/r/radio.json
@@ -12,7 +12,7 @@
"files": [
{
"path": "registry/remocn-ui/radio/index.tsx",
- "content": "\"use client\";\n\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type RadioState = \"unchecked\" | \"checked\";\n\ntype RadioSize = \"sm\" | \"default\" | \"lg\";\n\nexport interface RadioProps {\n state?: RadioState;\n style?: RadioStyle;\n label?: string;\n size?: RadioSize;\n theme?: Partial<RemocnTheme>;\n primary?: string;\n mode?: \"light\" | \"dark\";\n className?: string;\n}\n\nconst SIZE_STYLES: Record<\n RadioSize,\n { box: number; fontSize: number; gap: number }\n> = {\n sm: { box: 16, fontSize: 13, gap: 8 },\n default: { box: 20, fontSize: 15, gap: 10 },\n lg: { box: 24, fontSize: 17, gap: 12 },\n};\n\nexport interface RadioStyle {\n ringBorderColor: string;\n dotOpacity: number;\n dotScale: number;\n}\n\nexport interface RadioStyleContext {\n uncheckedBorder: string;\n checkedBorder: string;\n dotColor: string;\n}\n\nexport function radioStyleContext(theme: RemocnTheme): RadioStyleContext {\n return {\n uncheckedBorder: theme.border,\n checkedBorder: theme.primary,\n dotColor: theme.primary,\n };\n}\n\nexport function radioStyle(\n state: RadioState,\n ctx: RadioStyleContext,\n): RadioStyle {\n switch (state) {\n case \"checked\":\n return {\n ringBorderColor: ctx.checkedBorder,\n dotOpacity: 1,\n dotScale: 1,\n };\n default:\n return {\n ringBorderColor: ctx.uncheckedBorder,\n dotOpacity: 0,\n dotScale: 0.4,\n };\n }\n}\n\nexport function Radio({\n state = \"unchecked\",\n style,\n label,\n size = \"default\",\n theme: themeOverride,\n primary,\n mode,\n className,\n}: RadioProps) {\n const theme = useRemocnTheme(\n { ...themeOverride, ...(primary ? { primary } : {}) },\n mode,\n );\n\n const sizeStyle = SIZE_STYLES[size];\n const ctx = radioStyleContext(theme);\n const v = style ?? radioStyle(state, ctx);\n const boxSize = sizeStyle.box;\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: theme.background,\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 display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: boxSize,\n height: boxSize,\n borderRadius: \"50%\",\n border: `1px solid ${v.ringBorderColor}`,\n background: theme.background,\n }}\n >\n {}\n <span\n style={{\n width: Math.round(boxSize * 0.45),\n height: Math.round(boxSize * 0.45),\n borderRadius: \"50%\",\n background: ctx.dotColor,\n opacity: v.dotOpacity,\n transform: `scale(${v.dotScale})`,\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 RadioState = \"unchecked\" | \"checked\";\n\ntype RadioSize = \"sm\" | \"default\" | \"lg\";\n\nexport interface RadioProps {\n state?: RadioState;\n style?: RadioStyle;\n label?: string;\n size?: RadioSize;\n theme?: Partial<RemocnTheme>;\n primary?: string;\n className?: string;\n}\n\nconst SIZE_STYLES: Record<\n RadioSize,\n { box: number; fontSize: number; gap: number }\n> = {\n sm: { box: 16, fontSize: 13, gap: 8 },\n default: { box: 20, fontSize: 15, gap: 10 },\n lg: { box: 24, fontSize: 17, gap: 12 },\n};\n\nexport interface RadioStyle {\n ringBorderColor: string;\n dotOpacity: number;\n dotScale: number;\n}\n\nexport interface RadioStyleContext {\n uncheckedBorder: string;\n checkedBorder: string;\n dotColor: string;\n}\n\nexport function radioStyleContext(theme: RemocnTheme): RadioStyleContext {\n return {\n uncheckedBorder: theme.border,\n checkedBorder: theme.primary,\n dotColor: theme.primary,\n };\n}\n\nexport function radioStyle(\n state: RadioState,\n ctx: RadioStyleContext,\n): RadioStyle {\n switch (state) {\n case \"checked\":\n return {\n ringBorderColor: ctx.checkedBorder,\n dotOpacity: 1,\n dotScale: 1,\n };\n default:\n return {\n ringBorderColor: ctx.uncheckedBorder,\n dotOpacity: 0,\n dotScale: 0.4,\n };\n }\n}\n\nexport function Radio({\n state = \"unchecked\",\n style,\n label,\n size = \"default\",\n theme: themeOverride,\n primary,\n className,\n}: RadioProps) {\n const theme = useRemocnTheme(\n { ...themeOverride, ...(primary ? { primary } : {}) },\n \"light\",\n );\n\n const sizeStyle = SIZE_STYLES[size];\n const ctx = radioStyleContext(theme);\n const v = style ?? radioStyle(state, ctx);\n const boxSize = sizeStyle.box;\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 display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: boxSize,\n height: boxSize,\n borderRadius: \"50%\",\n border: `1px solid ${v.ringBorderColor}`,\n background: theme.background,\n }}\n >\n {}\n <span\n style={{\n width: Math.round(boxSize * 0.45),\n height: Math.round(boxSize * 0.45),\n borderRadius: \"50%\",\n background: ctx.dotColor,\n opacity: v.dotOpacity,\n transform: `scale(${v.dotScale})`,\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/radio.tsx"
},
diff --git a/public/r/registry.json b/public/r/registry.json
index bfb1f21c..4a76c6fd 100644
--- a/public/r/registry.json
+++ b/public/r/registry.json
@@ -768,6 +768,9 @@
"date-fns",
"@remotion/google-fonts"
],
+ "registryDependencies": [
+ "@remocn/number-wheel"
+ ],
"files": [
{
"path": "registry/remocn/github-stars/index.tsx",
@@ -777,6 +780,23 @@
],
"type": "registry:component"
},
+ {
+ "name": "number-wheel",
+ "title": "Number Wheel",
+ "description": "Mechanical odometer that rolls an integer up or down to its target, direction inferred from the values.",
+ "dependencies": [
+ "remotion",
+ "@remotion/google-fonts"
+ ],
+ "files": [
+ {
+ "path": "registry/remocn/number-wheel/index.tsx",
+ "type": "registry:component",
+ "target": "components/remocn/number-wheel.tsx"
+ }
+ ],
+ "type": "registry:component"
+ },
{
"name": "x-follow-card",
"title": "X Follow Card",
@@ -938,6 +958,22 @@
],
"type": "registry:component"
},
+ {
+ "name": "backdrop",
+ "title": "Backdrop",
+ "description": "Configurable full-frame background (color / gradient / image / live component) with Screen Studio-style padding and a rounded, shadowed content frame.",
+ "dependencies": [
+ "remotion"
+ ],
+ "files": [
+ {
+ "path": "registry/remocn/backdrop/index.tsx",
+ "type": "registry:component",
+ "target": "components/remocn/backdrop.tsx"
+ }
+ ],
+ "type": "registry:component"
+ },
{
"name": "remocn-ui",
"title": "remocn UI Core",
diff --git a/public/r/resizable.json b/public/r/resizable.json
index 0adfeb6a..492a3cdf 100644
--- a/public/r/resizable.json
+++ b/public/r/resizable.json
@@ -12,7 +12,7 @@
"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 mode?: \"light\" | \"dark\";\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 mode,\n className,\n}: ResizableProps) {\n const theme = useRemocnTheme(themeOverride, mode);\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: theme.background,\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 { 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",
"type": "registry:component",
"target": "components/remocn/resizable.tsx"
},
diff --git a/public/r/select-item.json b/public/r/select-item.json
index ac813e10..24e4df84 100644
--- a/public/r/select-item.json
+++ b/public/r/select-item.json
@@ -12,7 +12,7 @@
"files": [
{
"path": "registry/remocn-ui/select-item/index.tsx",
- "content": "\"use client\";\n\nimport { mixOklch, type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type SelectItemState = \"idle\" | \"hover\" | \"press\" | \"selected\";\n\nexport interface SelectItemProps {\n state?: SelectItemState;\n style?: SelectItemStyle;\n label?: string;\n width?: number;\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n className?: string;\n}\n\nconst ROW_WIDTH = 260;\n\nexport interface SelectItemStyle {\n background: string;\n labelColor: string;\n checkOpacity: number;\n scale: number;\n}\n\nexport interface SelectItemStyleContext {\n idleBg: string;\n hoverBg: string;\n pressBg: string;\n selectedBg: string;\n idleFg: string;\n selectedFg: string;\n check: string;\n}\n\nexport function selectItemStyleContext(\n theme: RemocnTheme,\n): SelectItemStyleContext {\n return {\n idleBg: theme.popover,\n hoverBg: theme.accent,\n pressBg: mixOklch(theme.accent, theme.foreground, 0.08),\n selectedBg: theme.accent,\n idleFg: theme.popoverForeground,\n selectedFg: theme.accentForeground,\n check: theme.primary,\n };\n}\n\nexport function selectItemStyle(\n state: SelectItemState,\n ctx: SelectItemStyleContext,\n): SelectItemStyle {\n switch (state) {\n case \"hover\":\n return {\n background: ctx.hoverBg,\n labelColor: ctx.idleFg,\n checkOpacity: 0,\n scale: 1,\n };\n case \"press\":\n return {\n background: ctx.pressBg,\n labelColor: ctx.idleFg,\n checkOpacity: 0,\n scale: 0.98,\n };\n case \"selected\":\n return {\n background: ctx.selectedBg,\n labelColor: ctx.selectedFg,\n checkOpacity: 1,\n scale: 1,\n };\n default:\n return {\n background: ctx.idleBg,\n labelColor: ctx.idleFg,\n checkOpacity: 0,\n scale: 1,\n };\n }\n}\n\nexport interface SelectItemRowProps {\n style?: SelectItemStyle;\n state?: SelectItemState;\n ctx: SelectItemStyleContext;\n label: string;\n width: number;\n radius: number;\n check: string;\n}\n\nexport function SelectItemRow({\n style,\n state = \"idle\",\n ctx,\n label,\n width,\n radius,\n check,\n}: SelectItemRowProps) {\n const v = style ?? selectItemStyle(state, ctx);\n return (\n <div\n className={undefined}\n style={{\n width,\n boxSizing: \"border-box\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n gap: 12,\n padding: \"8px 12px\",\n borderRadius: radius,\n transform: `scale(${v.scale})`,\n background: v.background,\n color: v.labelColor,\n fontSize: 14,\n letterSpacing: \"-0.01em\",\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={{ flexShrink: 0, opacity: v.checkOpacity }}\n >\n <path\n d=\"M5 12.5l4.5 4.5L19 7\"\n stroke={check}\n strokeWidth=\"2.4\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n );\n}\n\nexport function SelectItem({\n state = \"idle\",\n style,\n label = \"Banana\",\n width = ROW_WIDTH,\n theme: themeOverride,\n mode,\n className,\n}: SelectItemProps) {\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = selectItemStyleContext(theme);\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: theme.background,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <SelectItemRow\n style={style}\n state={state}\n ctx={ctx}\n label={label}\n width={width}\n radius={theme.radius}\n check={ctx.check}\n />\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { mixOklch, type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type SelectItemState = \"idle\" | \"hover\" | \"press\" | \"selected\";\n\nexport interface SelectItemProps {\n state?: SelectItemState;\n style?: SelectItemStyle;\n label?: string;\n width?: number;\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nconst ROW_WIDTH = 260;\n\nexport interface SelectItemStyle {\n background: string;\n labelColor: string;\n checkOpacity: number;\n scale: number;\n}\n\nexport interface SelectItemStyleContext {\n idleBg: string;\n hoverBg: string;\n pressBg: string;\n selectedBg: string;\n idleFg: string;\n selectedFg: string;\n check: string;\n}\n\nexport function selectItemStyleContext(\n theme: RemocnTheme,\n): SelectItemStyleContext {\n return {\n idleBg: theme.popover,\n hoverBg: theme.accent,\n pressBg: mixOklch(theme.accent, theme.foreground, 0.08),\n selectedBg: theme.accent,\n idleFg: theme.popoverForeground,\n selectedFg: theme.accentForeground,\n check: theme.primary,\n };\n}\n\nexport function selectItemStyle(\n state: SelectItemState,\n ctx: SelectItemStyleContext,\n): SelectItemStyle {\n switch (state) {\n case \"hover\":\n return {\n background: ctx.hoverBg,\n labelColor: ctx.idleFg,\n checkOpacity: 0,\n scale: 1,\n };\n case \"press\":\n return {\n background: ctx.pressBg,\n labelColor: ctx.idleFg,\n checkOpacity: 0,\n scale: 0.98,\n };\n case \"selected\":\n return {\n background: ctx.selectedBg,\n labelColor: ctx.selectedFg,\n checkOpacity: 1,\n scale: 1,\n };\n default:\n return {\n background: ctx.idleBg,\n labelColor: ctx.idleFg,\n checkOpacity: 0,\n scale: 1,\n };\n }\n}\n\nexport interface SelectItemRowProps {\n style?: SelectItemStyle;\n state?: SelectItemState;\n ctx: SelectItemStyleContext;\n label: string;\n width: number;\n radius: number;\n check: string;\n}\n\nexport function SelectItemRow({\n style,\n state = \"idle\",\n ctx,\n label,\n width,\n radius,\n check,\n}: SelectItemRowProps) {\n const v = style ?? selectItemStyle(state, ctx);\n return (\n <div\n className={undefined}\n style={{\n width,\n boxSizing: \"border-box\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n gap: 12,\n padding: \"8px 12px\",\n borderRadius: radius,\n transform: `scale(${v.scale})`,\n background: v.background,\n color: v.labelColor,\n fontSize: 14,\n letterSpacing: \"-0.01em\",\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={{ flexShrink: 0, opacity: v.checkOpacity }}\n >\n <path\n d=\"M5 12.5l4.5 4.5L19 7\"\n stroke={check}\n strokeWidth=\"2.4\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n );\n}\n\nexport function SelectItem({\n state = \"idle\",\n style,\n label = \"Banana\",\n width = ROW_WIDTH,\n theme: themeOverride,\n className,\n}: SelectItemProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const ctx = selectItemStyleContext(theme);\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 <SelectItemRow\n style={style}\n state={state}\n ctx={ctx}\n label={label}\n width={width}\n radius={theme.radius}\n check={ctx.check}\n />\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/select-item.tsx"
},
diff --git a/public/r/select.json b/public/r/select.json
index 807fc647..794e2f90 100644
--- a/public/r/select.json
+++ b/public/r/select.json
@@ -14,7 +14,7 @@
"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 mode?: \"light\" | \"dark\";\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 mode,\n className,\n}: SelectProps) {\n const theme = useRemocnTheme(themeOverride, mode);\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: theme.background,\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 { 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",
"type": "registry:component",
"target": "components/remocn/select.tsx"
},
diff --git a/public/r/settings-toggle-flow.json b/public/r/settings-toggle-flow.json
index 789130ac..b69495f9 100644
--- a/public/r/settings-toggle-flow.json
+++ b/public/r/settings-toggle-flow.json
@@ -19,7 +19,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 mode?: \"light\" | \"dark\";\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 mode = \"light\",\n theme,\n}: SettingsToggleFlowProps) {\n const resolved = useRemocnTheme(theme, mode);\n const opts = { mode, 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 { mode },\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: resolved.muted,\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} mode={mode} 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} mode={mode} 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 mode={mode}\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} mode={mode} 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 mode={mode}\n theme={theme}\n />\n </div>\n\n <Cursor style={cursorStyle} variant=\"pointer\" mode={mode} theme={theme} />\n </div>\n );\n}\n",
+ "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",
"type": "registry:component",
"target": "components/remocn/settings-toggle-flow.tsx"
}
diff --git a/public/r/sheet.json b/public/r/sheet.json
index 2032fb67..65988c00 100644
--- a/public/r/sheet.json
+++ b/public/r/sheet.json
@@ -12,7 +12,7 @@
"files": [
{
"path": "registry/remocn-ui/sheet/index.tsx",
- "content": "\"use client\";\n\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type SheetState = \"opened\" | \"closed\";\n\nexport interface SheetProps {\n state?: SheetState;\n style?: SheetStyle;\n title?: string;\n description?: string;\n actionLabel?: string;\n cancelLabel?: string;\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n className?: string;\n}\n\nconst SHEET_WIDTH = 400;\nconst MAX_OVERLAY_ALPHA = 0.5;\n\nexport interface SheetStyle {\n overlayOpacity: number;\n panelOpacity: number;\n panelTranslateX: number;\n}\n\nexport interface SheetStyleContext {\n popoverBg: string;\n popoverFg: string;\n mutedFg: string;\n border: string;\n radius: number;\n actionBg: string;\n actionFg: string;\n cancelFg: string;\n}\n\nexport function sheetStyleContext(theme: RemocnTheme): SheetStyleContext {\n return {\n popoverBg: theme.popover,\n popoverFg: theme.popoverForeground,\n mutedFg: theme.mutedForeground,\n border: theme.border,\n radius: theme.radius,\n actionBg: theme.primary,\n actionFg: theme.primaryForeground,\n cancelFg: theme.foreground,\n };\n}\n\nexport function sheetStyle(\n state: SheetState,\n _ctx: SheetStyleContext,\n): SheetStyle {\n switch (state) {\n case \"opened\":\n return {\n overlayOpacity: 1,\n panelOpacity: 1,\n panelTranslateX: 0,\n };\n default:\n return {\n overlayOpacity: 0,\n panelOpacity: 0,\n panelTranslateX: SHEET_WIDTH,\n };\n }\n}\n\nexport function Sheet({\n state = \"closed\",\n style,\n title = \"Edit profile\",\n description = \"Make changes to your profile here. Click save when you're done.\",\n actionLabel = \"Save changes\",\n cancelLabel = \"Cancel\",\n theme: themeOverride,\n mode,\n className,\n}: SheetProps) {\n const theme = useRemocnTheme(themeOverride, mode);\n\n const ctx = sheetStyleContext(theme);\n const v = style ?? sheetStyle(state, ctx);\n\n const buttonBase: React.CSSProperties = {\n height: 40,\n padding: \"0 20px\",\n fontSize: 15,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n borderRadius: ctx.radius,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n cursor: \"pointer\",\n };\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\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.overlayOpacity})`,\n }}\n />\n <div\n className={className}\n style={{\n position: \"absolute\",\n top: 0,\n right: 0,\n height: \"100%\",\n width: SHEET_WIDTH,\n transform: `translateX(${v.panelTranslateX}px)`,\n opacity: v.panelOpacity,\n background: ctx.popoverBg,\n color: ctx.popoverFg,\n borderLeft: `1px solid ${ctx.border}`,\n padding: 24,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n boxShadow: \"-24px 0 48px -12px rgba(0,0,0,0.25)\",\n }}\n >\n {}\n <button\n type=\"button\"\n style={{\n position: \"absolute\",\n top: 16,\n right: 16,\n width: 28,\n height: 28,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n border: \"none\",\n borderRadius: ctx.radius,\n color: ctx.mutedFg,\n cursor: \"pointer\",\n }}\n >\n <svg width={16} height={16} viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d=\"M18 6 6 18 M6 6 18 18\"\n stroke={ctx.mutedFg}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </button>\n <div\n style={{\n fontSize: 18,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n paddingRight: 28,\n }}\n >\n {title}\n </div>\n <div style={{ fontSize: 14, lineHeight: 1.5, color: ctx.mutedFg }}>\n {description}\n </div>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"flex-end\",\n gap: 8,\n marginTop: \"auto\",\n }}\n >\n {}\n <button\n type=\"button\"\n style={{\n ...buttonBase,\n background: \"transparent\",\n color: ctx.cancelFg,\n border: `1px solid ${ctx.border}`,\n }}\n >\n {cancelLabel}\n </button>\n {}\n <button\n type=\"button\"\n style={{\n ...buttonBase,\n background: ctx.actionBg,\n color: ctx.actionFg,\n border: \"1px solid transparent\",\n }}\n >\n {actionLabel}\n </button>\n </div>\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type SheetState = \"opened\" | \"closed\";\n\nexport interface SheetProps {\n state?: SheetState;\n style?: SheetStyle;\n title?: string;\n description?: string;\n actionLabel?: string;\n cancelLabel?: string;\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nconst SHEET_WIDTH = 400;\nconst MAX_OVERLAY_ALPHA = 0.5;\n\nexport interface SheetStyle {\n overlayOpacity: number;\n panelOpacity: number;\n panelTranslateX: number;\n}\n\nexport interface SheetStyleContext {\n popoverBg: string;\n popoverFg: string;\n mutedFg: string;\n border: string;\n radius: number;\n actionBg: string;\n actionFg: string;\n cancelFg: string;\n}\n\nexport function sheetStyleContext(theme: RemocnTheme): SheetStyleContext {\n return {\n popoverBg: theme.popover,\n popoverFg: theme.popoverForeground,\n mutedFg: theme.mutedForeground,\n border: theme.border,\n radius: theme.radius,\n actionBg: theme.primary,\n actionFg: theme.primaryForeground,\n cancelFg: theme.foreground,\n };\n}\n\nexport function sheetStyle(\n state: SheetState,\n _ctx: SheetStyleContext,\n): SheetStyle {\n switch (state) {\n case \"opened\":\n return {\n overlayOpacity: 1,\n panelOpacity: 1,\n panelTranslateX: 0,\n };\n default:\n return {\n overlayOpacity: 0,\n panelOpacity: 0,\n panelTranslateX: SHEET_WIDTH,\n };\n }\n}\n\nexport function Sheet({\n state = \"closed\",\n style,\n title = \"Edit profile\",\n description = \"Make changes to your profile here. Click save when you're done.\",\n actionLabel = \"Save changes\",\n cancelLabel = \"Cancel\",\n theme: themeOverride,\n className,\n}: SheetProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n\n const ctx = sheetStyleContext(theme);\n const v = style ?? sheetStyle(state, ctx);\n\n const buttonBase: React.CSSProperties = {\n height: 40,\n padding: \"0 20px\",\n fontSize: 15,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n borderRadius: ctx.radius,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n cursor: \"pointer\",\n };\n\n return (\n <div\n style={{\n position: \"absolute\",\n inset: 0,\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.overlayOpacity})`,\n }}\n />\n <div\n className={className}\n style={{\n position: \"absolute\",\n top: 0,\n right: 0,\n height: \"100%\",\n width: SHEET_WIDTH,\n transform: `translateX(${v.panelTranslateX}px)`,\n opacity: v.panelOpacity,\n background: ctx.popoverBg,\n color: ctx.popoverFg,\n borderLeft: `1px solid ${ctx.border}`,\n padding: 24,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 8,\n boxShadow: \"-24px 0 48px -12px rgba(0,0,0,0.25)\",\n }}\n >\n {}\n <button\n type=\"button\"\n style={{\n position: \"absolute\",\n top: 16,\n right: 16,\n width: 28,\n height: 28,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n background: \"transparent\",\n border: \"none\",\n borderRadius: ctx.radius,\n color: ctx.mutedFg,\n cursor: \"pointer\",\n }}\n >\n <svg width={16} height={16} viewBox=\"0 0 24 24\" fill=\"none\">\n <path\n d=\"M18 6 6 18 M6 6 18 18\"\n stroke={ctx.mutedFg}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </button>\n <div\n style={{\n fontSize: 18,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n paddingRight: 28,\n }}\n >\n {title}\n </div>\n <div style={{ fontSize: 14, lineHeight: 1.5, color: ctx.mutedFg }}>\n {description}\n </div>\n <div\n style={{\n display: \"flex\",\n justifyContent: \"flex-end\",\n gap: 8,\n marginTop: \"auto\",\n }}\n >\n {}\n <button\n type=\"button\"\n style={{\n ...buttonBase,\n background: \"transparent\",\n color: ctx.cancelFg,\n border: `1px solid ${ctx.border}`,\n }}\n >\n {cancelLabel}\n </button>\n {}\n <button\n type=\"button\"\n style={{\n ...buttonBase,\n background: ctx.actionBg,\n color: ctx.actionFg,\n border: \"1px solid transparent\",\n }}\n >\n {actionLabel}\n </button>\n </div>\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/sheet.tsx"
},
diff --git a/public/r/signup-flow.json b/public/r/signup-flow.json
index 4858c22c..1e7ffab1 100644
--- a/public/r/signup-flow.json
+++ b/public/r/signup-flow.json
@@ -18,7 +18,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 mode?: \"light\" | \"dark\";\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 mode = \"light\",\n theme,\n}: SignupFlowProps) {\n const resolved = useRemocnTheme(theme, mode);\n const opts = { mode, 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 { mode },\n );\n\n return (\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n background: resolved.muted,\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 mode={mode} theme={theme}>\n Full Name\n </FieldLabel>\n <FieldControl>\n <Input\n placeholder={fullName}\n value={fullName}\n style={nameStyle}\n mode={mode}\n theme={theme}\n />\n </FieldControl>\n </Field>\n </BlurIn>\n\n <BlurIn display=\"block\" style={enterEmail}>\n <Field>\n <FieldLabel mode={mode} theme={theme}>\n Email\n </FieldLabel>\n <FieldControl>\n <Input\n placeholder={email}\n value={email}\n style={emailStyle}\n mode={mode}\n theme={theme}\n />\n </FieldControl>\n <FieldDescription mode={mode} 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 mode={mode} theme={theme}>\n Password\n </FieldLabel>\n <FieldControl>\n <Input\n placeholder={password}\n value={password}\n style={passStyle}\n mode={mode}\n theme={theme}\n />\n </FieldControl>\n <FieldDescription mode={mode} 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 mode={mode} theme={theme}>\n Confirm Password\n </FieldLabel>\n <FieldControl>\n <Input\n placeholder={password}\n value={password}\n style={confirmStyle}\n mode={mode}\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 mode={mode}\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 mode={mode}\n theme={theme}\n />\n </div>\n\n <Cursor style={cursorStyle} variant=\"pointer\" mode={mode} theme={theme} />\n </div>\n );\n}\n",
+ "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",
"type": "registry:component",
"target": "components/remocn/signup-flow.tsx"
}
diff --git a/public/r/simulated-cursor.json b/public/r/simulated-cursor.json
index cdee7258..f546d65b 100644
--- a/public/r/simulated-cursor.json
+++ b/public/r/simulated-cursor.json
@@ -9,7 +9,7 @@
"files": [
{
"path": "registry/remocn/simulated-cursor/index.tsx",
- "content": "\"use client\";\n\nimport { interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface CursorPoint {\n x: number;\n y: number;\n hold?: number;\n click?: boolean;\n}\n\nexport interface SimulatedCursorProps {\n points?: CursorPoint[];\n color?: string;\n size?: number;\n background?: string;\n speed?: number;\n className?: string;\n}\n\nconst DEFAULT_POINTS: CursorPoint[] = [\n { x: 200, y: 150, hold: 20 },\n { x: 800, y: 360, hold: 25, click: true },\n { x: 1050, y: 560, hold: 20 },\n];\n\nexport function SimulatedCursor({\n points = DEFAULT_POINTS,\n color = \"#ffffff\",\n size = 32,\n background = \"#0a0a0a\",\n speed = 1,\n className,\n}: SimulatedCursorProps) {\n const frame = useCurrentFrame() * speed;\n const { fps, durationInFrames } = useVideoConfig();\n\n const travelPerLeg = 24;\n const segments: Array<{\n start: number;\n end: number;\n holdEnd: number;\n from: CursorPoint;\n to: CursorPoint;\n }> = [];\n\n let cursor = 0;\n for (let i = 0; i < points.length - 1; i++) {\n const from = points[i];\n const to = points[i + 1];\n const start = cursor;\n const end = start + travelPerLeg;\n const holdEnd = end + (to.hold ?? 15);\n segments.push({ start, end, holdEnd, from, to });\n cursor = holdEnd;\n }\n\n // Find current segment\n let x = points[0].x;\n let y = points[0].y;\n let activeClickFrame: number | null = null;\n let clickTarget: CursorPoint | null = null;\n\n if (segments.length === 0) {\n x = points[0].x;\n y = points[0].y;\n } else if (frame < segments[0].start + (points[0].hold ?? 0)) {\n x = points[0].x;\n y = points[0].y;\n } else {\n for (const seg of segments) {\n if (frame >= seg.start && frame < seg.holdEnd) {\n if (frame < seg.end) {\n // travelling\n x = interpolate(frame, [seg.start, seg.end], [seg.from.x, seg.to.x], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n y = interpolate(frame, [seg.start, seg.end], [seg.from.y, seg.to.y], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n } else {\n x = seg.to.x;\n y = seg.to.y;\n if (seg.to.click) {\n activeClickFrame = frame - seg.end;\n clickTarget = seg.to;\n }\n }\n break;\n }\n if (frame >= seg.holdEnd) {\n x = seg.to.x;\n y = seg.to.y;\n }\n }\n }\n\n // Click feedback\n let clickScale = 1;\n let rippleRadius = 0;\n let rippleOpacity = 0;\n if (activeClickFrame !== null && clickTarget) {\n const dip = spring({\n fps,\n frame: activeClickFrame,\n config: { damping: 10, stiffness: 200, mass: 0.6 },\n durationInFrames: 14,\n });\n clickScale = 1 - dip * 0.18;\n rippleRadius = interpolate(activeClickFrame, [0, 24], [4, 60], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n rippleOpacity = interpolate(activeClickFrame, [0, 24], [0.6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n }\n\n // Suppress unused warning when durationInFrames not used directly\n void durationInFrames;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background,\n overflow: \"hidden\",\n }}\n >\n {/* Click ripple */}\n {rippleOpacity > 0 && (\n <svg\n style={{\n position: \"absolute\",\n left: x - 80,\n top: y - 80,\n width: 160,\n height: 160,\n pointerEvents: \"none\",\n }}\n >\n <circle\n cx={80}\n cy={80}\n r={rippleRadius}\n fill=\"none\"\n stroke={color}\n strokeWidth={2}\n opacity={rippleOpacity}\n />\n </svg>\n )}\n\n {/* Cursor */}\n <div\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n width: size,\n height: size,\n transform: `scale(${clickScale})`,\n transformOrigin: \"top left\",\n zIndex: 2147483647,\n pointerEvents: \"none\",\n willChange: \"transform, left, top\",\n }}\n >\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M5 3L5 19L9.5 14.5L12.5 21L15 20L12 13.5L18.5 13.5L5 3Z\"\n fill={color}\n stroke=\"#000000\"\n strokeWidth={1.2}\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { interpolate, spring, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface CursorPoint {\n x: number;\n y: number;\n hold?: number;\n click?: boolean;\n}\n\nexport interface SimulatedCursorProps {\n points?: CursorPoint[];\n color?: string;\n size?: number;\n speed?: number;\n className?: string;\n}\n\nconst DEFAULT_POINTS: CursorPoint[] = [\n { x: 200, y: 150, hold: 20 },\n { x: 800, y: 360, hold: 25, click: true },\n { x: 1050, y: 560, hold: 20 },\n];\n\nexport function SimulatedCursor({\n points = DEFAULT_POINTS,\n color = \"#ffffff\",\n size = 32,\n speed = 1,\n className,\n}: SimulatedCursorProps) {\n const frame = useCurrentFrame() * speed;\n const { fps, durationInFrames } = useVideoConfig();\n\n const travelPerLeg = 24;\n const segments: Array<{\n start: number;\n end: number;\n holdEnd: number;\n from: CursorPoint;\n to: CursorPoint;\n }> = [];\n\n let cursor = 0;\n for (let i = 0; i < points.length - 1; i++) {\n const from = points[i];\n const to = points[i + 1];\n const start = cursor;\n const end = start + travelPerLeg;\n const holdEnd = end + (to.hold ?? 15);\n segments.push({ start, end, holdEnd, from, to });\n cursor = holdEnd;\n }\n\n // Find current segment\n let x = points[0].x;\n let y = points[0].y;\n let activeClickFrame: number | null = null;\n let clickTarget: CursorPoint | null = null;\n\n if (segments.length === 0) {\n x = points[0].x;\n y = points[0].y;\n } else if (frame < segments[0].start + (points[0].hold ?? 0)) {\n x = points[0].x;\n y = points[0].y;\n } else {\n for (const seg of segments) {\n if (frame >= seg.start && frame < seg.holdEnd) {\n if (frame < seg.end) {\n // travelling\n x = interpolate(frame, [seg.start, seg.end], [seg.from.x, seg.to.x], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n y = interpolate(frame, [seg.start, seg.end], [seg.from.y, seg.to.y], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n } else {\n x = seg.to.x;\n y = seg.to.y;\n if (seg.to.click) {\n activeClickFrame = frame - seg.end;\n clickTarget = seg.to;\n }\n }\n break;\n }\n if (frame >= seg.holdEnd) {\n x = seg.to.x;\n y = seg.to.y;\n }\n }\n }\n\n // Click feedback\n let clickScale = 1;\n let rippleRadius = 0;\n let rippleOpacity = 0;\n if (activeClickFrame !== null && clickTarget) {\n const dip = spring({\n fps,\n frame: activeClickFrame,\n config: { damping: 10, stiffness: 200, mass: 0.6 },\n durationInFrames: 14,\n });\n clickScale = 1 - dip * 0.18;\n rippleRadius = interpolate(activeClickFrame, [0, 24], [4, 60], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n rippleOpacity = interpolate(activeClickFrame, [0, 24], [0.6, 0], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n }\n\n // Suppress unused warning when durationInFrames not used directly\n void durationInFrames;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n }}\n >\n {/* Click ripple */}\n {rippleOpacity > 0 && (\n <svg\n style={{\n position: \"absolute\",\n left: x - 80,\n top: y - 80,\n width: 160,\n height: 160,\n pointerEvents: \"none\",\n }}\n >\n <circle\n cx={80}\n cy={80}\n r={rippleRadius}\n fill=\"none\"\n stroke={color}\n strokeWidth={2}\n opacity={rippleOpacity}\n />\n </svg>\n )}\n\n {/* Cursor */}\n <div\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n width: size,\n height: size,\n transform: `scale(${clickScale})`,\n transformOrigin: \"top left\",\n zIndex: 2147483647,\n pointerEvents: \"none\",\n willChange: \"transform, left, top\",\n }}\n >\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M5 3L5 19L9.5 14.5L12.5 21L15 20L12 13.5L18.5 13.5L5 3Z\"\n fill={color}\n stroke=\"#000000\"\n strokeWidth={1.2}\n strokeLinejoin=\"round\"\n />\n </svg>\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/simulated-cursor.tsx"
}
diff --git a/public/r/skeleton.json b/public/r/skeleton.json
index f2babd80..59109aaf 100644
--- a/public/r/skeleton.json
+++ b/public/r/skeleton.json
@@ -13,7 +13,7 @@
"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 mode?: \"light\" | \"dark\";\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 mode,\n className,\n}: SkeletonProps) {\n const theme = useRemocnTheme(themeOverride, mode);\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 { 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",
"type": "registry:component",
"target": "components/remocn/skeleton.tsx"
},
diff --git a/public/r/slider.json b/public/r/slider.json
index 40ec9b4b..7173db6b 100644
--- a/public/r/slider.json
+++ b/public/r/slider.json
@@ -12,7 +12,7 @@
"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 mode?: \"light\" | \"dark\";\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 mode,\n className,\n}: SliderProps) {\n const theme = useRemocnTheme(themeOverride, mode);\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 { 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",
"type": "registry:component",
"target": "components/remocn/slider.tsx"
},
diff --git a/public/r/spotlight-card.json b/public/r/spotlight-card.json
index f630a393..76a18fba 100644
--- a/public/r/spotlight-card.json
+++ b/public/r/spotlight-card.json
@@ -9,7 +9,7 @@
"files": [
{
"path": "registry/remocn/spotlight-card/index.tsx",
- "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface SpotlightCardProps {\n title?: string;\n body?: string;\n cardWidth?: number;\n cardHeight?: number;\n glowSize?: number;\n glowOpacity?: number;\n background?: string;\n cardColor?: string;\n textColor?: string;\n mutedColor?: string;\n speed?: number;\n className?: string;\n children?: ReactNode;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n/**\n * Smooth synthetic cursor path: a slow Lissajous figure-8 that tours the\n * card surface so the spotlight is always moving but never repeats jerkily.\n * Returns coordinates in card-local space (0..cardWidth, 0..cardHeight).\n */\nfunction cursorAt(\n frame: number,\n cardWidth: number,\n cardHeight: number,\n durationInFrames: number,\n) {\n const t = (frame / durationInFrames) * Math.PI * 2;\n const x = cardWidth / 2 + Math.sin(t) * (cardWidth * 0.42);\n const y = cardHeight / 2 + Math.sin(t * 2) * (cardHeight * 0.32);\n return { x, y };\n}\n\nexport function SpotlightCard({\n title = \"Spotlight Card\",\n body = \"Soft radial light follows the cursor, picking out the microborder.\",\n cardWidth = 520,\n cardHeight = 320,\n glowSize = 600,\n glowOpacity = 0.08,\n background = \"#050505\",\n cardColor = \"#0a0a0a\",\n textColor = \"#fafafa\",\n mutedColor = \"#71717a\",\n speed = 1,\n className,\n children,\n}: SpotlightCardProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n // 1-frame inertia: spotlight lags the cursor by a frame for organic feel.\n const cursor = cursorAt(\n Math.max(0, frame - 1),\n cardWidth,\n cardHeight,\n durationInFrames,\n );\n\n // Card fades up briefly at the start so the preview has a clean entrance.\n const cardOpacity = interpolate(frame, [0, 12], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const surfaceGlow = `radial-gradient(${glowSize}px circle at ${cursor.x}px ${cursor.y}px, rgba(255,255,255,${glowOpacity}), transparent 40%)`;\n const borderGlow = `radial-gradient(${glowSize * 0.6}px circle at ${cursor.x}px ${cursor.y}px, rgba(255,255,255,0.35), transparent 40%)`;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n background,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontFamily: FONT_FAMILY,\n }}\n >\n {/* Border glow wrapper — 1px padding + masked radial gradient. */}\n <div\n style={{\n position: \"relative\",\n width: cardWidth,\n height: cardHeight,\n borderRadius: 20,\n padding: 1,\n background: borderGlow,\n opacity: cardOpacity,\n }}\n >\n {/* Card surface */}\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n borderRadius: 19,\n background: cardColor,\n overflow: \"hidden\",\n boxShadow: \"0 30px 80px rgba(0,0,0,0.5)\",\n }}\n >\n {/* Surface glow underlay */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: surfaceGlow,\n pointerEvents: \"none\",\n }}\n />\n\n {/* Card content */}\n <div\n style={{\n position: \"relative\",\n padding: 36,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 12,\n height: \"100%\",\n justifyContent: \"flex-end\",\n }}\n >\n {children ?? (\n <>\n <div\n style={{\n fontSize: 28,\n fontWeight: 700,\n letterSpacing: \"-0.02em\",\n color: textColor,\n }}\n >\n {title}\n </div>\n <div\n style={{\n fontSize: 16,\n lineHeight: 1.5,\n color: mutedColor,\n maxWidth: 360,\n }}\n >\n {body}\n </div>\n </>\n )}\n </div>\n </div>\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { interpolate, useCurrentFrame, useVideoConfig } from \"remotion\";\n\nexport interface SpotlightCardProps {\n title?: string;\n body?: string;\n cardWidth?: number;\n cardHeight?: number;\n glowSize?: number;\n glowOpacity?: number;\n cardColor?: string;\n textColor?: string;\n mutedColor?: string;\n speed?: number;\n className?: string;\n children?: ReactNode;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\n/**\n * Smooth synthetic cursor path: a slow Lissajous figure-8 that tours the\n * card surface so the spotlight is always moving but never repeats jerkily.\n * Returns coordinates in card-local space (0..cardWidth, 0..cardHeight).\n */\nfunction cursorAt(\n frame: number,\n cardWidth: number,\n cardHeight: number,\n durationInFrames: number,\n) {\n const t = (frame / durationInFrames) * Math.PI * 2;\n const x = cardWidth / 2 + Math.sin(t) * (cardWidth * 0.42);\n const y = cardHeight / 2 + Math.sin(t * 2) * (cardHeight * 0.32);\n return { x, y };\n}\n\nexport function SpotlightCard({\n title = \"Spotlight Card\",\n body = \"Soft radial light follows the cursor, picking out the microborder.\",\n cardWidth = 520,\n cardHeight = 320,\n glowSize = 600,\n glowOpacity = 0.08,\n cardColor = \"#0a0a0a\",\n textColor = \"#fafafa\",\n mutedColor = \"#71717a\",\n speed = 1,\n className,\n children,\n}: SpotlightCardProps) {\n const frame = useCurrentFrame() * speed;\n const { durationInFrames } = useVideoConfig();\n\n // 1-frame inertia: spotlight lags the cursor by a frame for organic feel.\n const cursor = cursorAt(\n Math.max(0, frame - 1),\n cardWidth,\n cardHeight,\n durationInFrames,\n );\n\n // Card fades up briefly at the start so the preview has a clean entrance.\n const cardOpacity = interpolate(frame, [0, 12], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n const surfaceGlow = `radial-gradient(${glowSize}px circle at ${cursor.x}px ${cursor.y}px, rgba(255,255,255,${glowOpacity}), transparent 40%)`;\n const borderGlow = `radial-gradient(${glowSize * 0.6}px circle at ${cursor.x}px ${cursor.y}px, rgba(255,255,255,0.35), transparent 40%)`;\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: FONT_FAMILY,\n }}\n >\n {/* Border glow wrapper — 1px padding + masked radial gradient. */}\n <div\n style={{\n position: \"relative\",\n width: cardWidth,\n height: cardHeight,\n borderRadius: 20,\n padding: 1,\n background: borderGlow,\n opacity: cardOpacity,\n }}\n >\n {/* Card surface */}\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n borderRadius: 19,\n background: cardColor,\n overflow: \"hidden\",\n boxShadow: \"0 30px 80px rgba(0,0,0,0.5)\",\n }}\n >\n {/* Surface glow underlay */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background: surfaceGlow,\n pointerEvents: \"none\",\n }}\n />\n\n {/* Card content */}\n <div\n style={{\n position: \"relative\",\n padding: 36,\n display: \"flex\",\n flexDirection: \"column\",\n gap: 12,\n height: \"100%\",\n justifyContent: \"flex-end\",\n }}\n >\n {children ?? (\n <>\n <div\n style={{\n fontSize: 28,\n fontWeight: 700,\n letterSpacing: \"-0.02em\",\n color: textColor,\n }}\n >\n {title}\n </div>\n <div\n style={{\n fontSize: 16,\n lineHeight: 1.5,\n color: mutedColor,\n maxWidth: 360,\n }}\n >\n {body}\n </div>\n </>\n )}\n </div>\n </div>\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/spotlight-card.tsx"
}
diff --git a/public/r/stepper.json b/public/r/stepper.json
index ac206d6d..222ccb3a 100644
--- a/public/r/stepper.json
+++ b/public/r/stepper.json
@@ -12,7 +12,7 @@
"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 mode?: \"light\" | \"dark\";\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 mode,\n className,\n}: StepperProps) {\n const theme = useRemocnTheme(themeOverride, mode);\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: theme.background,\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 { 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",
"type": "registry:component",
"target": "components/remocn/stepper.tsx"
},
diff --git a/public/r/switch.json b/public/r/switch.json
index 608f7513..9020f44e 100644
--- a/public/r/switch.json
+++ b/public/r/switch.json
@@ -12,7 +12,7 @@
"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 mode?: \"light\" | \"dark\";\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 mode,\n className,\n}: SwitchProps) {\n const theme = useRemocnTheme(\n { ...themeOverride, ...(primary ? { primary } : {}) },\n mode,\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: theme.background,\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 { 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",
"type": "registry:component",
"target": "components/remocn/switch.tsx"
},
diff --git a/public/r/tabs.json b/public/r/tabs.json
index 4e0efe6a..4f77b605 100644
--- a/public/r/tabs.json
+++ b/public/r/tabs.json
@@ -12,7 +12,7 @@
"files": [
{
"path": "registry/remocn-ui/tabs/index.tsx",
- "content": "\"use client\";\n\nimport { mixOklch, type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type TabsState = string;\n\ntype TabsVariant = \"pill\" | \"underline\";\n\nexport interface TabsProps {\n state?: TabsState;\n style?: TabsStyle;\n items?: string[];\n contents?: string[];\n contentHeight?: number;\n variant?: TabsVariant;\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n className?: string;\n}\n\nconst WIDTH = 440;\n\nconst DEFAULT_ITEMS = [\"Account\", \"Password\", \"Settings\"];\n\nconst DEFAULT_CONTENTS = [\n \"Make changes to your account here.\",\n \"Change your password here.\",\n \"Manage your notification settings.\",\n];\n\nexport interface TabsStyle {\n indicatorOffset: number;\n}\n\nexport interface TabsStyleContext {\n items: string[];\n variant: TabsVariant;\n trackBg: string;\n activeFg: string;\n inactiveFg: string;\n indicatorBg: string;\n border: string;\n radius: number;\n panelFg: string;\n}\n\nexport function tabsStyleContext(\n items: string[],\n variant: TabsVariant,\n theme: RemocnTheme,\n): TabsStyleContext {\n return {\n items,\n variant,\n trackBg: theme.muted,\n activeFg: theme.foreground,\n inactiveFg: theme.mutedForeground,\n indicatorBg: variant === \"underline\" ? theme.primary : theme.background,\n border: theme.border,\n radius: theme.radius,\n panelFg: theme.mutedForeground,\n };\n}\n\nexport function tabsStyle(state: TabsState, ctx: TabsStyleContext): TabsStyle {\n const i = ctx.items.indexOf(state);\n return { indicatorOffset: i < 0 ? 0 : i };\n}\n\nexport function Tabs({\n state = DEFAULT_ITEMS[0],\n style,\n items = DEFAULT_ITEMS,\n contents = DEFAULT_CONTENTS,\n contentHeight = 72,\n variant = \"pill\",\n theme: themeOverride,\n mode,\n className,\n}: TabsProps) {\n const theme = useRemocnTheme(themeOverride, mode);\n\n const ctx = tabsStyleContext(items, variant, theme);\n const v = style ?? tabsStyle(state, ctx);\n\n const isPill = ctx.variant === \"pill\";\n const trackPad = isPill ? 4 : 0;\n const innerWidth = WIDTH - trackPad * 2;\n const segmentWidth = innerWidth / items.length;\n const rowHeight = 40;\n const indicatorX = trackPad + 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: \"center\",\n background: theme.background,\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div style={{ width: WIDTH }}>\n {}\n <div\n style={{\n position: \"relative\",\n height: rowHeight,\n padding: trackPad,\n boxSizing: \"border-box\",\n display: \"flex\",\n background: isPill ? ctx.trackBg : \"transparent\",\n borderRadius: isPill ? ctx.radius : 0,\n borderBottom: isPill ? undefined : `1px solid ${ctx.border}`,\n }}\n >\n {}\n <div\n style={\n isPill\n ? {\n position: \"absolute\",\n top: trackPad,\n left: indicatorX,\n width: segmentWidth,\n height: rowHeight - trackPad * 2,\n background: ctx.indicatorBg,\n borderRadius: ctx.radius - 3,\n boxShadow: \"0 1px 2px rgba(0,0,0,0.1)\",\n }\n : {\n position: \"absolute\",\n bottom: 0,\n left: indicatorX,\n width: segmentWidth,\n height: 2,\n background: ctx.indicatorBg,\n }\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}\n style={{\n position: \"relative\",\n width: segmentWidth,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontSize: 14,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n color: mixOklch(ctx.inactiveFg, ctx.activeFg, proximity),\n }}\n >\n {item}\n </span>\n );\n })}\n </div>\n {}\n <div\n style={{\n position: \"relative\",\n height: contentHeight,\n marginTop: 16,\n }}\n >\n {items.map((item, i) => {\n const proximity = Math.max(0, 1 - Math.abs(i - v.indicatorOffset));\n return (\n <div\n key={item}\n style={{\n position: \"absolute\",\n inset: 0,\n opacity: proximity,\n fontSize: 14,\n lineHeight: 1.5,\n color: ctx.panelFg,\n }}\n >\n {contents[i]}\n </div>\n );\n })}\n </div>\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { mixOklch, type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type TabsState = string;\n\ntype TabsVariant = \"pill\" | \"underline\";\n\nexport interface TabsProps {\n state?: TabsState;\n style?: TabsStyle;\n items?: string[];\n contents?: string[];\n contentHeight?: number;\n variant?: TabsVariant;\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nconst WIDTH = 440;\n\nconst DEFAULT_ITEMS = [\"Account\", \"Password\", \"Settings\"];\n\nconst DEFAULT_CONTENTS = [\n \"Make changes to your account here.\",\n \"Change your password here.\",\n \"Manage your notification settings.\",\n];\n\nexport interface TabsStyle {\n indicatorOffset: number;\n}\n\nexport interface TabsStyleContext {\n items: string[];\n variant: TabsVariant;\n trackBg: string;\n activeFg: string;\n inactiveFg: string;\n indicatorBg: string;\n border: string;\n radius: number;\n panelFg: string;\n}\n\nexport function tabsStyleContext(\n items: string[],\n variant: TabsVariant,\n theme: RemocnTheme,\n): TabsStyleContext {\n return {\n items,\n variant,\n trackBg: theme.muted,\n activeFg: theme.foreground,\n inactiveFg: theme.mutedForeground,\n indicatorBg: variant === \"underline\" ? theme.primary : theme.background,\n border: theme.border,\n radius: theme.radius,\n panelFg: theme.mutedForeground,\n };\n}\n\nexport function tabsStyle(state: TabsState, ctx: TabsStyleContext): TabsStyle {\n const i = ctx.items.indexOf(state);\n return { indicatorOffset: i < 0 ? 0 : i };\n}\n\nexport function Tabs({\n state = DEFAULT_ITEMS[0],\n style,\n items = DEFAULT_ITEMS,\n contents = DEFAULT_CONTENTS,\n contentHeight = 72,\n variant = \"pill\",\n theme: themeOverride,\n className,\n}: TabsProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n\n const ctx = tabsStyleContext(items, variant, theme);\n const v = style ?? tabsStyle(state, ctx);\n\n const isPill = ctx.variant === \"pill\";\n const trackPad = isPill ? 4 : 0;\n const innerWidth = WIDTH - trackPad * 2;\n const segmentWidth = innerWidth / items.length;\n const rowHeight = 40;\n const indicatorX = trackPad + 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: \"center\",\n background: \"transparent\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <div style={{ width: WIDTH }}>\n {}\n <div\n style={{\n position: \"relative\",\n height: rowHeight,\n padding: trackPad,\n boxSizing: \"border-box\",\n display: \"flex\",\n background: isPill ? ctx.trackBg : \"transparent\",\n borderRadius: isPill ? ctx.radius : 0,\n borderBottom: isPill ? undefined : `1px solid ${ctx.border}`,\n }}\n >\n {}\n <div\n style={\n isPill\n ? {\n position: \"absolute\",\n top: trackPad,\n left: indicatorX,\n width: segmentWidth,\n height: rowHeight - trackPad * 2,\n background: ctx.indicatorBg,\n borderRadius: ctx.radius - 3,\n boxShadow: \"0 1px 2px rgba(0,0,0,0.1)\",\n }\n : {\n position: \"absolute\",\n bottom: 0,\n left: indicatorX,\n width: segmentWidth,\n height: 2,\n background: ctx.indicatorBg,\n }\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}\n style={{\n position: \"relative\",\n width: segmentWidth,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontSize: 14,\n fontWeight: 500,\n letterSpacing: \"-0.01em\",\n color: mixOklch(ctx.inactiveFg, ctx.activeFg, proximity),\n }}\n >\n {item}\n </span>\n );\n })}\n </div>\n {}\n <div\n style={{\n position: \"relative\",\n height: contentHeight,\n marginTop: 16,\n }}\n >\n {items.map((item, i) => {\n const proximity = Math.max(0, 1 - Math.abs(i - v.indicatorOffset));\n return (\n <div\n key={item}\n style={{\n position: \"absolute\",\n inset: 0,\n opacity: proximity,\n fontSize: 14,\n lineHeight: 1.5,\n color: ctx.panelFg,\n }}\n >\n {contents[i]}\n </div>\n );\n })}\n </div>\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/tabs.tsx"
},
diff --git a/public/r/toast.json b/public/r/toast.json
index c17c89d4..2cce618e 100644
--- a/public/r/toast.json
+++ b/public/r/toast.json
@@ -12,7 +12,7 @@
"files": [
{
"path": "registry/remocn-ui/toast/index.tsx",
- "content": "\"use client\";\n\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type ToastState = \"hidden\" | \"visible\";\n\nexport type ToastVariant = \"default\" | \"success\" | \"error\";\n\nexport interface ToastProps {\n state?: ToastState;\n style?: ToastStyle;\n title: string;\n description?: string;\n variant?: ToastVariant;\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n className?: string;\n}\n\nconst TOAST_WIDTH = 356;\n\nexport interface ToastStyle {\n opacity: number;\n translateY: number;\n scale: number;\n}\n\nexport interface ToastStyleContext {\n iconColor: string;\n}\n\nexport function toastStyleContext(\n variant: ToastVariant,\n theme: RemocnTheme,\n): ToastStyleContext {\n if (variant === \"success\") return { iconColor: \"oklch(0.6 0.17 150)\" };\n if (variant === \"error\") return { iconColor: theme.destructive };\n return { iconColor: theme.mutedForeground };\n}\n\nexport function toastStyle(state: ToastState): ToastStyle {\n switch (state) {\n case \"visible\":\n return { opacity: 1, translateY: 0, scale: 1 };\n default:\n return { opacity: 0, translateY: 16, scale: 0.97 };\n }\n}\n\nfunction ToastIcon({\n variant,\n color,\n}: {\n variant: ToastVariant;\n color: string;\n}) {\n if (variant === \"success\") {\n return (\n <svg width={18} height={18} viewBox=\"0 0 24 24\" fill=\"none\">\n <circle cx=\"12\" cy=\"12\" r=\"9\" stroke={color} strokeWidth=\"2\" />\n <path\n d=\"M8 12.5l2.6 2.6L16 9\"\n stroke={color}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n }\n if (variant === \"error\") {\n return (\n <svg width={18} height={18} viewBox=\"0 0 24 24\" fill=\"none\">\n <circle cx=\"12\" cy=\"12\" r=\"9\" stroke={color} strokeWidth=\"2\" />\n <path\n d=\"M12 7.5v5\"\n stroke={color}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n />\n <circle cx=\"12\" cy=\"16\" r=\"1.1\" fill={color} />\n </svg>\n );\n }\n return (\n <svg width={18} height={18} viewBox=\"0 0 24 24\" fill=\"none\">\n <circle cx=\"12\" cy=\"12\" r=\"9\" stroke={color} strokeWidth=\"2\" />\n <path d=\"M12 11v5\" stroke={color} strokeWidth=\"2\" strokeLinecap=\"round\" />\n <circle cx=\"12\" cy=\"8\" r=\"1.1\" fill={color} />\n </svg>\n );\n}\n\nexport function Toast({\n state = \"hidden\",\n style,\n title,\n description,\n variant = \"default\",\n theme: themeOverride,\n mode,\n className,\n}: ToastProps) {\n const theme = useRemocnTheme(themeOverride, mode);\n const ctx = toastStyleContext(variant, theme);\n const v = style ?? toastStyle(state);\n\n return (\n <div\n className={className}\n style={{\n display: \"flex\",\n\n alignItems: description ? \"flex-start\" : \"center\",\n gap: 12,\n width: TOAST_WIDTH,\n padding: \"16px\",\n background: theme.popover,\n color: theme.popoverForeground,\n border: `1px solid ${theme.border}`,\n borderRadius: theme.radius,\n boxShadow:\n \"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)\",\n opacity: v.opacity,\n transform: `translateY(${v.translateY}px) scale(${v.scale})`,\n transformOrigin: \"bottom center\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <span\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n marginTop: description ? 1 : 0,\n }}\n >\n <ToastIcon variant={variant} color={ctx.iconColor} />\n </span>\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 4,\n minWidth: 0,\n }}\n >\n <span\n style={{\n fontSize: 14,\n fontWeight: 500,\n lineHeight: 1.3,\n letterSpacing: \"-0.01em\",\n }}\n >\n {title}\n </span>\n {description !== undefined && (\n <span\n style={{\n fontSize: 13,\n lineHeight: 1.4,\n color: theme.mutedForeground,\n }}\n >\n {description}\n </span>\n )}\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type ToastState = \"hidden\" | \"visible\";\n\nexport type ToastVariant = \"default\" | \"success\" | \"error\";\n\nexport interface ToastProps {\n state?: ToastState;\n style?: ToastStyle;\n title: string;\n description?: string;\n variant?: ToastVariant;\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nconst TOAST_WIDTH = 356;\n\nexport interface ToastStyle {\n opacity: number;\n translateY: number;\n scale: number;\n}\n\nexport interface ToastStyleContext {\n iconColor: string;\n}\n\nexport function toastStyleContext(\n variant: ToastVariant,\n theme: RemocnTheme,\n): ToastStyleContext {\n if (variant === \"success\") return { iconColor: \"oklch(0.6 0.17 150)\" };\n if (variant === \"error\") return { iconColor: theme.destructive };\n return { iconColor: theme.mutedForeground };\n}\n\nexport function toastStyle(state: ToastState): ToastStyle {\n switch (state) {\n case \"visible\":\n return { opacity: 1, translateY: 0, scale: 1 };\n default:\n return { opacity: 0, translateY: 16, scale: 0.97 };\n }\n}\n\nfunction ToastIcon({\n variant,\n color,\n}: {\n variant: ToastVariant;\n color: string;\n}) {\n if (variant === \"success\") {\n return (\n <svg width={18} height={18} viewBox=\"0 0 24 24\" fill=\"none\">\n <circle cx=\"12\" cy=\"12\" r=\"9\" stroke={color} strokeWidth=\"2\" />\n <path\n d=\"M8 12.5l2.6 2.6L16 9\"\n stroke={color}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n );\n }\n if (variant === \"error\") {\n return (\n <svg width={18} height={18} viewBox=\"0 0 24 24\" fill=\"none\">\n <circle cx=\"12\" cy=\"12\" r=\"9\" stroke={color} strokeWidth=\"2\" />\n <path\n d=\"M12 7.5v5\"\n stroke={color}\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n />\n <circle cx=\"12\" cy=\"16\" r=\"1.1\" fill={color} />\n </svg>\n );\n }\n return (\n <svg width={18} height={18} viewBox=\"0 0 24 24\" fill=\"none\">\n <circle cx=\"12\" cy=\"12\" r=\"9\" stroke={color} strokeWidth=\"2\" />\n <path d=\"M12 11v5\" stroke={color} strokeWidth=\"2\" strokeLinecap=\"round\" />\n <circle cx=\"12\" cy=\"8\" r=\"1.1\" fill={color} />\n </svg>\n );\n}\n\nexport function Toast({\n state = \"hidden\",\n style,\n title,\n description,\n variant = \"default\",\n theme: themeOverride,\n className,\n}: ToastProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const ctx = toastStyleContext(variant, theme);\n const v = style ?? toastStyle(state);\n\n return (\n <div\n className={className}\n style={{\n display: \"flex\",\n\n alignItems: description ? \"flex-start\" : \"center\",\n gap: 12,\n width: TOAST_WIDTH,\n padding: \"16px\",\n background: theme.popover,\n color: theme.popoverForeground,\n border: `1px solid ${theme.border}`,\n borderRadius: theme.radius,\n boxShadow:\n \"0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)\",\n opacity: v.opacity,\n transform: `translateY(${v.translateY}px) scale(${v.scale})`,\n transformOrigin: \"bottom center\",\n fontFamily:\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\",\n }}\n >\n <span\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n marginTop: description ? 1 : 0,\n }}\n >\n <ToastIcon variant={variant} color={ctx.iconColor} />\n </span>\n <div\n style={{\n display: \"flex\",\n flexDirection: \"column\",\n gap: 4,\n minWidth: 0,\n }}\n >\n <span\n style={{\n fontSize: 14,\n fontWeight: 500,\n lineHeight: 1.3,\n letterSpacing: \"-0.01em\",\n }}\n >\n {title}\n </span>\n {description !== undefined && (\n <span\n style={{\n fontSize: 13,\n lineHeight: 1.4,\n color: theme.mutedForeground,\n }}\n >\n {description}\n </span>\n )}\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/toast.tsx"
},
diff --git a/public/r/toggle-group.json b/public/r/toggle-group.json
index 16e042d8..52d7301d 100644
--- a/public/r/toggle-group.json
+++ b/public/r/toggle-group.json
@@ -12,7 +12,7 @@
"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 mode?: \"light\" | \"dark\";\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 mode,\n align = \"center\",\n className,\n}: ToggleGroupProps) {\n const theme = useRemocnTheme(themeOverride, mode);\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: theme.background,\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 { 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",
"type": "registry:component",
"target": "components/remocn/toggle-group.tsx"
},
diff --git a/public/r/tool-menu-slide-in.json b/public/r/tool-menu-slide-in.json
index 700e7c90..d53c732e 100644
--- a/public/r/tool-menu-slide-in.json
+++ b/public/r/tool-menu-slide-in.json
@@ -9,7 +9,7 @@
"files": [
{
"path": "registry/remocn/tool-menu-slide-in/index.tsx",
- "content": "\"use client\";\n\nimport {\n interpolate,\n Sequence,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport interface ToolMenuSlideInProps {\n panelStartFrame?: number;\n iconStagger?: number;\n iconCount?: number;\n accent?: string;\n panelColor?: string;\n background?: string;\n iconBg?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nconst ICON_GLYPHS = [\"B\", \"S\", \"C\", \"P\", \"E\", \"T\", \"M\", \"L\"];\nconst PANEL_SLIDE_DURATION = 22;\n\nexport function ToolMenuSlideIn({\n panelStartFrame = 18,\n iconStagger = 4,\n iconCount = 5,\n accent = \"#a78bfa\",\n panelColor = \"rgba(18, 18, 22, 0.72)\",\n background = \"#070708\",\n iconBg = \"rgba(255,255,255,0.06)\",\n speed = 1,\n className,\n}: ToolMenuSlideInProps) {\n const rawFrame = useCurrentFrame();\n const frame = rawFrame * speed;\n const { fps } = useVideoConfig();\n\n const safeIconCount = Math.max(1, Math.min(8, Math.floor(iconCount)));\n\n // Snappy slide-in: high stiffness, moderate damping, low mass.\n const slide = spring({\n frame: frame - panelStartFrame,\n fps,\n config: { damping: 20, stiffness: 320, mass: 0.6 },\n });\n\n const panelTy = interpolate(slide, [0, 1], [120, 0]);\n const panelOpacity = interpolate(slide, [0, 0.4], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n // Icon sizing\n const ICON_SIZE = 64;\n const ICON_GAP = 14;\n const PANEL_PADDING = 14;\n const panelInnerWidth =\n safeIconCount * ICON_SIZE + (safeIconCount - 1) * ICON_GAP;\n const panelWidth = panelInnerWidth + PANEL_PADDING * 2;\n const panelHeight = ICON_SIZE + PANEL_PADDING * 2;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n background,\n fontFamily: FONT_FAMILY,\n // subtle dot grid for editor-canvas feel\n backgroundImage:\n \"radial-gradient(rgba(255,255,255,0.045) 1px, transparent 1px)\",\n backgroundSize: \"22px 22px\",\n }}\n >\n {/* Top toolbar */}\n <div\n style={{\n position: \"absolute\",\n top: 24,\n left: 24,\n right: 24,\n height: 44,\n borderRadius: 12,\n background: \"rgba(255,255,255,0.04)\",\n border: \"1px solid rgba(255,255,255,0.06)\",\n display: \"flex\",\n alignItems: \"center\",\n padding: \"0 14px\",\n gap: 10,\n backdropFilter: \"blur(8px)\",\n }}\n >\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"rgba(255,255,255,0.18)\",\n }}\n />\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"rgba(255,255,255,0.12)\",\n }}\n />\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"rgba(255,255,255,0.12)\",\n }}\n />\n <div\n style={{\n marginLeft: 16,\n fontSize: 12,\n color: \"rgba(255,255,255,0.42)\",\n letterSpacing: \"0.02em\",\n }}\n >\n editor — untitled.png\n </div>\n </div>\n\n {/* Centered placeholder canvas (the \"image being edited\") */}\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: 720,\n height: 420,\n transform: \"translate(-50%, -54%)\",\n borderRadius: 18,\n background:\n \"linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015))\",\n border: \"1px solid rgba(255,255,255,0.06)\",\n boxShadow:\n \"inset 0 1px 0 rgba(255,255,255,0.05), inset 0 -40px 80px rgba(0,0,0,0.45), 0 30px 80px rgba(0,0,0,0.5)\",\n overflow: \"hidden\",\n }}\n >\n {/* Faux content block */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background:\n \"radial-gradient(60% 80% at 50% 40%, rgba(255,255,255,0.06), transparent 70%)\",\n }}\n />\n </div>\n\n {/* The slide-in tool menu */}\n <div\n style={{\n position: \"absolute\",\n bottom: 60,\n left: \"50%\",\n width: panelWidth,\n height: panelHeight,\n transform: `translateX(-50%) translateY(${panelTy}%)`,\n opacity: panelOpacity,\n background: panelColor,\n backdropFilter: \"blur(20px)\",\n WebkitBackdropFilter: \"blur(20px)\",\n border: \"1px solid rgba(255,255,255,0.08)\",\n borderRadius: panelHeight / 2,\n boxShadow:\n \"0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.02), inset 0 1px 0 rgba(255,255,255,0.08)\",\n padding: PANEL_PADDING,\n display: \"flex\",\n alignItems: \"center\",\n gap: ICON_GAP,\n }}\n >\n {Array.from({ length: safeIconCount }).map((_, i) => {\n const startAt =\n panelStartFrame + PANEL_SLIDE_DURATION + iconStagger * i;\n const isActive = i === 0;\n return (\n <Sequence\n key={i}\n from={startAt}\n layout=\"none\"\n name={`tool-icon-${i}`}\n >\n <ToolIcon\n glyph={ICON_GLYPHS[i % ICON_GLYPHS.length]}\n size={ICON_SIZE}\n bg={iconBg}\n accent={accent}\n active={isActive}\n fps={fps}\n />\n </Sequence>\n );\n })}\n </div>\n </div>\n );\n}\n\nfunction ToolIcon({\n glyph,\n size,\n bg,\n accent,\n active,\n fps,\n}: {\n glyph: string;\n size: number;\n bg: string;\n accent: string;\n active: boolean;\n fps: number;\n}) {\n const frame = useCurrentFrame();\n const pop = spring({\n frame,\n fps,\n config: { damping: 14, stiffness: 260, mass: 0.7 },\n });\n const scale = interpolate(pop, [0, 1], [0, 1]);\n const opacity = interpolate(pop, [0, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n return (\n <div\n style={{\n width: size,\n height: size,\n borderRadius: 14,\n background: active\n ? `linear-gradient(180deg, ${accent}33, ${accent}14)`\n : bg,\n border: active\n ? `1px solid ${accent}55`\n : \"1px solid rgba(255,255,255,0.06)\",\n boxShadow: active\n ? `inset 0 1px 0 rgba(255,255,255,0.12), 0 0 24px ${accent}33`\n : \"inset 0 1px 0 rgba(255,255,255,0.05)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: active ? \"#ffffff\" : \"rgba(255,255,255,0.7)\",\n fontSize: 22,\n fontWeight: 600,\n letterSpacing: \"-0.01em\",\n transform: `scale(${scale})`,\n opacity,\n transformOrigin: \"center\",\n }}\n >\n {glyph}\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport {\n interpolate,\n Sequence,\n spring,\n useCurrentFrame,\n useVideoConfig,\n} from \"remotion\";\n\nexport interface ToolMenuSlideInProps {\n panelStartFrame?: number;\n iconStagger?: number;\n iconCount?: number;\n accent?: string;\n panelColor?: string;\n iconBg?: string;\n speed?: number;\n className?: string;\n}\n\nconst FONT_FAMILY =\n \"var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif\";\n\nconst ICON_GLYPHS = [\"B\", \"S\", \"C\", \"P\", \"E\", \"T\", \"M\", \"L\"];\nconst PANEL_SLIDE_DURATION = 22;\n\nexport function ToolMenuSlideIn({\n panelStartFrame = 18,\n iconStagger = 4,\n iconCount = 5,\n accent = \"#a78bfa\",\n panelColor = \"rgba(18, 18, 22, 0.72)\",\n iconBg = \"rgba(255,255,255,0.06)\",\n speed = 1,\n className,\n}: ToolMenuSlideInProps) {\n const rawFrame = useCurrentFrame();\n const frame = rawFrame * speed;\n const { fps } = useVideoConfig();\n\n const safeIconCount = Math.max(1, Math.min(8, Math.floor(iconCount)));\n\n // Snappy slide-in: high stiffness, moderate damping, low mass.\n const slide = spring({\n frame: frame - panelStartFrame,\n fps,\n config: { damping: 20, stiffness: 320, mass: 0.6 },\n });\n\n const panelTy = interpolate(slide, [0, 1], [120, 0]);\n const panelOpacity = interpolate(slide, [0, 0.4], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n // Icon sizing\n const ICON_SIZE = 64;\n const ICON_GAP = 14;\n const PANEL_PADDING = 14;\n const panelInnerWidth =\n safeIconCount * ICON_SIZE + (safeIconCount - 1) * ICON_GAP;\n const panelWidth = panelInnerWidth + PANEL_PADDING * 2;\n const panelHeight = ICON_SIZE + PANEL_PADDING * 2;\n\n return (\n <div\n className={className}\n style={{\n position: \"absolute\",\n inset: 0,\n overflow: \"hidden\",\n fontFamily: FONT_FAMILY,\n // subtle dot grid for editor-canvas feel\n backgroundImage:\n \"radial-gradient(rgba(255,255,255,0.045) 1px, transparent 1px)\",\n backgroundSize: \"22px 22px\",\n }}\n >\n {/* Top toolbar */}\n <div\n style={{\n position: \"absolute\",\n top: 24,\n left: 24,\n right: 24,\n height: 44,\n borderRadius: 12,\n background: \"rgba(255,255,255,0.04)\",\n border: \"1px solid rgba(255,255,255,0.06)\",\n display: \"flex\",\n alignItems: \"center\",\n padding: \"0 14px\",\n gap: 10,\n backdropFilter: \"blur(8px)\",\n }}\n >\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"rgba(255,255,255,0.18)\",\n }}\n />\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"rgba(255,255,255,0.12)\",\n }}\n />\n <div\n style={{\n width: 10,\n height: 10,\n borderRadius: 999,\n background: \"rgba(255,255,255,0.12)\",\n }}\n />\n <div\n style={{\n marginLeft: 16,\n fontSize: 12,\n color: \"rgba(255,255,255,0.42)\",\n letterSpacing: \"0.02em\",\n }}\n >\n editor — untitled.png\n </div>\n </div>\n\n {/* Centered placeholder canvas (the \"image being edited\") */}\n <div\n style={{\n position: \"absolute\",\n left: \"50%\",\n top: \"50%\",\n width: 720,\n height: 420,\n transform: \"translate(-50%, -54%)\",\n borderRadius: 18,\n background:\n \"linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015))\",\n border: \"1px solid rgba(255,255,255,0.06)\",\n boxShadow:\n \"inset 0 1px 0 rgba(255,255,255,0.05), inset 0 -40px 80px rgba(0,0,0,0.45), 0 30px 80px rgba(0,0,0,0.5)\",\n overflow: \"hidden\",\n }}\n >\n {/* Faux content block */}\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n background:\n \"radial-gradient(60% 80% at 50% 40%, rgba(255,255,255,0.06), transparent 70%)\",\n }}\n />\n </div>\n\n {/* The slide-in tool menu */}\n <div\n style={{\n position: \"absolute\",\n bottom: 60,\n left: \"50%\",\n width: panelWidth,\n height: panelHeight,\n transform: `translateX(-50%) translateY(${panelTy}%)`,\n opacity: panelOpacity,\n background: panelColor,\n backdropFilter: \"blur(20px)\",\n WebkitBackdropFilter: \"blur(20px)\",\n border: \"1px solid rgba(255,255,255,0.08)\",\n borderRadius: panelHeight / 2,\n boxShadow:\n \"0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.02), inset 0 1px 0 rgba(255,255,255,0.08)\",\n padding: PANEL_PADDING,\n display: \"flex\",\n alignItems: \"center\",\n gap: ICON_GAP,\n }}\n >\n {Array.from({ length: safeIconCount }).map((_, i) => {\n const startAt =\n panelStartFrame + PANEL_SLIDE_DURATION + iconStagger * i;\n const isActive = i === 0;\n return (\n <Sequence\n key={i}\n from={startAt}\n layout=\"none\"\n name={`tool-icon-${i}`}\n >\n <ToolIcon\n glyph={ICON_GLYPHS[i % ICON_GLYPHS.length]}\n size={ICON_SIZE}\n bg={iconBg}\n accent={accent}\n active={isActive}\n fps={fps}\n />\n </Sequence>\n );\n })}\n </div>\n </div>\n );\n}\n\nfunction ToolIcon({\n glyph,\n size,\n bg,\n accent,\n active,\n fps,\n}: {\n glyph: string;\n size: number;\n bg: string;\n accent: string;\n active: boolean;\n fps: number;\n}) {\n const frame = useCurrentFrame();\n const pop = spring({\n frame,\n fps,\n config: { damping: 14, stiffness: 260, mass: 0.7 },\n });\n const scale = interpolate(pop, [0, 1], [0, 1]);\n const opacity = interpolate(pop, [0, 0.6], [0, 1], {\n extrapolateLeft: \"clamp\",\n extrapolateRight: \"clamp\",\n });\n\n return (\n <div\n style={{\n width: size,\n height: size,\n borderRadius: 14,\n background: active\n ? `linear-gradient(180deg, ${accent}33, ${accent}14)`\n : bg,\n border: active\n ? `1px solid ${accent}55`\n : \"1px solid rgba(255,255,255,0.06)\",\n boxShadow: active\n ? `inset 0 1px 0 rgba(255,255,255,0.12), 0 0 24px ${accent}33`\n : \"inset 0 1px 0 rgba(255,255,255,0.05)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: active ? \"#ffffff\" : \"rgba(255,255,255,0.7)\",\n fontSize: 22,\n fontWeight: 600,\n letterSpacing: \"-0.01em\",\n transform: `scale(${scale})`,\n opacity,\n transformOrigin: \"center\",\n }}\n >\n {glyph}\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/tool-menu-slide-in.tsx"
}
diff --git a/public/r/tooltip.json b/public/r/tooltip.json
index b6b7a97b..7d6e0149 100644
--- a/public/r/tooltip.json
+++ b/public/r/tooltip.json
@@ -12,7 +12,7 @@
"files": [
{
"path": "registry/remocn-ui/tooltip/index.tsx",
- "content": "\"use client\";\n\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type TooltipState = \"hidden\" | \"visible\";\n\nexport type TooltipSide = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nexport interface TooltipProps {\n state?: TooltipState;\n style?: TooltipStyle;\n label: string;\n side?: TooltipSide;\n theme?: Partial<RemocnTheme>;\n mode?: \"light\" | \"dark\";\n className?: string;\n}\n\nconst ARROW = 10;\n\nexport interface TooltipStyle {\n opacity: number;\n scale: number;\n translate: number;\n}\n\nexport function tooltipStyle(state: TooltipState): TooltipStyle {\n switch (state) {\n case \"visible\":\n return { opacity: 1, scale: 1, translate: 0 };\n default:\n return { opacity: 0, scale: 0.96, translate: 4 };\n }\n}\n\nfunction offsetFor(\n side: TooltipSide,\n translate: number,\n): {\n x: number;\n y: number;\n} {\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 Tooltip({\n state = \"hidden\",\n style,\n label,\n side = \"top\",\n theme: themeOverride,\n mode,\n className,\n}: TooltipProps) {\n const theme = useRemocnTheme(themeOverride, mode);\n const v = style ?? tooltipStyle(state);\n\n const bg = theme.foreground;\n const fg = theme.background;\n const { x, y } = offsetFor(side, v.translate);\n\n const arrowStyle: React.CSSProperties = {\n position: \"absolute\",\n width: ARROW,\n height: ARROW,\n background: bg,\n borderRadius: 2,\n transform: \"rotate(45deg)\",\n ...(side === \"top\" && {\n bottom: -ARROW / 2,\n left: \"50%\",\n marginLeft: -ARROW / 2,\n }),\n ...(side === \"bottom\" && {\n top: -ARROW / 2,\n left: \"50%\",\n marginLeft: -ARROW / 2,\n }),\n ...(side === \"left\" && {\n right: -ARROW / 2,\n top: \"50%\",\n marginTop: -ARROW / 2,\n }),\n ...(side === \"right\" && {\n left: -ARROW / 2,\n top: \"50%\",\n marginTop: -ARROW / 2,\n }),\n };\n\n return (\n <div\n className={className}\n style={{\n position: \"relative\",\n display: \"inline-flex\",\n alignItems: \"center\",\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 position: \"relative\",\n padding: \"6px 12px\",\n background: bg,\n color: fg,\n fontSize: 12,\n fontWeight: 500,\n lineHeight: 1.3,\n letterSpacing: \"-0.005em\",\n borderRadius: theme.radius + 4,\n whiteSpace: \"nowrap\",\n boxShadow: \"0 4px 12px -4px rgba(0,0,0,0.25)\",\n }}\n >\n {label}\n {}\n <span style={arrowStyle} />\n </div>\n </div>\n );\n}\n",
+ "content": "\"use client\";\n\nimport { type RemocnTheme, useRemocnTheme } from \"@/lib/remocn-ui\";\n\nexport type TooltipState = \"hidden\" | \"visible\";\n\nexport type TooltipSide = \"top\" | \"bottom\" | \"left\" | \"right\";\n\nexport interface TooltipProps {\n state?: TooltipState;\n style?: TooltipStyle;\n label: string;\n side?: TooltipSide;\n theme?: Partial<RemocnTheme>;\n className?: string;\n}\n\nconst ARROW = 10;\n\nexport interface TooltipStyle {\n opacity: number;\n scale: number;\n translate: number;\n}\n\nexport function tooltipStyle(state: TooltipState): TooltipStyle {\n switch (state) {\n case \"visible\":\n return { opacity: 1, scale: 1, translate: 0 };\n default:\n return { opacity: 0, scale: 0.96, translate: 4 };\n }\n}\n\nfunction offsetFor(\n side: TooltipSide,\n translate: number,\n): {\n x: number;\n y: number;\n} {\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 Tooltip({\n state = \"hidden\",\n style,\n label,\n side = \"top\",\n theme: themeOverride,\n className,\n}: TooltipProps) {\n const theme = useRemocnTheme(themeOverride, \"light\");\n const v = style ?? tooltipStyle(state);\n\n const bg = theme.foreground;\n const fg = theme.background;\n const { x, y } = offsetFor(side, v.translate);\n\n const arrowStyle: React.CSSProperties = {\n position: \"absolute\",\n width: ARROW,\n height: ARROW,\n background: bg,\n borderRadius: 2,\n transform: \"rotate(45deg)\",\n ...(side === \"top\" && {\n bottom: -ARROW / 2,\n left: \"50%\",\n marginLeft: -ARROW / 2,\n }),\n ...(side === \"bottom\" && {\n top: -ARROW / 2,\n left: \"50%\",\n marginLeft: -ARROW / 2,\n }),\n ...(side === \"left\" && {\n right: -ARROW / 2,\n top: \"50%\",\n marginTop: -ARROW / 2,\n }),\n ...(side === \"right\" && {\n left: -ARROW / 2,\n top: \"50%\",\n marginTop: -ARROW / 2,\n }),\n };\n\n return (\n <div\n className={className}\n style={{\n position: \"relative\",\n display: \"inline-flex\",\n alignItems: \"center\",\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 position: \"relative\",\n padding: \"6px 12px\",\n background: bg,\n color: fg,\n fontSize: 12,\n fontWeight: 500,\n lineHeight: 1.3,\n letterSpacing: \"-0.005em\",\n borderRadius: theme.radius + 4,\n whiteSpace: \"nowrap\",\n boxShadow: \"0 4px 12px -4px rgba(0,0,0,0.25)\",\n }}\n >\n {label}\n {}\n <span style={arrowStyle} />\n </div>\n </div>\n );\n}\n",
"type": "registry:component",
"target": "components/remocn/tooltip.tsx"
},
diff --git a/public/r/v0.json b/public/r/v0.json
index cd91c065..1f7b440d 100644
--- a/public/r/v0.json
+++ b/public/r/v0.json
@@ -14,7 +14,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 theme?: \"light\" | \"dark\";\n background?: \"surface\" | \"transparent\";\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 theme = \"dark\",\n background = \"surface\",\n speed = 1,\n}: V0Props) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = THEMES[theme] ?? 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 pageBg = background === \"transparent\" ? \"transparent\" : t.page;\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: pageBg }}>\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:\n theme === \"light\"\n ? \"0 8px 30px -14px rgba(13,13,13,0.12)\"\n : \"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\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",
"type": "registry:component",
"target": "components/remocn/v0.tsx"
}
diff --git a/public/r/x-follow-card.json b/public/r/x-follow-card.json
index 0a5c045a..85f86919 100644
--- a/public/r/x-follow-card.json
+++ b/public/r/x-follow-card.json
@@ -13,7 +13,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 theme?: \"light\" | \"dark\";\n background?: \"surface\" | \"transparent\";\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 mode={theme}\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 theme = \"light\",\n background = \"surface\",\n orientation = \"horizontal\",\n speed = 1,\n}: XFollowCardProps) {\n const frame = useCurrentFrame();\n const { width, height, fps } = useVideoConfig();\n const t = THEMES[theme] ?? 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 const pageBg = background === \"transparent\" ? \"transparent\" : t.page;\n\n return (\n <AbsoluteFill style={{ background: pageBg }}>\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:\n theme === \"light\"\n ? \"0 12px 40px -16px rgba(15,20,25,0.18)\"\n : \"0 12px 40px -16px rgba(0,0,0,0.6)\",\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={theme} accent={accentColor} style={cursorStyle} />\n </div>\n </AbsoluteFill>\n );\n}\n",
+ "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",
"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.json
index cf6b1ee0..8d0a39db 100644
--- a/public/r/x-followers-overview.json
+++ b/public/r/x-followers-overview.json
@@ -13,7 +13,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 theme?: \"light\" | \"dark\";\n orientation?: \"horizontal\" | \"vertical\";\n background?: \"surface\" | \"transparent\";\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 theme = \"light\",\n orientation = \"horizontal\",\n background = \"surface\",\n speed = 1,\n}: XFollowersOverviewProps) {\n const frame = useCurrentFrame();\n const { durationInFrames, width, height, fps } = useVideoConfig();\n const t = THEMES[theme] ?? 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 const pageBg = background === \"transparent\" ? \"transparent\" : t.bg;\n\n return (\n <AbsoluteFill style={{ background: pageBg }}>\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 { 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",
"type": "registry:component",
"target": "components/remocn/x-followers-overview.tsx"
}