Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
feat: added blocks
dev_wandry37af423707a3
diff --git a/components/docs/block-preview.tsx b/components/docs/block-preview.tsxnew file mode 100644index 00000000..5f72ea0c--- /dev/null+++ b/components/docs/block-preview.tsx@@ -0,0 +1,54 @@+"use client";++import { DynamicCodeBlock } from "fumadocs-ui/components/dynamic-codeblock";+import { PreviewStage } from "@/lib/ui-preview-internals";+import { blockExamples } from "./examples/blocks";++/**+ * Controls-free preview for composition blocks. A THIN wrapper over+ * `PreviewStage` (`lib/ui-preview-internals.tsx` — owns lazy-mount + autoplay)+ * plus `DynamicCodeBlock`: the live scene Player above, the copyable scene+ * snippet below. No Tabs, no customizer, no nuqs, no controls.+ *+ * Replaces both the vestigial `LiveExample` and `UiComponentPreview` for the+ * blocks tier — blocks have no `registry[name]` config and no honored knobs, so+ * the heavier ui-tier widget does not apply (see §0B.7).+ */++/** Shared "Unknown component" fallback — matches the existing docs widgets. */+function UnknownComponent({ name }: { name: string }) {+ return (+ <div className="not-prose mb-6 rounded-lg border border-fd-border p-4 text-sm text-fd-muted-foreground">+ Unknown block: <code>{name}</code>+ </div>+ );+}++export function BlockPreview({ name }: { name: string }) {+ const entry = blockExamples[name];++ if (!entry) {+ return <UnknownComponent name={name} />;+ }++ // The code field may be a string or a zero-arg function; normalize to string.+ const code = typeof entry.code === "function" ? entry.code() : entry.code;++ return (+ <div className="not-prose mb-6 flex w-full flex-col gap-4">+ <PreviewStage+ name={name}+ Component={entry.Component}+ inputProps={{}}+ durationInFrames={entry.durationInFrames}+ fps={entry.fps}+ compositionWidth={entry.width}+ compositionHeight={entry.height}+ />++ <div className="surface-card overflow-hidden rounded-2xl [&_pre]:!rounded-none [&_pre]:!border-0 [&_pre]:!bg-transparent">+ <DynamicCodeBlock lang="tsx" code={code} />+ </div>+ </div>+ );+}diff --git a/components/docs/examples/ai-prompt-flow-example.tsx b/components/docs/examples/ai-prompt-flow-example.tsxnew file mode 100644index 00000000..9c8966e9--- /dev/null+++ b/components/docs/examples/ai-prompt-flow-example.tsx@@ -0,0 +1,23 @@+"use client";++import { AiPromptFlow } from "@/registry/remocn-ui/ai-prompt-flow";++/**+ * Fixed lifecycle demo for the `ai-prompt-flow` block: a prompt types into the+ * field, the Generate button runs hover → press → loading, the answer panel+ * reveals a skeleton shimmer, then crossfades into the generated answer, and a+ * ready toast slides in. The block is a pure orchestrator — every channel comes+ * from a composed primitive's hook; the shimmer is owned by `skeleton-block`.+ *+ * Timeline (US-B002 beat table): typing 0→50; button hover 52 → press 58 →+ * loading 62; skeleton loading 64; shimmer sweep 64→150; skeleton loaded 150+ * (opacities sum to 1, no box jump); toast enter 160; toast dismiss 220.+ * durationInFrames 230 (220 + ~10 settle).+ */+export const AiPromptFlowExampleScene = () => <AiPromptFlow />;++export const aiPromptFlowExampleCode = (): string => {+ return `import { AiPromptFlow } from "@/components/remocn/ai-prompt-flow";++export const Scene = () => <AiPromptFlow />;`;+};diff --git a/components/docs/examples/blocks/index.tsx b/components/docs/examples/blocks/index.tsxnew file mode 100644index 00000000..316b1bed--- /dev/null+++ b/components/docs/examples/blocks/index.tsx@@ -0,0 +1,118 @@+import type { ComponentType } from "react";+import { FPS, H, W } from "@/lib/customizer-config";+import {+ SignupFlowExampleScene,+ signupFlowExampleCode,+} from "../signup-flow-example";+import {+ AiPromptFlowExampleScene,+ aiPromptFlowExampleCode,+} from "../ai-prompt-flow-example";+import {+ CheckoutFlowExampleScene,+ checkoutFlowExampleCode,+} from "../checkout-flow-example";+import {+ OnboardingStepperFlowExampleScene,+ onboardingStepperFlowExampleCode,+} from "../onboarding-stepper-flow-example";+import {+ SettingsToggleFlowExampleScene,+ settingsToggleFlowExampleCode,+} from "../settings-toggle-flow-example";++/**+ * Blocks scene registry — parallel to the ui-tier `examples` map+ * (`components/docs/examples/index.tsx`), but for composition blocks. Keyed by+ * the `<name>-flow` scene key, each entry pairs a Remotion scene component with+ * its copyable install-path code string and the timing the Player runs at.+ *+ * Unlike `ExampleEntry`, there is no customizer here: blocks are controls-free,+ * so `code` is the finished scene snippet (string or a zero-arg function that+ * returns one), never a per-honored-prop template.+ *+ * The 5 scenes are registered later in the Wiring task — this map starts EMPTY.+ */+export interface BlockExampleEntry {+ Component: ComponentType;+ /**+ * The copyable scene snippet. Blocks have no honored controls, so this is the+ * finished code — a plain string, or a zero-arg function returning one+ * (mirrors the `<name>FlowExampleCode` callable shape) so either form works.+ */+ code: string | ((values?: Record<string, unknown>) => string);+ durationInFrames: number;+ fps: number;+ width: number;+ height: number;+}++export const blockExamples: Record<string, BlockExampleEntry> = {+ "signup-flow": {+ Component: SignupFlowExampleScene,+ code: signupFlowExampleCode,+ // Toast dismiss 210 + ~20 settle (US-B001).+ durationInFrames: 230,+ fps: FPS,+ width: W,+ height: H,+ },+ "ai-prompt-flow": {+ Component: AiPromptFlowExampleScene,+ code: aiPromptFlowExampleCode,+ // Toast dismiss 220 + ~10 settle (US-B002).+ durationInFrames: 230,+ fps: FPS,+ width: W,+ height: H,+ },+ "checkout-flow": {+ Component: CheckoutFlowExampleScene,+ code: checkoutFlowExampleCode,+ // Final beat 235 + ~10 settle (US-B003).+ durationInFrames: 245,+ fps: FPS,+ width: W,+ height: H,+ },+ "onboarding-stepper-flow": {+ Component: OnboardingStepperFlowExampleScene,+ code: onboardingStepperFlowExampleCode,+ // Success 156 + ~20 final ease/settle (US-B004).+ durationInFrames: 175,+ fps: FPS,+ width: W,+ height: H,+ },+ "settings-toggle-flow": {+ Component: SettingsToggleFlowExampleScene,+ code: settingsToggleFlowExampleCode,+ // Final beat 215 + ~10 settle (US-B005).+ durationInFrames: 225,+ fps: FPS,+ width: W,+ height: H,+ },+};++/**+ * Parallel meta lookup mirroring `UI_SCENE_META` usage in+ * `ui-component-preview.tsx`, keyed by `<name>-flow`. Minimal by design — blocks+ * expose no honored controls, so this only carries the scene's code emitter for+ * any caller that wants the snippet without instantiating the Player. Starts+ * EMPTY; populated alongside `blockExamples` in the Wiring task.+ */+export const BLOCK_SCENE_META: Record<+ string,+ { code: string | ((values?: Record<string, unknown>) => string) }+> = {+ "signup-flow": { code: signupFlowExampleCode },+ "ai-prompt-flow": { code: aiPromptFlowExampleCode },+ "checkout-flow": { code: checkoutFlowExampleCode },+ "onboarding-stepper-flow": { code: onboardingStepperFlowExampleCode },+ "settings-toggle-flow": { code: settingsToggleFlowExampleCode },+};++// Re-export so block entries can reference the shared timing constants without+// reaching back into customizer-config from every scene file.+export { FPS, H, W };diff --git a/components/docs/examples/checkout-flow-example.tsx b/components/docs/examples/checkout-flow-example.tsxnew file mode 100644index 00000000..ae706806--- /dev/null+++ b/components/docs/examples/checkout-flow-example.tsx@@ -0,0 +1,23 @@+"use client";++import { CheckoutFlow } from "@/registry/remocn-ui/checkout-flow";++/**+ * Fixed lifecycle demo for the `checkout-flow` block: a cursor flips the billing+ * toggle monthly → yearly, clicks Upgrade, a payment Dialog opens, the card+ * number types in, the confirm button runs press → loading → success, the Dialog+ * closes and a success Toast slides in. The block is a pure orchestrator — every+ * channel comes from a composed primitive's hook.+ *+ * Timeline (US-B003 beat table): toggle click 24 ≡ toggle slide 24; Upgrade+ * click 50 ≡ button press 50; dialog open 56; card typing 70→120; confirm press+ * 124 → loading 128 → success 165; dialog close 175; toast enter 178 → dismiss+ * 235. durationInFrames 245 (235 + ~10 settle).+ */+export const CheckoutFlowExampleScene = () => <CheckoutFlow />;++export const checkoutFlowExampleCode = (): string => {+ return `import { CheckoutFlow } from "@/components/remocn/checkout-flow";++export const Scene = () => <CheckoutFlow />;`;+};diff --git a/components/docs/examples/onboarding-stepper-flow-example.tsx b/components/docs/examples/onboarding-stepper-flow-example.tsxnew file mode 100644index 00000000..3c6d2374--- /dev/null+++ b/components/docs/examples/onboarding-stepper-flow-example.tsx@@ -0,0 +1,23 @@+"use client";++import { OnboardingStepperFlow } from "@/registry/remocn-ui/onboarding-stepper-flow";++/**+ * Fixed lifecycle demo for the `onboarding-stepper-flow` block: a Stepper rail+ * advances through three steps while the content crossfades — step 1 types an+ * email, step 2 checks a plan radio, step 3 flips a settings switch — and the+ * Finish button resolves to success. Navigation is button-driven (no cursor).+ * The block is a pure orchestrator; the only block-owned motion is the panel+ * crossfade, a §0B.3-sanctioned LINEAR read of the stepper's exposed `position`.+ *+ * Timeline (US-B004 beat table): step 1 typing 10→55; Next press 60 → stepper+ * advance 64; plan radio 90; Next press 100 → stepper advance 104; switch 130;+ * Finish press 150 → success 156. durationInFrames 175 (~160 final ease + settle).+ */+export const OnboardingStepperFlowExampleScene = () => <OnboardingStepperFlow />;++export const onboardingStepperFlowExampleCode = (): string => {+ return `import { OnboardingStepperFlow } from "@/components/remocn/onboarding-stepper-flow";++export const Scene = () => <OnboardingStepperFlow />;`;+};diff --git a/components/docs/examples/settings-toggle-flow-example.tsx b/components/docs/examples/settings-toggle-flow-example.tsxnew file mode 100644index 00000000..df315e78--- /dev/null+++ b/components/docs/examples/settings-toggle-flow-example.tsx@@ -0,0 +1,22 @@+"use client";++import { SettingsToggleFlow } from "@/registry/remocn-ui/settings-toggle-flow";++/**+ * Fixed lifecycle demo for the `settings-toggle-flow` block: a cursor walks a+ * settings panel — flipping a Switch, opening a Select and choosing an option,+ * then dragging a Slider — ending on a "Settings saved" Toast. The block is a+ * pure orchestrator; every channel comes from a composed primitive's hook.+ *+ * Timeline (US-B005 beat table): switch click 24 ≡ switch on 24; select click 55+ * ≡ panel open 55; item click 80 ≡ select 80; panel close 90; slider drag+ * 105→150 (dual-channel value + thumb); toast enter 155 → dismiss 215.+ * durationInFrames 225 (215 + ~10 settle).+ */+export const SettingsToggleFlowExampleScene = () => <SettingsToggleFlow />;++export const settingsToggleFlowExampleCode = (): string => {+ return `import { SettingsToggleFlow } from "@/components/remocn/settings-toggle-flow";++export const Scene = () => <SettingsToggleFlow />;`;+};diff --git a/components/docs/examples/signup-flow-example.tsx b/components/docs/examples/signup-flow-example.tsxnew file mode 100644index 00000000..a9a06103--- /dev/null+++ b/components/docs/examples/signup-flow-example.tsx@@ -0,0 +1,22 @@+"use client";++import { SignupFlow } from "@/registry/remocn-ui/signup-flow";++/**+ * Fixed lifecycle demo for the `signup-flow` block: a cursor clicks the email+ * field, the value types in, the "agree" box checks, the Create button runs+ * idle → press → loading → success, and a success toast slides in. The block is+ * a pure orchestrator — every channel comes from a composed primitive's hook.+ *+ * Timeline (US-B001 beat table): cursor click 30 ≡ input active 30; typing+ * 30→70; checkbox 82; button hover 95 ≡ cursor click 95 → press 104 → loading+ * 110 → success 150 ≡ toast enter 150; toast dismiss 210. durationInFrames 230+ * (210 + ~20 settle).+ */+export const SignupFlowExampleScene = () => <SignupFlow />;++export const signupFlowExampleCode = (): string => {+ return `import { SignupFlow } from "@/components/remocn/signup-flow";++export const Scene = () => <SignupFlow />;`;+};diff --git a/content/docs/ui/blocks/ai-prompt-flow.mdx b/content/docs/ui/blocks/ai-prompt-flow.mdxnew file mode 100644index 00000000..f0e76aae--- /dev/null+++ b/content/docs/ui/blocks/ai-prompt-flow.mdx@@ -0,0 +1,74 @@+---+title: AiPromptFlow+description: AI prompt submission with skeleton loading shimmer and response reveal crossfade+---++<BlockPreview name="ai-prompt-flow" />++A composition scene showing the AI request lifecycle: prompt typing, submit, skeleton shimmer, response reveal, and completion toast. The skeleton block's shimmer motion and the crossfade between loading and loaded states demonstrate composition of motion atoms without new motion math.++## Installation++<InstallBlock name="ai-prompt-flow" />++<Note>+Installing `ai-prompt-flow` automatically installs the shared `remocn-ui` core and all composed primitives via `registryDependencies`: input, button, skeleton, skeleton-block, and toast. You do not need to install them separately.+</Note>++## Composed primitives++- **Input** — text reveal for the prompt+- **Button** — hover/press/loading state progression+- **Skeleton** — loading state with shimmer animation+- **Skeleton-block** — motion atom shimmer sweep (loopable)+- **Toast** — completion message auto-dismiss++## Timeline narrative++The input begins revealing the prompt text from frame 0 to frame 50. At frame 52, the cursor moves to the button trigger, entering hover state. Frame 58 brings a press, transitioning to loading at frame 62. Simultaneously, the skeleton enters loading state and skeleton-block begins its shimmer sweep, looping from frame 64 to frame 150. At frame 150, the skeleton state changes to loaded, crossfading from the shimmer to the response text with opacities summing to 1 (no layout shift). The toast appears at frame 160 to confirm the response is ready and auto-dismisses at frame 220.++## Props++<PropsTable+ rows={[+ {+ name: "prompt",+ type: "string",+ default: "\"Summarize this thread\"",+ description: "Prompt text to be revealed during input animation.",+ },+ {+ name: "buttonLabel",+ type: "string",+ default: "\"Generate\"",+ description: "Text displayed on the submit button.",+ },+ {+ name: "answer",+ type: "string",+ description: "Response text shown after loading completes.",+ },+ {+ name: "answerLines",+ type: "string[]",+ description: "Response as array of lines (alternative to answer).",+ },+ {+ name: "toastTitle",+ type: "string",+ default: "\"Response ready\"",+ description: "Success message shown in the toast.",+ },+ {+ name: "mode",+ type: "\"light\" | \"dark\"",+ default: "\"light\"",+ description: "Color mode applied to all composed primitives.",+ },+ {+ name: "theme",+ type: "RemocnTheme",+ description: "Optional theme override (concrete oklch/hex/rgb values).",+ },+ ]}+/>diff --git a/content/docs/ui/blocks/checkout-flow.mdx b/content/docs/ui/blocks/checkout-flow.mdxnew file mode 100644index 00000000..e2c862a6--- /dev/null+++ b/content/docs/ui/blocks/checkout-flow.mdx@@ -0,0 +1,77 @@+---+title: CheckoutFlow+description: Pricing toggle, cursor-driven checkout dialog with card input and payment confirmation+---++<BlockPreview name="checkout-flow" />++A composition scene demonstrating a complete checkout flow: toggle between pricing plans, cursor-driven upgrade button, modal dialog with card entry, payment processing, and success confirmation. Shows dialog open/close animations and input reveal within a modal context.++## Installation++<InstallBlock name="checkout-flow" />++<Note>+Installing `checkout-flow` automatically installs the shared `remocn-ui` core and all composed primitives via `registryDependencies`: toggle-group, dialog, input, button, cursor, and toast. You do not need to install them separately.+</Note>++## Composed primitives++- **Toggle-group** — segmented control for plan selection+- **Dialog** — modal backdrop and zoom animation+- **Input** — card number reveal animation+- **Button** — primary action with hover/press/loading/success states+- **Cursor** — animated pointer with click ripples+- **Toast** — payment confirmation message++## Timeline narrative++The scene opens with the toggle-group showing monthly/yearly options. At frame 24, the cursor clicks the yearly segment, and the toggle animates to yearly (thumb slides to the new position). At frame 50, the cursor moves to the upgrade button and clicks, triggering hover then press states. The dialog opens at frame 56 with backdrop dim and zoom. The input inside the dialog begins revealing the card number from frame 70 to frame 120. At frame 124, the confirm button is pressed, transitioning to loading at frame 128. By frame 165, the button reaches success state (checkmark). The dialog closes at frame 175, and the success toast appears at frame 178, auto-dismissing at frame 235.++## Props++<PropsTable+ rows={[+ {+ name: "plans",+ type: "{value: string; label: string}[]",+ default: "[{value:\"monthly\",label:\"Monthly\"},{value:\"yearly\",label:\"Yearly\"}]",+ description: "Array of pricing plan options for the toggle-group.",+ },+ {+ name: "upgradeLabel",+ type: "string",+ default: "\"Upgrade\"",+ description: "Text displayed on the upgrade button.",+ },+ {+ name: "cardPlaceholder",+ type: "string",+ default: "\"4242 4242 4242 4242\"",+ description: "Card number placeholder shown in the input.",+ },+ {+ name: "confirmLabel",+ type: "string",+ default: "\"Pay\"",+ description: "Text displayed on the confirm button inside the dialog.",+ },+ {+ name: "toastTitle",+ type: "string",+ default: "\"Payment successful\"",+ description: "Success message shown in the toast.",+ },+ {+ name: "mode",+ type: "\"light\" | \"dark\"",+ default: "\"light\"",+ description: "Color mode applied to all composed primitives.",+ },+ {+ name: "theme",+ type: "RemocnTheme",+ description: "Optional theme override (concrete oklch/hex/rgb values).",+ },+ ]}+/>diff --git a/content/docs/ui/blocks/index.mdx b/content/docs/ui/blocks/index.mdxnew file mode 100644index 00000000..d839d666--- /dev/null+++ b/content/docs/ui/blocks/index.mdx@@ -0,0 +1,41 @@+---+title: Blocks+description: Full video scenes assembled from remocn-ui primitives+---++Complete, shippable video compositions built from remocn-ui primitives. Each block is a standalone React component that orchestrates animations and transitions to tell a coherent story.++<ComponentCardGrid+ items={[+ {+ name: "SignupFlow",+ description: "Account creation with email input, agreement, and success toast",+ status: "stable",+ href: "/docs/ui/blocks/signup-flow",+ },+ {+ name: "AiPromptFlow",+ description: "AI prompt submission with skeleton loading and response reveal",+ status: "stable",+ href: "/docs/ui/blocks/ai-prompt-flow",+ },+ {+ name: "CheckoutFlow",+ description: "Pricing toggle, checkout dialog, and payment confirmation",+ status: "stable",+ href: "/docs/ui/blocks/checkout-flow",+ },+ {+ name: "OnboardingStepperFlow",+ description: "Multi-step onboarding with form inputs and panel crossfade",+ status: "stable",+ href: "/docs/ui/blocks/onboarding-stepper-flow",+ },+ {+ name: "SettingsToggleFlow",+ description: "Settings panel with toggle, select, and slider controls",+ status: "stable",+ href: "/docs/ui/blocks/settings-toggle-flow",+ },+ ]}+/>diff --git a/content/docs/ui/blocks/meta.json b/content/docs/ui/blocks/meta.jsonnew file mode 100644index 00000000..947604f1--- /dev/null+++ b/content/docs/ui/blocks/meta.json@@ -0,0 +1,5 @@+{+ "title": "Blocks",+ "collapsible": false,+ "pages": ["index", "signup-flow", "ai-prompt-flow", "checkout-flow", "onboarding-stepper-flow", "settings-toggle-flow"]+}diff --git a/content/docs/ui/blocks/onboarding-stepper-flow.mdx b/content/docs/ui/blocks/onboarding-stepper-flow.mdxnew file mode 100644index 00000000..4ac88a06--- /dev/null+++ b/content/docs/ui/blocks/onboarding-stepper-flow.mdx@@ -0,0 +1,76 @@+---+title: OnboardingStepperFlow+description: Multi-step onboarding with form inputs and panel crossfade driven by stepper position+---++<BlockPreview name="onboarding-stepper-flow" />++A composition scene showing a three-step onboarding flow: account setup, plan selection, and settings configuration. Demonstrates the sanctioned panel-crossfade pattern where step visibility is derived linearly from the stepper's exposed position channel, with no additional motion math.++## Installation++<InstallBlock name="onboarding-stepper-flow" />++<Note>+Installing `onboarding-stepper-flow` automatically installs the shared `remocn-ui` core and all composed primitives via `registryDependencies`: stepper, input, radio, switch, and button. You do not need to install them separately.+</Note>++## Composed primitives++- **Stepper** — multi-step indicator with completed-step checkmarks+- **Input** — text reveal for account name+- **Radio** — plan selection control+- **Switch** — toggle for settings option+- **Button** — next/finish navigation actions++## Timeline narrative++The stepper and step-1 input are both visible at frame 0, with the input beginning to reveal the account name from frame 10 to frame 55. At frame 60, the Next button is pressed, triggering the stepper to advance from position 0 to position 1 from frames 64–90. The panel crossfade is derived linearly from `StepperStyle.position` (opacity = clamp(linear(position))). The radio for plan selection becomes active during its step window (90–104). At frame 100, Next is pressed again, advancing position to 2, and the switch control appears in step 3. At frame 150, the Finish button is pressed and transitions to success, with the stepper simultaneously completing and drawing checkmarks on all passed steps.++## Props++<PropsTable+ rows={[+ {+ name: "steps",+ type: "string[]",+ default: "[\"Account\",\"Plan\",\"Settings\"]",+ description: "Array of step titles displayed in the stepper.",+ },+ {+ name: "name",+ type: "string",+ default: "\"[email protected]\"",+ description: "Account name/email to be revealed in step 1 input.",+ },+ {+ name: "plans",+ type: "string[]",+ default: "[\"Free\",\"Pro\",\"Team\"]",+ description: "Array of plan options for step 2 radio selection.",+ },+ {+ name: "nextLabel",+ type: "string",+ default: "\"Next\"",+ description: "Text displayed on the next-step button.",+ },+ {+ name: "finishLabel",+ type: "string",+ default: "\"Finish\"",+ description: "Text displayed on the finish button (step 3).",+ },+ {+ name: "mode",+ type: "\"light\" | \"dark\"",+ default: "\"light\"",+ description: "Color mode applied to all composed primitives.",+ },+ {+ name: "theme",+ type: "RemocnTheme",+ description: "Optional theme override (concrete oklch/hex/rgb values).",+ },+ ]}+/>diff --git a/content/docs/ui/blocks/settings-toggle-flow.mdx b/content/docs/ui/blocks/settings-toggle-flow.mdxnew file mode 100644index 00000000..7d2e0ab3--- /dev/null+++ b/content/docs/ui/blocks/settings-toggle-flow.mdx@@ -0,0 +1,64 @@+---+title: SettingsToggleFlow+description: Settings panel with cursor-driven switch, select dropdown, and slider controls+---++<BlockPreview name="settings-toggle-flow" />++A composition scene demonstrating a settings panel workflow: cursor navigates through a switch toggle, opens a select dropdown to choose a theme, and drags a slider to adjust volume. Concludes with a settings-saved confirmation toast. Shows cursor-driven interactions across multiple interactive primitives in sequence.++## Installation++<InstallBlock name="settings-toggle-flow" />++<Note>+Installing `settings-toggle-flow` automatically installs the shared `remocn-ui` core and all composed primitives via `registryDependencies`: switch, select, slider, cursor, and toast. Select automatically includes button and select-item via its own registryDependencies. You do not need to install them separately.+</Note>++## Composed primitives++- **Switch** — toggle for notification settings+- **Select** — dropdown control for theme selection (includes button + select-item)+- **Slider** — dual-channel drag control (value + thumb state)+- **Cursor** — animated pointer with click and press interactions+- **Toast** — settings-saved confirmation message++## Timeline narrative++The cursor begins parked and moves to the first switch control at frame 24, clicking to toggle from off to on. At frame 55, the cursor arrives at the select dropdown trigger and clicks, opening the panel. At frame 80, the cursor moves to the theme option and clicks to select it, closing the dropdown at frame 90. The cursor then moves to the slider at frame 105 and begins dragging, maintaining pressed state while the slider value animates through its range from frame 105 to frame 150. At frame 155, the settings-saved toast appears, confirming the changes, and auto-dismisses at frame 215.++## Props++<PropsTable+ rows={[+ {+ name: "rows",+ type: "{label: string}[]",+ default: "[{label:\"Notifications\"},{label:\"Theme\"},{label:\"Volume\"}]",+ description: "Array of setting row labels with their associated controls.",+ },+ {+ name: "selectItems",+ type: "string[]",+ default: "[\"System\",\"Light\",\"Dark\"]",+ description: "Array of theme options for the select dropdown.",+ },+ {+ name: "toastTitle",+ type: "string",+ default: "\"Settings saved\"",+ description: "Confirmation message shown in the toast.",+ },+ {+ name: "mode",+ type: "\"light\" | \"dark\"",+ default: "\"light\"",+ description: "Color mode applied to all composed primitives.",+ },+ {+ name: "theme",+ type: "RemocnTheme",+ description: "Optional theme override (concrete oklch/hex/rgb values).",+ },+ ]}+/>diff --git a/content/docs/ui/blocks/signup-flow.mdx b/content/docs/ui/blocks/signup-flow.mdxnew file mode 100644index 00000000..82c9b378--- /dev/null+++ b/content/docs/ui/blocks/signup-flow.mdx@@ -0,0 +1,70 @@+---+title: SignupFlow+description: Cursor-driven account creation with email input, agreement, and success feedback+---++<BlockPreview name="signup-flow" />++A composition scene demonstrating cursor-driven account creation. The user enters an email, agrees to terms, clicks create, and receives a success confirmation via toast. Each step is driven by primitives orchestrated on a shared timeline.++## Installation++<InstallBlock name="signup-flow" />++<Note>+Installing `signup-flow` automatically installs the shared `remocn-ui` core and all composed primitives via `registryDependencies`: cursor, input, checkbox, button, and toast. You do not need to install them separately.+</Note>++## Composed primitives++- **Cursor** — animated pointer with click ripples+- **Input** — text reveal animation with active state+- **Checkbox** — animated checkmark on agreement+- **Button** — hover/press/loading/success state progression+- **Toast** — success message auto-dismiss++## Timeline narrative++The scene opens with the cursor parked in the top-left corner. At frame 30, the cursor moves to the email input and clicks, triggering the input to become active and begin revealing the pre-filled email address letter-by-letter. At frame 80, the cursor arrives at the checkbox and clicks again, drawing the checkmark with a +2-frame offset. The cursor then moves to the create button at frame 95, triggering hover and press states in sequence. At frame 110, the button enters the loading state (showing a spinner), and by frame 150 it transitions to success (checkmark icon). Simultaneously at frame 150, the success toast appears and auto-dismisses at frame 210.++## Props++<PropsTable+ rows={[+ {+ name: "email",+ type: "string",+ default: "\"[email protected]\"",+ description: "Email address to be revealed during input animation.",+ },+ {+ name: "agreeLabel",+ type: "string",+ default: "\"I agree to the terms\"",+ description: "Text label for the checkbox.",+ },+ {+ name: "buttonLabel",+ type: "string",+ default: "\"Create account\"",+ description: "Text displayed on the create button.",+ },+ {+ name: "toastTitle",+ type: "string",+ default: "\"Account created\"",+ description: "Success message shown in the toast.",+ },+ {+ name: "mode",+ type: "\"light\" | \"dark\"",+ default: "\"light\"",+ description: "Color mode applied to all composed primitives.",+ },+ {+ name: "theme",+ type: "RemocnTheme",+ description: "Optional theme override (concrete oklch/hex/rgb values).",+ },+ ]}+/>diff --git a/content/docs/ui/meta.json b/content/docs/ui/meta.jsonindex 08a8b990..7d872d15 100644--- a/content/docs/ui/meta.json+++ b/content/docs/ui/meta.json@@ -1,5 +1,5 @@{"title": "UI","collapsible": false,- "pages": ["index", "concepts", "installation", "components"]+ "pages": ["index", "concepts", "installation", "components", "blocks"]}diff --git a/mdx-components.tsx b/mdx-components.tsxindex a3915174..c7e07c7e 100644--- a/mdx-components.tsx+++ b/mdx-components.tsx@@ -4,6 +4,7 @@ import { Note, Warning } from "@/components/docs/callout";import { ComponentCardGrid } from "@/components/docs/component-card-grid";import { ComponentPreview } from "@/components/docs/component-preview";import { UiComponentPreview } from "@/components/docs/ui-component-preview";+import { BlockPreview } from "@/components/docs/block-preview";import { Dependencies } from "@/components/docs/dependencies";import { InstallBlock } from "@/components/docs/install-block";import { PropsTable } from "@/components/docs/props-table";@@ -34,6 +35,7 @@ export function getMDXComponents(components?: MDXComponents): MDXComponents {// Custom doc widgets — registrations only, not reimplemented here.ComponentPreview,UiComponentPreview,+ BlockPreview,InstallBlock,PropsTable,Note,diff --git a/registry/remocn-ui/ai-prompt-flow/index.tsx b/registry/remocn-ui/ai-prompt-flow/index.tsxnew file mode 100644index 00000000..2039dacb--- /dev/null+++ b/registry/remocn-ui/ai-prompt-flow/index.tsx@@ -0,0 +1,242 @@+"use client";++import { type RemocnTheme, useRemocnTheme } from "@/lib/remocn-ui";+import { Input } from "@/components/remocn/input";+import { useInputTransition } from "@/components/remocn/use-input-transition";+import { Button } from "@/components/remocn/button";+import { useButtonTransition } from "@/components/remocn/use-button-transition";+import { Skeleton } from "@/components/remocn/skeleton";+import { SkeletonBlock } from "@/components/remocn/skeleton-block";+import { useSkeletonTransition } from "@/components/remocn/use-skeleton-transition";+import { Toast } from "@/components/remocn/toast";+import { useToastTransition } from "@/components/remocn/use-toast-transition";++export interface AiPromptFlowProps {+ /** Prompt typed into the field during the reveal. */+ prompt?: string;+ /** Submit button label. */+ buttonLabel?: string;+ /** Generated answer, as discrete lines (defines the response box). */+ answerLines?: string[];+ /** Title shown in the ready toast. */+ toastTitle?: string;+ mode?: "light" | "dark";+ theme?: Partial<RemocnTheme>;+}++// Stage layout — the prompt field and answer box paint their own full-bleed+// backgrounds, so each is pinned inside a non-overlapping slot it fills. The+// answer column is fixed-width so the skeleton placeholder and the real answer+// share one box (crossfade never resizes it).+const STAGE_W = 1280;+const PROMPT_W = 520;+const PROMPT_LEFT = (STAGE_W - PROMPT_W) / 2; // 380+const PROMPT_TOP = 168;+const PROMPT_H = 92;++const BTN_W = 200;+const BTN_LEFT = (STAGE_W - BTN_W) / 2; // 540+const BTN_TOP = 278;+const BTN_H = 64;++const ANSWER_W = 560;+const ANSWER_LEFT = (STAGE_W - ANSWER_W) / 2; // 360+const ANSWER_TOP = 380;++const DEFAULT_ANSWER = [+ "The thread debates the Q3 roadmap: ship the editor first,",+ "defer billing to Q4, and pull the migration forward so",+ "infra is unblocked before the team scales next quarter.",+];++/**+ * Prompt → submit → skeleton shimmer → crossfade into the answer → ready toast.+ * A pure orchestrator: typing/button/skeleton/toast are each driven by their own+ * transition hook, and the shimmer is owned entirely by the `skeleton-block`+ * motion atom. The block holds no state, effects, or frame reads of its own.+ * Beat timings mirror US-B002's beat table.+ */+export function AiPromptFlow({+ prompt = "Summarize this thread",+ buttonLabel = "Generate",+ answerLines = DEFAULT_ANSWER,+ toastTitle = "Response ready",+ mode = "light",+ theme,+}: AiPromptFlowProps) {+ const resolved = useRemocnTheme(theme, mode);+ const opts = { mode, theme };++ // Input: focus, then reveal the typed prompt over 0→50.+ const inputStyle = useInputTransition(+ [+ { at: 0, state: "active", duration: 1 },+ { at: 0, state: "typing", duration: 50 },+ ],+ opts,+ );++ // Button: hover after typing settles (52) → press → loading spinner. It stays+ // loading while the skeleton shimmers.+ const buttonStyle = useButtonTransition(+ [+ { at: 52, state: "hover", duration: 6 },+ { at: 58, state: "press", duration: 4 },+ { at: 62, state: "loading", duration: 4 },+ ],+ opts,+ );++ // Skeleton: loads on submit (64), crossfades to the answer at 150. The two+ // opacities sum to 1, so the box never jumps. (No `theme` option — the+ // Skeleton component itself threads the theme into its blocks.)+ const skeletonStyle = useSkeletonTransition(+ [+ { at: 64, state: "loading", duration: 1 },+ { at: 150, state: "loaded", duration: 16 },+ ],+ { mode },+ );++ // Output-panel reveal vs. answer-text reveal are TWO distinct moments, owned+ // by two different channels — do not conflate them:+ // • The output PANEL (the shimmer area) stays blank during prompt typing and+ // appears when generation STARTS. That onset is the button's already-+ // exposed `spinnerOpacity` channel — it ramps 0→1 as the button enters+ // `loading` (~62) — read linearly here (sanctioned §0B.3 read; semantics+ // correct: panel reveal == submit, never during typing).+ // • The answer TEXT is revealed later, at 150, ENTIRELY by the Skeleton+ // primitive's loaded crossfade (`contentOpacity`) — NOT by this gate. This+ // gate only hides the empty/shimmering area while the prompt is typed.+ const panelOpacity = buttonStyle.spinnerOpacity;++ // Toast: enters once the crossfade settles (160), auto-dismisses at 220.+ // (No `theme` option — the Toast component resolves its own surface theme.)+ const toastStyle = useToastTransition(+ [+ { at: 160, state: "visible", duration: 14 },+ { at: 220, state: "hidden", duration: 14 },+ ],+ { mode },+ );++ return (+ <div+ style={{+ position: "relative",+ width: "100%",+ height: "100%",+ background: resolved.background,+ }}+ >+ {/* Prompt field slot. */}+ <div+ style={{+ position: "absolute",+ left: PROMPT_LEFT,+ top: PROMPT_TOP,+ width: PROMPT_W,+ height: PROMPT_H,+ }}+ >+ <Input+ placeholder="Ask anything…"+ value={prompt}+ valueWidth={186}+ style={inputStyle}+ mode={mode}+ theme={theme}+ />+ </div>++ {/* Generate button slot. */}+ <div+ style={{+ position: "absolute",+ left: BTN_LEFT,+ top: BTN_TOP,+ width: BTN_W,+ height: BTN_H,+ }}+ >+ <Button+ label={buttonLabel}+ style={buttonStyle}+ mode={mode}+ theme={theme}+ />+ </div>++ {/* Output panel — appears on submit (panelOpacity), then the Skeleton+ shimmer crossfades into the real answer lines at 150 (contentOpacity,+ primitive-owned). The real content sits in normal flow and sets the box+ height; the shimmer placeholder mirrors it as SkeletonBlock rows. */}+ <div+ style={{+ position: "absolute",+ left: ANSWER_LEFT,+ top: ANSWER_TOP,+ width: ANSWER_W,+ display: "flex",+ justifyContent: "center",+ opacity: panelOpacity,+ }}+ >+ <Skeleton+ style={skeletonStyle}+ mode={mode}+ theme={theme}+ placeholder={+ <div+ style={{+ display: "flex",+ flexDirection: "column",+ gap: 14,+ width: ANSWER_W,+ }}+ >+ {answerLines.map((_, i) => (+ <SkeletonBlock+ key={i}+ width={i === answerLines.length - 1 ? "70%" : "100%"}+ height={18}+ baseColor={resolved.muted}+ />+ ))}+ </div>+ }+ >+ <div+ style={{+ display: "flex",+ flexDirection: "column",+ gap: 8,+ width: ANSWER_W,+ fontFamily:+ "var(--font-geist-sans), -apple-system, BlinkMacSystemFont, sans-serif",+ fontSize: 18,+ lineHeight: 1.45,+ letterSpacing: "-0.01em",+ color: resolved.foreground,+ }}+ >+ {answerLines.map((line, i) => (+ <span key={i}>{line}</span>+ ))}+ </div>+ </Skeleton>+ </div>++ {/* Ready toast, anchored bottom-right. */}+ <div style={{ position: "absolute", right: 32, bottom: 32 }}>+ <Toast+ title={toastTitle}+ variant="success"+ style={toastStyle}+ mode={mode}+ theme={theme}+ />+ </div>+ </div>+ );+}diff --git a/registry/remocn-ui/checkout-flow/index.tsx b/registry/remocn-ui/checkout-flow/index.tsxnew file mode 100644index 00000000..9971b77c--- /dev/null+++ b/registry/remocn-ui/checkout-flow/index.tsx@@ -0,0 +1,240 @@+"use client";++import { Button } from "@/components/remocn/button";+import { useButtonTransition } from "@/components/remocn/use-button-transition";+import { Cursor } from "@/components/remocn/cursor";+import { useCursorPath } from "@/components/remocn/use-cursor-path";+import { Dialog } from "@/components/remocn/dialog";+import { useDialogTransition } from "@/components/remocn/use-dialog-transition";+import { Input } from "@/components/remocn/input";+import { useInputTransition } from "@/components/remocn/use-input-transition";+import { Toast } from "@/components/remocn/toast";+import { useToastTransition } from "@/components/remocn/use-toast-transition";+import {+ ToggleGroup,+ type ToggleGroupItem,+} from "@/components/remocn/toggle-group";+import { useToggleGroupTransition } from "@/components/remocn/use-toggle-group-transition";+import type { RemocnTheme } from "@/lib/remocn-ui";++/**+ * Checkout flow — a shippable composition scene. Pure orchestrator: it scripts+ * the lifecycle by calling each primitive's transition hook (which legitimately+ * read the frame) and lays the primitives out on a position:relative stage. The+ * block itself holds no state/effect/frame of its own (see §0B.2). Beat `at`+ * values are the single source of truth (PRD US-B003) and are frame-synced so+ * each cursor click lands on the same frame as the state change it triggers.+ *+ * Lifecycle: toggle monthly→yearly → cursor to Upgrade → Dialog opens → card+ * number types in → confirm press → loading → success → Dialog closes → Toast.+ */++// Default plan segments for the billing toggle (value === label by default).+const DEFAULT_PLANS: ToggleGroupItem[] = [+ { value: "monthly", label: "Monthly" },+ { value: "yearly", label: "Yearly" },+];++// Stage geometry (1280×720). The toggle sits high, the Upgrade button mid-low;+// the cursor hotspot targets each in turn. Two-segment default toggle is 184px+// wide, centered → "Yearly" segment center X ≈ 684.+const TOGGLE_Y = 232;+const YEARLY_X = 684;+const UPGRADE_X = 640;+const UPGRADE_Y = 432;++export interface CheckoutFlowProps {+ /** Billing toggle segments. The first is the resting selection. */+ plans?: ToggleGroupItem[];+ /** Label of the button that opens the payment dialog. */+ upgradeLabel?: string;+ /** Card-number value revealed by the typing input inside the dialog. */+ cardPlaceholder?: string;+ /** Label of the dialog's primary (confirm) action button. */+ confirmLabel?: string;+ /** Headline of the success toast. */+ toastTitle?: string;+ mode?: "light" | "dark";+ theme?: Partial<RemocnTheme>;+}++export function CheckoutFlow({+ plans = DEFAULT_PLANS,+ upgradeLabel = "Upgrade",+ cardPlaceholder = "4242 4242 4242 4242",+ confirmLabel = "Pay",+ toastTitle = "Payment successful",+ mode = "light",+ theme,+}: CheckoutFlowProps) {+ const opts = { mode, theme };++ // Beat 1 — cursor clicks the "Yearly" segment at 24; then eases to Upgrade and+ // clicks at 50 (beat 3). Click `at` == the driven state-change `at`.+ const cursorStyle = useCursorPath([+ { at: 0, x: 96, y: 80 },+ { at: 24, x: YEARLY_X, y: TOGGLE_Y, duration: 22 },+ { at: 24, x: YEARLY_X, y: TOGGLE_Y, click: true, duration: 0 },+ { at: 50, x: UPGRADE_X, y: UPGRADE_Y, duration: 22 },+ { at: 50, x: UPGRADE_X, y: UPGRADE_Y, click: true, duration: 0 },+ ]);++ // Beat 2 — toggle slides monthly → yearly on the click at 24.+ const toggleStyle = useToggleGroupTransition(+ [{ at: 24, state: plans[1]?.value ?? "yearly", duration: 14 }],+ { items: plans, ...opts },+ );++ // Beat 4 — the Upgrade button hovers then presses into the click at 50.+ const upgradeStyle = useButtonTransition(+ [+ { at: 40, state: "hover", duration: 10 },+ { at: 50, state: "press", duration: 8 },+ ],+ opts,+ );++ // Beat 5 / 10 — dialog opens at 56 (after the press), closes at 175.+ const dialogStyle = useDialogTransition(+ [+ { at: 56, state: "opened", duration: 14 },+ { at: 175, state: "closed", duration: 12 },+ ],+ opts,+ );++ // Beat 6 — card number types in from 70 to 120 (inside the dialog). `at` is the+ // transition START and the reveal ramps over [at, at+duration) (useStateTransition+ // / STYLE-GUIDE §5), so the typing window is [70, 120] — fully revealed by 120,+ // before the confirm press at 124 (PRD US-B003 beat 6 + AC4). A brief `active`+ // focus precedes it as the dialog settles.+ const cardStyle = useInputTransition(+ [+ { at: 62, state: "active", duration: 8 },+ { at: 70, state: "typing", duration: 50 },+ ],+ opts,+ );++ // Beats 7/8/9 — confirm press (124) → loading (128) → success (165).+ const confirmStyle = useButtonTransition(+ [+ { at: 124, state: "press", duration: 6 },+ { at: 128, state: "loading", duration: 6 },+ { at: 165, state: "success", duration: 16 },+ ],+ opts,+ );++ // Beats 11/12 — success toast enters at 178, auto-dismisses at 235. The toast+ // hook tints by `mode` only (no animated theme channel); `theme` rides the+ // component prop below.+ const toastStyle = useToastTransition(+ [+ { at: 178, state: "visible", duration: 12 },+ { at: 235, state: "hidden", duration: 12 },+ ],+ { mode },+ );++ return (+ <div style={{ position: "relative", width: "100%", height: "100%" }}>+ {/* Billing toggle — its own relative box scopes the primitive's inset:0. */}+ <div+ style={{+ position: "absolute",+ left: 0,+ right: 0,+ top: TOGGLE_Y - 40,+ height: 80,+ }}+ >+ <ToggleGroup style={toggleStyle} items={plans} mode={mode} theme={theme} />+ </div>++ {/* Upgrade button. */}+ <div+ style={{+ position: "absolute",+ left: 0,+ right: 0,+ top: UPGRADE_Y - 40,+ height: 80,+ }}+ >+ <Button+ label={upgradeLabel}+ style={upgradeStyle}+ mode={mode}+ theme={theme}+ />+ </div>++ {/* Payment dialog — transparent overlay; the backdrop + card fade with it.+ The card-number input and confirm button are layered over the card and+ ride the dialog's own opacity (driven by the same hook). */}+ <Dialog+ style={dialogStyle}+ title="Complete payment"+ description="Enter your card details to finish upgrading."+ actionLabel={confirmLabel}+ cancelLabel="Cancel"+ mode={mode}+ theme={theme}+ />++ {/* Card-number field, overlaid on the dialog body, fading with the popup. */}+ <div+ style={{+ position: "absolute",+ left: 0,+ right: 0,+ top: 332,+ height: 64,+ opacity: dialogStyle.popupOpacity,+ }}+ >+ <Input+ style={cardStyle}+ placeholder={cardPlaceholder}+ value={cardPlaceholder}+ valueWidth={208}+ mode={mode}+ theme={theme}+ />+ </div>++ {/* Confirm button, overlaid on the dialog footer, fading with the popup. */}+ <div+ style={{+ position: "absolute",+ left: 0,+ right: 0,+ top: 408,+ height: 64,+ opacity: dialogStyle.popupOpacity,+ }}+ >+ <Button+ label={confirmLabel}+ style={confirmStyle}+ mode={mode}+ theme={theme}+ />+ </div>++ {/* Success toast, anchored bottom-right. */}+ <div style={{ position: "absolute", right: 24, bottom: 24 }}>+ <Toast+ style={toastStyle}+ title={toastTitle}+ variant="success"+ mode={mode}+ theme={theme}+ />+ </div>++ <Cursor style={cursorStyle} variant="pointer" mode={mode} theme={theme} />+ </div>+ );+}diff --git a/registry/remocn-ui/onboarding-stepper-flow/index.tsx b/registry/remocn-ui/onboarding-stepper-flow/index.tsxnew file mode 100644index 00000000..91779648--- /dev/null+++ b/registry/remocn-ui/onboarding-stepper-flow/index.tsx@@ -0,0 +1,176 @@+"use client";++import { Button } from "@/components/remocn/button";+import { useButtonTransition } from "@/components/remocn/use-button-transition";+import { Input } from "@/components/remocn/input";+import { useInputTransition } from "@/components/remocn/use-input-transition";+import { Radio } from "@/components/remocn/radio";+import { useRadioTransition } from "@/components/remocn/use-radio-transition";+import { Stepper } from "@/components/remocn/stepper";+import { useStepperTransition } from "@/components/remocn/use-stepper-transition";+import { Switch } from "@/components/remocn/switch";+import { useSwitchTransition } from "@/components/remocn/use-switch-transition";+import { clamp01, type RemocnTheme } from "@/lib/remocn-ui";++/**+ * Onboarding stepper flow — a shippable composition scene. Pure orchestrator:+ * each step is driven by its own primitive hook, navigation is button-driven (no+ * cursor). The stepper advances via `useStepperTransition`, exposing a single+ * continuous `position` float.+ *+ * §0B.3 SANCTIONED EXCEPTION (the ONE motion this block derives itself): each+ * step panel's `opacity` is a PURE LINEAR read of the stepper's exposed+ * `position` channel — `clamp01(1 - |position - i|)`. No new easing/spring, no+ * frame read, no per-element timeline, no state. Everything else lives inside+ * the primitives. This crossfades panels in lockstep with the stepper's own+ * eased advance (the easing already lives in `useStepperTransition`).+ */++const DEFAULT_STEPS = ["Account", "Plan", "Settings"];+const DEFAULT_PLANS = ["Free", "Pro", "Team"];++// Stage geometry (1280×720): stepper rail up top, step content centered below.+const CONTENT_TOP = 300;+const CONTENT_HEIGHT = 220;+const NAV_TOP = 540;++export interface OnboardingStepperFlowProps {+ /** Step labels — their count is the step count. */+ steps?: string[];+ /** Email value typed into the account step's input. */+ name?: string;+ /** Plan options shown as radios on the plan step. */+ plans?: string[];+ /** Label of the advance button on the non-final steps. */+ nextLabel?: string;+ /** Label of the advance button on the final step. */+ finishLabel?: string;+ mode?: "light" | "dark";+ theme?: Partial<RemocnTheme>;+}++export function OnboardingStepperFlow({+ steps = DEFAULT_STEPS,+ name = "[email protected]",+ plans = DEFAULT_PLANS,+ nextLabel = "Next",+ finishLabel = "Finish",+ mode = "light",+ theme,+}: OnboardingStepperFlowProps) {+ const opts = { mode, theme };++ // Stepper advances 0 → 1 (at 64) → 2 (at 104); checks draw on completed steps.+ const stepperStyle = useStepperTransition([+ { at: 0, index: 0 },+ { at: 64, index: 1, duration: 20 },+ { at: 104, index: 2, duration: 20 },+ ]);++ // Step 1 — email types in (10 → 55). `at` is the transition START and the reveal+ // ramps over [at, at+duration) (useStateTransition / STYLE-GUIDE §5), so the+ // typing window is [10, 55] — fully revealed by 55, before the stepper advance+ // at 64 (PRD US-B004 beat 2 + AC5). A brief `active` focus precedes it.+ const nameStyle = useInputTransition(+ [+ { at: 2, state: "active", duration: 8 },+ { at: 10, state: "typing", duration: 45 },+ ],+ opts,+ );++ // Step 2 — plan radio checks at 90.+ const planStyle = useRadioTransition(+ [{ at: 90, state: "checked", duration: 14 }],+ opts,+ );++ // Step 3 — settings switch turns on at 130.+ const settingsStyle = useSwitchTransition(+ [{ at: 130, state: "checked", duration: 14 }],+ opts,+ );++ // Nav button — each Next/Finish press immediately precedes the stepper advance+ // (60→64, 100→104), the final press resolves to success at 150.+ const navStyle = useButtonTransition(+ [+ { at: 60, state: "press", duration: 6 },+ { at: 64, state: "idle", duration: 6 },+ { at: 100, state: "press", duration: 6 },+ { at: 104, state: "idle", duration: 6 },+ { at: 150, state: "press", duration: 6 },+ { at: 156, state: "success", duration: 14 },+ ],+ opts,+ );++ // §0B.3: panel visibility = pure linear read of the exposed `position` channel.+ // No easing/spring/frame here — `clamp01` + `|·|` over `position` only.+ const position = stepperStyle.position;+ const panelOpacity = (i: number) => clamp01(1 - Math.abs(position - i));++ // The advance button reads "Finish" once the flow has moved onto the last step.+ const navLabel = position >= steps.length - 1 ? finishLabel : nextLabel;++ return (+ <div style={{ position: "relative", width: "100%", height: "100%" }}>+ {/* Stepper rail — its own relative box scopes the primitive's inset:0. */}+ <div+ style={{ position: "absolute", left: 0, right: 0, top: 96, height: 100 }}+ >+ <Stepper style={stepperStyle} steps={steps} mode={mode} theme={theme} />+ </div>++ {/* Step content region — panels crossfade via the linear position read. */}+ <div+ style={{+ position: "absolute",+ left: 0,+ right: 0,+ top: CONTENT_TOP,+ height: CONTENT_HEIGHT,+ }}+ >+ {/* Step 1 — account email input. */}+ <div style={{ position: "absolute", inset: 0, opacity: panelOpacity(0) }}>+ <Input+ style={nameStyle}+ placeholder={name}+ value={name}+ valueWidth={150}+ mode={mode}+ theme={theme}+ />+ </div>++ {/* Step 2 — plan radio. */}+ <div style={{ position: "absolute", inset: 0, opacity: panelOpacity(1) }}>+ <Radio+ style={planStyle}+ label={plans[1] ?? "Pro"}+ mode={mode}+ theme={theme}+ />+ </div>++ {/* Step 3 — settings switch. */}+ <div style={{ position: "absolute", inset: 0, opacity: panelOpacity(2) }}>+ <Switch+ style={settingsStyle}+ label="Email notifications"+ mode={mode}+ theme={theme}+ />+ </div>+ </div>++ {/* Advance button (Next / Finish). */}+ <div+ style={{ position: "absolute", left: 0, right: 0, top: NAV_TOP, height: 64 }}+ >+ <Button label={navLabel} style={navStyle} mode={mode} theme={theme} />+ </div>+ </div>+ );+}diff --git a/registry/remocn-ui/registry.json b/registry/remocn-ui/registry.jsonindex ea775826..88189195 100644--- a/registry/remocn-ui/registry.json+++ b/registry/remocn-ui/registry.json@@ -651,6 +651,81 @@"target": "components/remocn/use-resizable-transition.ts"}]+ },+ {+ "name": "signup-flow",+ "type": "registry:component",+ "title": "UI Signup Flow",+ "description": "A cursor-driven signup composition: the pointer clicks the email field, the value types in, the agree box checks, the Create button runs idle → press → loading → success, and a success toast slides in. A pure orchestrator — every channel comes from a composed primitive's transition hook.",+ "dependencies": ["remotion"],+ "registryDependencies": ["remocn-ui", "cursor", "input", "checkbox", "button", "toast"],+ "files": [+ {+ "path": "signup-flow/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/signup-flow.tsx"+ }+ ]+ },+ {+ "name": "ai-prompt-flow",+ "type": "registry:component",+ "title": "UI AI Prompt Flow",+ "description": "An AI prompt composition: a prompt types into the field, the Generate button runs hover → press → loading, a skeleton shimmer reveals, then crossfades into the generated answer, and a ready toast slides in. A pure orchestrator — the shimmer is owned by the skeleton-block motion atom; every other channel comes from a composed primitive's hook.",+ "dependencies": ["remotion"],+ "registryDependencies": ["remocn-ui", "input", "button", "skeleton", "skeleton-block", "toast"],+ "files": [+ {+ "path": "ai-prompt-flow/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/ai-prompt-flow.tsx"+ }+ ]+ },+ {+ "name": "checkout-flow",+ "type": "registry:component",+ "title": "UI Checkout Flow",+ "description": "A cursor-driven checkout composition: a billing-cycle toggle, a card field, and a Pay button open into a confirmation dialog, ending in a success toast. A pure orchestrator — every channel comes from a composed primitive's transition hook.",+ "dependencies": ["remotion"],+ "registryDependencies": ["remocn-ui", "toggle-group", "dialog", "input", "button", "cursor", "toast"],+ "files": [+ {+ "path": "checkout-flow/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/checkout-flow.tsx"+ }+ ]+ },+ {+ "name": "onboarding-stepper-flow",+ "type": "registry:component",+ "title": "UI Onboarding Stepper Flow",+ "description": "A multi-step onboarding composition: a horizontal stepper advances through panels of input, radio, and switch fields, finishing on a Finish button that runs to success. Panel crossfade derives linearly from the stepper's exposed position channel; every other channel comes from a composed primitive's hook.",+ "dependencies": ["remotion"],+ "registryDependencies": ["remocn-ui", "stepper", "input", "radio", "switch", "button"],+ "files": [+ {+ "path": "onboarding-stepper-flow/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/onboarding-stepper-flow.tsx"+ }+ ]+ },+ {+ "name": "settings-toggle-flow",+ "type": "registry:component",+ "title": "UI Settings Toggle Flow",+ "description": "A cursor-driven settings composition: the pointer flips a switch, opens a select, and drags a slider, ending in a saved toast. A pure orchestrator — every channel comes from a composed primitive's transition hook.",+ "dependencies": ["remotion"],+ "registryDependencies": ["remocn-ui", "switch", "select", "slider", "cursor", "toast"],+ "files": [+ {+ "path": "settings-toggle-flow/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/settings-toggle-flow.tsx"+ }+ ]}]}diff --git a/registry/remocn-ui/settings-toggle-flow/index.tsx b/registry/remocn-ui/settings-toggle-flow/index.tsxnew file mode 100644index 00000000..fa3d8067--- /dev/null+++ b/registry/remocn-ui/settings-toggle-flow/index.tsx@@ -0,0 +1,206 @@+"use client";++import { useButtonTransition } from "@/components/remocn/use-button-transition";+import { Cursor } from "@/components/remocn/cursor";+import { useCursorPath } from "@/components/remocn/use-cursor-path";+import { Select } from "@/components/remocn/select";+import { useSelectTransition } from "@/components/remocn/use-select-transition";+import { useSelectItemTransition } from "@/components/remocn/use-select-item-transition";+import { Slider } from "@/components/remocn/slider";+import { useSliderTransition } from "@/components/remocn/use-slider-transition";+import { Switch } from "@/components/remocn/switch";+import { useSwitchTransition } from "@/components/remocn/use-switch-transition";+import { Toast } from "@/components/remocn/toast";+import { useToastTransition } from "@/components/remocn/use-toast-transition";+import type { RemocnTheme } from "@/lib/remocn-ui";++/**+ * Settings toggle flow — a shippable composition scene. Pure orchestrator: a+ * cursor walks a settings panel, flipping a Switch, choosing a Select option,+ * and dragging a Slider, ending on a "Settings saved" Toast. Each interaction is+ * driven by its primitive's hook; the block holds no state/effect/frame of its+ * own (see §0B.2). Beat `at` values are the single source of truth (PRD US-B005)+ * and frame-synced so each cursor click/press lands on the same frame as the+ * state change it triggers.+ */++const DEFAULT_ROWS = [+ { label: "Notifications" },+ { label: "Theme" },+ { label: "Volume" },+];+const DEFAULT_SELECT_ITEMS = ["System", "Light", "Dark"];++// Stage geometry (1280×720): three stacked rows. The Switch, the Select trigger,+// and the Slider thumb each get a cursor target. The Select panel opens below+// its trigger, so the chosen item (index 2 → "Dark") sits ~96px lower.+const SWITCH_Y = 200;+const SWITCH_X = 700;+const SELECT_Y = 332;+const SELECT_X = 640;+const SELECT_ITEM_Y = 444;+const SLIDER_Y = 504;+const SLIDER_START_X = 544;+const SLIDER_END_X = 736;++export interface SettingsToggleFlowProps {+ /** Setting rows (label only). The first row carries the toggle switch. */+ rows?: { label: string }[];+ /** Options shown in the Select panel. */+ selectItems?: string[];+ /** Headline of the success toast. */+ toastTitle?: string;+ mode?: "light" | "dark";+ theme?: Partial<RemocnTheme>;+}++export function SettingsToggleFlow({+ rows = DEFAULT_ROWS,+ selectItems = DEFAULT_SELECT_ITEMS,+ toastTitle = "Settings saved",+ mode = "light",+ theme,+}: SettingsToggleFlowProps) {+ const opts = { mode, theme };++ // Cursor: click Switch (24) → click Select trigger (55) → click item (80) →+ // press Slider thumb (105) and drag to 150 → release. Each click/press `at`+ // equals the driven primitive's `at`.+ const cursorStyle = useCursorPath([+ { at: 0, x: 96, y: 80 },+ { at: 24, x: SWITCH_X, y: SWITCH_Y, duration: 20 },+ { at: 24, x: SWITCH_X, y: SWITCH_Y, click: true, duration: 0 },+ { at: 55, x: SELECT_X, y: SELECT_Y, duration: 22 },+ { at: 55, x: SELECT_X, y: SELECT_Y, click: true, duration: 0 },+ { at: 80, x: SELECT_X, y: SELECT_ITEM_Y, duration: 18 },+ { at: 80, x: SELECT_X, y: SELECT_ITEM_Y, click: true, duration: 0 },+ { at: 105, x: SLIDER_START_X, y: SLIDER_Y, duration: 18 },+ { at: 105, x: SLIDER_START_X, y: SLIDER_Y, press: true, duration: 0 },+ { at: 150, x: SLIDER_END_X, y: SLIDER_Y, press: true, duration: 45 },+ { at: 158, x: SLIDER_END_X, y: SLIDER_Y, duration: 0 },+ ]);++ // Beat 2 — switch turns on at the click (24).+ const switchStyle = useSwitchTransition(+ [{ at: 24, state: "checked", duration: 12 }],+ opts,+ );++ // Beats 4/7 — select panel opens at 55, closes at 90.+ const panelStyle = useSelectTransition(+ [+ { at: 55, state: "opened", duration: 14 },+ { at: 90, state: "closed", duration: 12 },+ ],+ opts,+ );++ // The select trigger button "click" — hover into the open press at 55.+ const triggerStyle = useButtonTransition(+ [+ { at: 45, state: "hover", duration: 8 },+ { at: 55, state: "press", duration: 8 },+ ],+ { variant: "outline", ...opts },+ );++ // Beat 6 — the last item (index 2) is highlighted, pressed, then selected at 80.+ const itemStyle = useSelectItemTransition(+ [+ { at: 68, state: "hover", duration: 8 },+ { at: 78, state: "press", duration: 6 },+ { at: 80, state: "selected", duration: 10 },+ ],+ opts,+ );++ // Beat 9 — dual-channel slider: value eases 20 → 80 across the drag while the+ // thumb idles → hover → press → idle, all from one hook.+ const sliderStyle = useSliderTransition([+ { at: 0, value: 20, thumbState: "idle" },+ { at: 105, thumbState: "press", duration: 6 },+ { at: 105, value: 20 },+ { at: 150, value: 80, duration: 45, easing: "inOut" },+ { at: 158, thumbState: "idle", duration: 8 },+ ]);++ // Beats 10/11 — toast enters at 155 (after the drag), auto-dismisses at 215.+ // The toast hook tints by `mode` only; `theme` rides the component prop below.+ const toastStyle = useToastTransition(+ [+ { at: 155, state: "visible", duration: 12 },+ { at: 215, state: "hidden", duration: 12 },+ ],+ { mode },+ );++ return (+ <div style={{ position: "relative", width: "100%", height: "100%" }}>+ {/* Switch row — its own relative box scopes the primitive's inset:0. */}+ <div+ style={{+ position: "absolute",+ left: 0,+ right: 0,+ top: SWITCH_Y - 32,+ height: 64,+ }}+ >+ <Switch+ style={switchStyle}+ label={rows[0]?.label ?? "Notifications"}+ mode={mode}+ theme={theme}+ />+ </div>++ {/* Select row — the trigger; the panel opens below into the item row. */}+ <div+ style={{+ position: "absolute",+ left: 0,+ right: 0,+ top: SELECT_Y - 32,+ height: 240,+ }}+ >+ <Select+ style={panelStyle}+ label={rows[1]?.label ?? "Theme"}+ items={selectItems}+ triggerStyle={triggerStyle}+ itemStyles={selectItems.map((_, i) =>+ i === selectItems.length - 1 ? itemStyle : undefined,+ )}+ mode={mode}+ theme={theme}+ />+ </div>++ {/* Slider row. */}+ <div+ style={{+ position: "absolute",+ left: "50%",+ top: SLIDER_Y,+ transform: "translate(-50%, -50%)",+ }}+ >+ <Slider style={sliderStyle} width={320} mode={mode} theme={theme} />+ </div>++ {/* Success toast, anchored bottom-right. */}+ <div style={{ position: "absolute", right: 24, bottom: 24 }}>+ <Toast+ style={toastStyle}+ title={toastTitle}+ variant="success"+ mode={mode}+ theme={theme}+ />+ </div>++ <Cursor style={cursorStyle} variant="pointer" mode={mode} theme={theme} />+ </div>+ );+}diff --git a/registry/remocn-ui/signup-flow/index.tsx b/registry/remocn-ui/signup-flow/index.tsxnew file mode 100644index 00000000..04d827ad--- /dev/null+++ b/registry/remocn-ui/signup-flow/index.tsx@@ -0,0 +1,193 @@+"use client";++import { type RemocnTheme, useRemocnTheme } from "@/lib/remocn-ui";+import { Cursor } from "@/components/remocn/cursor";+import { useCursorPath } from "@/components/remocn/use-cursor-path";+import { Input } from "@/components/remocn/input";+import { useInputTransition } from "@/components/remocn/use-input-transition";+import { Checkbox } from "@/components/remocn/checkbox";+import { useCheckboxTransition } from "@/components/remocn/use-checkbox-transition";+import { Button } from "@/components/remocn/button";+import { useButtonTransition } from "@/components/remocn/use-button-transition";+import { Toast } from "@/components/remocn/toast";+import { useToastTransition } from "@/components/remocn/use-toast-transition";++export interface SignupFlowProps {+ /** Value typed into the email field during the reveal. */+ email?: string;+ /** Label rendered next to the checkbox. */+ agreeLabel?: string;+ /** Submit button label. */+ buttonLabel?: string;+ /** Title shown in the success toast. */+ toastTitle?: string;+ mode?: "light" | "dark";+ theme?: Partial<RemocnTheme>;+}++// Stage layout — each form atom paints its own full-bleed background, so it is+// pinned inside a non-overlapping slot whose box it fills. The slots stack into+// a centered vertical form; the cursor tip targets each slot's visual center.+const STAGE_W = 1280;+const FORM_W = 440;+const FORM_LEFT = (STAGE_W - FORM_W) / 2; // 420++const INPUT_TOP = 206;+const INPUT_H = 90;+const CHECK_TOP = 318;+const CHECK_H = 52;+const BUTTON_TOP = 392;+const BUTTON_H = 84;++// Cursor tip targets (slot centers on the 1280×720 stage).+const INPUT_X = STAGE_W / 2;+const INPUT_Y = INPUT_TOP + INPUT_H / 2; // 251+const CHECK_X = STAGE_W / 2;+const CHECK_Y = CHECK_TOP + CHECK_H / 2; // 344+const BTN_X = STAGE_W / 2;+const BTN_Y = BUTTON_TOP + BUTTON_H / 2; // 434++/**+ * Cursor-driven signup: click the email field → typing reveal → check "agree" →+ * click Create → loading → success → success toast. A pure orchestrator — every+ * animated channel comes from a primitive's own transition hook+ * (`useCursorPath`/`use*Transition`); the block holds no state, effects, or+ * frame reads of its own. Beat timings mirror US-B001's beat table.+ */+export function SignupFlow({+ email = "[email protected]",+ agreeLabel = "I agree to the terms",+ buttonLabel = "Create account",+ toastTitle = "Account created",+ mode = "light",+ theme,+}: SignupFlowProps) {+ const resolved = useRemocnTheme(theme, mode);+ const opts = { mode, theme };++ // Cursor: park top-left → arrive Input (click 30) → arrive Checkbox (click+ // 80) → arrive Button (click 95). Each click `at` matches the target atom's+ // state change `at` (beats 2≡3, 5/6, 7≡8).+ const cursorStyle = useCursorPath([+ { at: 0, x: 120, y: 90 },+ { at: 30, x: INPUT_X, y: INPUT_Y, duration: 26, click: true },+ { at: 80, x: CHECK_X, y: CHECK_Y, duration: 30, click: true },+ { at: 95, x: BTN_X, y: BTN_Y, duration: 13, click: true },+ ]);++ // Input: focus on click (30), then reveal the typed email over 30→70.+ const inputStyle = useInputTransition(+ [+ { at: 30, state: "active", duration: 6 },+ { at: 30, state: "typing", duration: 40 },+ ],+ opts,+ );++ // Checkbox: draw the checkmark just after the click lands (82 = click+2).+ const checkboxStyle = useCheckboxTransition(+ [{ at: 82, state: "checked", duration: 12 }],+ opts,+ );++ // Button: hover on cursor arrival (95) → press → loading spinner → success.+ const buttonStyle = useButtonTransition(+ [+ { at: 95, state: "hover", duration: 8 },+ { at: 104, state: "press", duration: 6 },+ { at: 110, state: "loading", duration: 6 },+ { at: 150, state: "success", duration: 16 },+ ],+ opts,+ );++ // Toast: enters with success (150), auto-dismisses at 210. (No `theme`+ // option — the Toast component itself resolves the theme for its surface.)+ const toastStyle = useToastTransition(+ [+ { at: 150, state: "visible", duration: 14 },+ { at: 210, state: "hidden", duration: 14 },+ ],+ { mode },+ );++ return (+ <div+ style={{+ position: "relative",+ width: "100%",+ height: "100%",+ background: resolved.background,+ }}+ >+ {/* Email field slot — Input fills this box and centers its 320px field. */}+ <div+ style={{+ position: "absolute",+ left: FORM_LEFT,+ top: INPUT_TOP,+ width: FORM_W,+ height: INPUT_H,+ }}+ >+ <Input+ placeholder="[email protected]"+ value={email}+ valueWidth={108}+ style={inputStyle}+ mode={mode}+ theme={theme}+ />+ </div>++ {/* Agree checkbox slot. */}+ <div+ style={{+ position: "absolute",+ left: FORM_LEFT,+ top: CHECK_TOP,+ width: FORM_W,+ height: CHECK_H,+ }}+ >+ <Checkbox+ label={agreeLabel}+ style={checkboxStyle}+ mode={mode}+ theme={theme}+ />+ </div>++ {/* Submit button slot. */}+ <div+ style={{+ position: "absolute",+ left: FORM_LEFT,+ top: BUTTON_TOP,+ width: FORM_W,+ height: BUTTON_H,+ }}+ >+ <Button+ label={buttonLabel}+ style={buttonStyle}+ mode={mode}+ theme={theme}+ />+ </div>++ {/* Success toast, anchored bottom-right. */}+ <div style={{ position: "absolute", right: 32, bottom: 32 }}>+ <Toast+ title={toastTitle}+ variant="success"+ style={toastStyle}+ mode={mode}+ theme={theme}+ />+ </div>++ <Cursor style={cursorStyle} variant="pointer" mode={mode} theme={theme} />+ </div>+ );+}diff --git a/tsconfig.json b/tsconfig.jsonindex 4f1b41a7..ba8534e5 100644--- a/tsconfig.json+++ b/tsconfig.json@@ -21,6 +21,20 @@"paths": {"@/lib/remocn-ui": ["./registry/remocn-ui/core/index.ts"],"@/lib/remocn-ui/*": ["./registry/remocn-ui/core/*"],+ "@/components/remocn/use-cursor-path": ["./registry/remocn-ui/cursor/use-cursor-path.ts"],+ "@/components/remocn/use-button-transition": ["./registry/remocn-ui/button/use-button-transition.ts"],+ "@/components/remocn/use-input-transition": ["./registry/remocn-ui/input/use-input-transition.ts"],+ "@/components/remocn/use-checkbox-transition": ["./registry/remocn-ui/checkbox/use-checkbox-transition.ts"],+ "@/components/remocn/use-toast-transition": ["./registry/remocn-ui/toast/use-toast-transition.ts"],+ "@/components/remocn/use-skeleton-transition": ["./registry/remocn-ui/skeleton/use-skeleton-transition.ts"],+ "@/components/remocn/use-toggle-group-transition": ["./registry/remocn-ui/toggle-group/use-toggle-group-transition.ts"],+ "@/components/remocn/use-dialog-transition": ["./registry/remocn-ui/dialog/use-dialog-transition.ts"],+ "@/components/remocn/use-radio-transition": ["./registry/remocn-ui/radio/use-radio-transition.ts"],+ "@/components/remocn/use-stepper-transition": ["./registry/remocn-ui/stepper/use-stepper-transition.ts"],+ "@/components/remocn/use-switch-transition": ["./registry/remocn-ui/switch/use-switch-transition.ts"],+ "@/components/remocn/use-select-transition": ["./registry/remocn-ui/select/use-select-transition.ts"],+ "@/components/remocn/use-select-item-transition": ["./registry/remocn-ui/select-item/use-select-item-transition.ts"],+ "@/components/remocn/use-slider-transition": ["./registry/remocn-ui/slider/use-slider-transition.ts"],"@/components/remocn/*": ["./registry/remocn-ui/*/index.tsx"],"@/*": ["./*"]}