Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
feat: Design Review, six product scenes that annotate a UI
kapishdimad99519efd193
diff --git a/content/changelog/2026-11-03-design-review.mdx b/content/changelog/2026-11-03-design-review.mdxnew file mode 100644index 00000000..5e230c4b--- /dev/null+++ b/content/changelog/2026-11-03-design-review.mdx@@ -0,0 +1,19 @@+---+title: Design Review+date: 2026-11-03+---++Six new Product Scenes play a design review over a UI: redlines, flagged problems, a scan that ships the fix, token names and layout guides. Each one draws over your own screen or screenshot, with every mark placed in frame pixels. Without props, they run on a demo calendar dashboard. They share the new `audit-core` lib, which installs with any of them.++<ChangelogPreview name="design-audit" />++### New components++- [Design Audit](/docs/product-scenes/design-audit): the whole review in one scene. Red redlines and issue boxes are followed by a scan to the fixed build. The camera then pushes into one card for its specs and tokens and pulls back to the grid.+- [Redline Measure](/docs/product-scenes/redline-measure): spacing and size rulers draw one by one, each value popping on when its line lands.+- [Audit Boxes](/docs/product-scenes/audit-boxes): off-spec elements are traced in red, each labelled with its fix, while an issue counter ticks up.+- [Scan Fix](/docs/product-scenes/scan-fix): a scan band sweeps the old build into the new one and flips the version chip.+- [Token Tags](/docs/product-scenes/token-tags): leader lines run from elements to chips that name their design tokens.+- [Layout Guides](/docs/product-scenes/layout-guides): column guides, a highlighted column, a gutter measure and a now line.++<ChangelogPreview name="scan-fix" />diff --git a/content/docs/product-scenes/audit-boxes.mdx b/content/docs/product-scenes/audit-boxes.mdxnew file mode 100644index 00000000..50556dae--- /dev/null+++ b/content/docs/product-scenes/audit-boxes.mdx@@ -0,0 +1,79 @@+---+title: Audit Boxes+description: Off-spec elements of a UI get traced with red boxes and labelled with the fix each one needs+component: audit-boxes+vibe: clean+length: 56+useWhen:+ - "A design linting, QA or accessibility tool should show the problems it finds on a real screen."+ - "A redesign story needs a before beat where the old UI is visibly full of small mistakes."+ - "The count of issues found matters and should tick up as they are flagged."+avoidWhen:+ - "The marks should be neutral measurements rather than problems — use `redline-measure`."+ - "The next beat should be the screen getting fixed — use `scan-fix`."+ - "The camera should tour regions of a screenshot with captions — use `screenshot-tour`."+---++<ComponentPreview name="audit-boxes" />++<InstallBlock name="audit-boxes" />++## Usage++`AuditBoxes` is a full-frame scene. Each issue's box traces itself clockwise+from the top left, then its note pops on beside it. A counter above the frame's+top right counts the boxes as they land.++```tsx+import { AuditBoxes } from "@/components/remocn/audit-boxes";++export const Lint = () => <AuditBoxes />;+```++Without children it audits a demo calendar dashboard. For your own UI, pass it+as children in a 1280×720 frame and list the issues in frame pixels.++```tsx+import { AuditBoxes } from "@/components/remocn/audit-boxes";++export const Lint = () => (+ <AuditBoxes+ issues={[+ { rect: { x: 320, y: 180, w: 200, h: 40 }, note: "contrast 3.1:1" },+ { rect: { x: 900, y: 80, w: 120, h: 32 }, note: "hit 28 → 44", side: "end" },+ ]}+ counterLabel="problems"+ >+ <MyScreen />+ </AuditBoxes>+);+```++`side` places the note: `start` sits above the box's left edge, `end` above its+right edge, `below` under its left edge. Set `counterLabel=""` to hide the+counter.++## Timing++At 30 fps and `speed={1}`:++| Frames | Motion |+| --- | --- |+| 4–14 | The counter drops in |+| 10 + n × `stagger` | Box n starts tracing and takes 14 frames |+| 20 + n × `stagger` | Its note pops on over 12 frames |++`auditBoxesLength` is 56 with the seven demo issues. `speed` scales the whole+timeline.++<PropsTable title="Props"+ rows={[+ { name: "children", type: "React.ReactNode", description: "UI to audit, laid out in a 1280×720 frame. Without it a demo dashboard is drawn" },+ { name: "issues", type: '{ rect: { x: number; y: number; w: number; h: number }; note: string; side?: "start" | "end" | "below" }[]', description: "Off-spec elements in frame pixels and the fix each needs. Defaults to the demo issues, or none with children" },+ { name: "color", type: "string", default: '"#FB3748"', description: "Box, note and counter color" },+ { name: "background", type: "string", default: '"#EDEDEF"', description: "Stage color" },+ { name: "counterLabel", type: "string", default: '"issues"', description: "Word after the count; empty hides the counter" },+ { name: "stagger", type: "number", default: "4", description: "Frames between one box and the next" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/product-scenes/design-audit.mdx b/content/docs/product-scenes/design-audit.mdxnew file mode 100644index 00000000..fd8b0005--- /dev/null+++ b/content/docs/product-scenes/design-audit.mdx@@ -0,0 +1,104 @@+---+title: Design Audit+description: A full design review in one scene, from red redlines and issue boxes through a scan that ships the fix to a close-up with specs and tokens+component: design-audit+vibe: clean+length: 332+useWhen:+ - "A design tool, UI kit or design system launch needs a hero sequence that tells the whole review story."+ - "A redesign or v2 release should show what was wrong, the fix landing, and how the new build is specified."+ - "A single eleven-second scene should carry audit, layout, component and token beats with a step bar on top."+avoidWhen:+ - "Only the before-to-after sweep is needed — use `scan-fix`."+ - "Only the flagged problems are needed — use `audit-boxes`."+ - "The camera should tour several regions of a screenshot with captions — use `screenshot-tour`."+---++<ComponentPreview name="design-audit" />++<InstallBlock name="design-audit" />++## Usage++`DesignAudit` chains the design-review beats into one scene. The screen rises+in and red redlines and issue boxes draw over the old build. A scan band sweeps+down and leaves the fixed build with blue redlines. The camera then pushes into+one element, which gets specs and token tags, and pulls back while layout+guides draw over the grid. A step bar on top lights Audit, Layout, Components+and Tokens in turn, and the version chip flips when the scan passes it.++```tsx+import { DesignAudit } from "@/components/remocn/design-audit";++export const Review = () => <DesignAudit />;+```++Without `before` and `after` it plays on the demo dashboard. With your own+frames, pass the marks for each beat in frame pixels. Each beat you leave out+is skipped, and `focus: null` skips the camera push.++```tsx+import { Img, staticFile } from "remotion";+import { DesignAudit } from "@/components/remocn/design-audit";++export const Review = () => (+ <DesignAudit+ before={<Img src={staticFile("v1.png")} />}+ after={<Img src={staticFile("v2.png")} />}+ beforeMarks={{ measures: [{ from: [320, 200], to: [340, 200], label: "20" }] }}+ issues={[{ rect: { x: 320, y: 180, w: 200, h: 40 }, note: "13 → 14" }]}+ afterMarks={{ measures: [{ from: [320, 200], to: [344, 200], label: "24" }] }}+ focus={{+ rect: { x: 320, y: 180, w: 200, h: 92 },+ tokens: [{ anchor: [340, 250], at: [380, 320], label: "bg/success", swatch: "#1FC16B" }],+ }}+ guides={null}+ brand="Acme"+ versions={["v1", "v2"]}+ />+);+```++The marks use the shapes from [Redline Measure](/docs/product-scenes/redline-measure),+[Audit Boxes](/docs/product-scenes/audit-boxes), [Token Tags](/docs/product-scenes/token-tags)+and [Layout Guides](/docs/product-scenes/layout-guides). Set `brand=""` to hide+the top bar.++## Timing++At 30 fps and `speed={1}`:++| Frames | Motion |+| --- | --- |+| 0–18 | The screen rises in |+| 14–60 | Red redlines draw |+| 34–80 | Issue boxes trace and get their notes |+| 72–136 | The scan band sweeps down; the chip flips; Layout lights |+| 146–156 | The blue redlines fade |+| 156–178 | The camera pushes into `focus`; Components lights |+| 180–210 | Close-up specs draw |+| 208–250 | Token tags draw; Tokens lights |+| 252–274 | The camera pulls back |+| 278–332 | Layout guides draw |++`designAuditLength` is 332. `speed` scales the whole timeline.++<PropsTable title="Props"+ rows={[+ { name: "before", type: "React.ReactNode", description: "UI before the fix, 1280×720. Defaults to the demo dashboard" },+ { name: "after", type: "React.ReactNode", description: "The fixed UI with the same layout" },+ { name: "beforeMarks", type: "{ measures?: Measure[]; radii?: RadiusMark[] }", description: "Red redlines over before" },+ { name: "issues", type: "Issue[]", description: "Off-spec elements boxed on before" },+ { name: "afterMarks", type: "{ measures?: Measure[]; radii?: RadiusMark[] }", description: "Blue redlines over after, shown once the scan lands" },+ { name: "focus", type: "{ rect: Rect; measures?: Measure[]; radii?: RadiusMark[]; tokens?: TokenSpec[] } | null", description: "Element the camera pushes into, with its specs and tokens; null skips the push" },+ { name: "guides", type: "GuideSpec | null", description: "Guides drawn after the camera pulls back; null skips them" },+ { name: "steps", type: "string[]", default: '["Audit", "Layout", "Components", "Tokens"]', description: "Four step names lit in turn" },+ { name: "brand", type: "string", default: '"Synergy"', description: "Name beside the version chip; empty hides the top bar" },+ { name: "versions", type: "[string, string]", default: '["v1.0", "v2.0"]', description: "Chip text before and after the scan" },+ { name: "auditColor", type: "string", default: '"#FB3748"', description: "Red marks and first step color" },+ { name: "fixColor", type: "string", default: '"#335CFF"', description: "Blue marks, guides and lit step color" },+ { name: "scanColor", type: "string", default: '"#7D52F4"', description: "Scan band color" },+ { name: "background", type: "string", default: '"#EDEDEF"', description: "Stage color" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/product-scenes/index.mdx b/content/docs/product-scenes/index.mdxindex b85b894d..195fa47c 100644--- a/content/docs/product-scenes/index.mdx+++ b/content/docs/product-scenes/index.mdx@@ -142,4 +142,19 @@ Fully staged product screens with a beginning, a middle and a payoff. Swap in yo</ComponentGroup>+<ComponentGroup+ items={[+ "design-audit",+ "redline-measure",+ "audit-boxes",+ "scan-fix",+ "token-tags",+ "layout-guides",+ ]}+>++## Design review++</ComponentGroup>+</CategoryIndex>diff --git a/content/docs/product-scenes/layout-guides.mdx b/content/docs/product-scenes/layout-guides.mdxnew file mode 100644index 00000000..adfe9ccb--- /dev/null+++ b/content/docs/product-scenes/layout-guides.mdx@@ -0,0 +1,79 @@+---+title: Layout Guides+description: Dashed column guides drop over a grid, one column fills with a label and a now line slides across+component: layout-guides+vibe: clean+length: 54+useWhen:+ - "A layout, grid or responsive feature should show the structure under a screen."+ - "A calendar, timeline or schedule product needs its columns and current time called out."+ - "A design review beat should end on the grid rather than on individual values."+avoidWhen:+ - "Single distances and sizes should be measured — use `redline-measure`."+ - "Elements should be tagged with design token names — use `token-tags`."+ - "The beat should be a gray wireframe filling in — use `wireframe-to-final`."+---++<ComponentPreview name="layout-guides" />++<InstallBlock name="layout-guides" />++## Usage++`LayoutGuides` is a full-frame scene. Dashed guides drop down every column edge+left to right. Then one column fills with a tint and gets a label, a gutter is+measured, and a marker line slides across the grid with its own label.++```tsx+import { LayoutGuides } from "@/components/remocn/layout-guides";++export const Grid = () => <LayoutGuides />;+```++Without children it draws over the demo dashboard's week grid. For your own UI,+pass it as children in a 1280×720 frame and describe the grid in frame pixels.+Only `columns`, `top` and `bottom` are required.++```tsx+import { LayoutGuides } from "@/components/remocn/layout-guides";++export const Grid = () => (+ <LayoutGuides+ guides={{+ columns: [160, 400, 640, 880, 1120],+ top: 120,+ bottom: 660,+ highlight: { rect: { x: 400, y: 120, w: 240, h: 540 }, label: "col 2" },+ now: { y: 300, from: 160, to: 1120, label: "Live" },+ }}+ >+ <MyScreen />+ </LayoutGuides>+);+```++## Timing++At 30 fps and `speed={1}`:++| Frames | Motion |+| --- | --- |+| 8 + n × 3 | Guide n drops down over 16 frames |+| 22–36 | The highlight traces and fills |+| 28–42 | The highlight's header box traces |+| 32–44 | The ruler draws and its value pops |+| 34–46 | The highlight label pops on |+| 38–54 | The now line slides across, its label pops |++`layoutGuidesLength` is 54. `speed` scales the whole timeline.++<PropsTable title="Props"+ rows={[+ { name: "children", type: "React.ReactNode", description: "UI to lay guides over, in a 1280×720 frame. Without it a demo dashboard is drawn" },+ { name: "guides", type: "{ columns: number[]; top: number; bottom: number; highlight?: { rect; label }; ruler?: Measure; now?: { y; from; to; label } }", description: "Column edges, optional highlight, ruler and now line, in frame pixels. Defaults to the demo week grid, or nothing with children" },+ { name: "color", type: "string", default: '"#335CFF"', description: "Guide, highlight and ruler color" },+ { name: "nowColor", type: "string", default: '"#7D52F4"', description: "Now line and label color" },+ { name: "background", type: "string", default: '"#EDEDEF"', description: "Stage color" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/product-scenes/meta.json b/content/docs/product-scenes/meta.jsonindex 5605a863..9e86368d 100644--- a/content/docs/product-scenes/meta.json+++ b/content/docs/product-scenes/meta.json@@ -70,7 +70,14 @@"status-page","---Onboarding---","heat-drain-reveal",- "whats-new-modal"+ "whats-new-modal",+ "---Design review---",+ "design-audit",+ "redline-measure",+ "audit-boxes",+ "scan-fix",+ "token-tags",+ "layout-guides"],"icon": "ComputerIcon"}diff --git a/content/docs/product-scenes/redline-measure.mdx b/content/docs/product-scenes/redline-measure.mdxnew file mode 100644index 00000000..85c5841b--- /dev/null+++ b/content/docs/product-scenes/redline-measure.mdx@@ -0,0 +1,84 @@+---+title: Redline Measure+description: Spacing and size redlines draw over a UI one by one, each value popping on once its line lands+component: redline-measure+vibe: clean+length: 63+useWhen:+ - "A design tool, design system or UI kit launch should show that the spacing is measured, not eyeballed."+ - "A before beat needs a screen marked up like a design review: paddings, gaps, heights and corner radii."+ - "Your own UI or screenshot should get a quick spec pass with values you choose."+avoidWhen:+ - "The marks should flag what is wrong with the fix next to it — use `audit-boxes`."+ - "The scene should move from the marked-up screen to the fixed one — use `scan-fix`."+ - "A product object, not a UI, should turn into a technical drawing — use `blueprint`."+---++<ComponentPreview name="redline-measure" />++<InstallBlock name="redline-measure" />++## Usage++`RedlineMeasure` is a full-frame scene. It dims the UI slightly, then draws each+measurement in turn: the end ticks snap in, the line grows out from its middle+and the value pops on. Radius marks sweep a quarter arc into a corner.++```tsx+import { RedlineMeasure } from "@/components/remocn/redline-measure";++export const Spec = () => <RedlineMeasure />;+```++Without children it measures a demo calendar dashboard. To measure your own UI,+pass it as children laid out in a 1280×720 frame, and list the marks in frame+pixels. With children and no `measures`, nothing is drawn.++```tsx+import { Img, staticFile } from "remotion";+import { RedlineMeasure } from "@/components/remocn/redline-measure";++export const Spec = () => (+ <RedlineMeasure+ measures={[+ { from: [120, 200], to: [144, 200], label: "24", side: "above" },+ { from: [300, 160], to: [300, 192], label: "h 32", side: "right" },+ ]}+ radii={[{ x: 120, y: 180, r: 12, label: "radius 12" }]}+ >+ <Img src={staticFile("dashboard.png")} style={{ width: 1280, height: 720 }} />+ </RedlineMeasure>+);+```++A measure is horizontal when its points differ more in x than in y. `side`+places the value: `above`, `below`, `left`, `right` or `center`. By default a+horizontal value sits above its line and a vertical one to the left.++## Timing++At 30 fps and `speed={1}`:++| Frames | Motion |+| --- | --- |+| 0–10 | The UI dims toward the background |+| 6 + n × `stagger` | Measure n's end ticks snap in |+| 8 + n × `stagger` | Its line grows from the middle over 12 frames |+| 15 + n × `stagger` | Its value pops on over 12 frames |++Radius marks follow the measures in the same rhythm. `redlineMeasureLength` is+63 with the default demo marks. After that the marks hold still. `speed` scales+the whole timeline.++<PropsTable title="Props"+ rows={[+ { name: "children", type: "React.ReactNode", description: "UI to measure, laid out in a 1280×720 frame. Without it a demo dashboard is drawn" },+ { name: "measures", type: "{ from: [number, number]; to: [number, number]; label: string; side?: string }[]", description: "Distances to draw, in frame pixels. Defaults to spacing on the demo dashboard, or none with children" },+ { name: "radii", type: "{ x: number; y: number; r: number; label: string }[]", description: "Corners that get a radius arc; x and y are the corner" },+ { name: "color", type: "string", default: '"#FB3748"', description: "Line and label color" },+ { name: "background", type: "string", default: '"#EDEDEF"', description: "Stage color, also used for the dim" },+ { name: "dim", type: "number", default: "0.18", description: "How far the UI fades toward the background, 0 to 1" },+ { name: "stagger", type: "number", default: "5", description: "Frames between one mark and the next" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/product-scenes/scan-fix.mdx b/content/docs/product-scenes/scan-fix.mdxnew file mode 100644index 00000000..ef83cbc0--- /dev/null+++ b/content/docs/product-scenes/scan-fix.mdx@@ -0,0 +1,79 @@+---+title: Scan Fix+description: A scan band sweeps down a screen and leaves the fixed build behind it, red redlines turning blue and the version chip flipping+component: scan-fix+vibe: clean+length: 100+useWhen:+ - "A release should show the old build turning into the new one in a single sweep."+ - "A design review story needs its payoff: every flagged problem fixed at once."+ - "Two frames with the same layout should swap top to bottom rather than side to side."+avoidWhen:+ - "A divider should sweep sideways across an image — use `before-after`."+ - "A gray wireframe should fill in with the finished UI — use `wireframe-to-final`."+ - "The whole review, from audit to tokens, should play as one scene — use `design-audit`."+---++<ComponentPreview name="scan-fix" />++<InstallBlock name="scan-fix" />++## Usage++`ScanFix` is a full-frame scene with two layers. A bright line with a soft wash+behind it travels from the top of the frame to the bottom. Above the line you+see `after`, below it `before`. When the line passes the version chip, the chip+switches from the first version to the second.++```tsx+import { ScanFix } from "@/components/remocn/scan-fix";++export const Ship = () => <ScanFix />;+```++Without props it scans the demo dashboard: the drifted v1 with red redlines and+issue boxes turns into v2 with blue redlines. Pass your own frames, 1280×720+each, with the same layout so the sweep reads as a fix.++```tsx+import { Img, staticFile } from "remotion";+import { ScanFix } from "@/components/remocn/scan-fix";++export const Ship = () => (+ <ScanFix+ before={<Img src={staticFile("v1.png")} />}+ after={<Img src={staticFile("v2.png")} />}+ brand="Acme"+ versions={["v3.2", "v4.0"]}+ />+);+```++Set `brand=""` to hide the version chip.++## Timing++At 30 fps and `speed={1}`:++| Frames | Motion |+| --- | --- |+| 14–20 | The band fades in above the frame |+| 18–98 | The band sweeps top to bottom with a cubic ease-in-out |+| ~22 | The version chip flips as the band passes it |+| 92–100 | The band fades out below the frame |++`scanFixLength` is 100. `speed` scales the whole timeline.++<PropsTable title="Props"+ rows={[+ { name: "before", type: "React.ReactNode", description: "Frame before the fix, 1280×720. Defaults to the demo dashboard with red marks" },+ { name: "after", type: "React.ReactNode", description: "Frame after the fix, same size. Defaults to the fixed dashboard with blue marks" },+ { name: "brand", type: "string", default: '"Synergy"', description: "Name beside the version chip; empty hides the chip" },+ { name: "versions", type: "[string, string]", default: '["v1.0", "v2.0"]', description: "Chip text before and after the band passes" },+ { name: "scanColor", type: "string", default: '"#7D52F4"', description: "Band color" },+ { name: "beforeColor", type: "string", default: '"#FB3748"', description: "Old chip and demo redline color" },+ { name: "afterColor", type: "string", default: '"#335CFF"', description: "New chip and demo redline color" },+ { name: "background", type: "string", default: '"#EDEDEF"', description: "Stage color" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/content/docs/product-scenes/token-tags.mdx b/content/docs/product-scenes/token-tags.mdxnew file mode 100644index 00000000..0280811f--- /dev/null+++ b/content/docs/product-scenes/token-tags.mdx@@ -0,0 +1,81 @@+---+title: Token Tags+description: The UI washes out around one area and leader lines run from its elements to dark chips naming their design tokens+component: token-tags+vibe: clean+length: 61+useWhen:+ - "A design system or theming launch should show that every color on screen comes from a named token."+ - "A component beat should connect UI parts to code names, like variables or class names."+ - "One region of a screen deserves focus while the rest steps back."+avoidWhen:+ - "The labels are measurements rather than names — use `redline-measure`."+ - "The labels describe problems to fix — use `audit-boxes`."+ - "A product object should get one labelled callout — use `blueprint`."+---++<ComponentPreview name="token-tags" />++<InstallBlock name="token-tags" />++## Usage++`TokenTags` is a full-frame scene. Everything outside `focus` washes toward the+background. Then, tag by tag, a dot lands on the element, a leader line runs out+with one elbow and a dark chip with a color swatch and the token name settles at+its end.++```tsx+import { TokenTags } from "@/components/remocn/token-tags";++export const Tokens = () => <TokenTags />;+```++Without children it tags the demo dashboard's card row. For your own UI, pass it+as children in a 1280×720 frame and list the tags in frame pixels. With children+the wash is off unless you pass `focus`.++```tsx+import { TokenTags } from "@/components/remocn/token-tags";++export const Tokens = () => (+ <TokenTags+ focus={{ x: 300, y: 160, w: 680, h: 120 }}+ tokens={[+ { anchor: [340, 220], at: [420, 360], label: "bg/brand", swatch: "#7D52F4" },+ { anchor: [620, 200], at: [700, 400], label: "text/strong", swatch: "#0E121B" },+ ]}+ >+ <MyScreen />+ </TokenTags>+);+```++The leader leaves `anchor` diagonally, bends at the chip's height and runs+level into the chip at `at`, so place chips below or above their anchors.++## Timing++At 30 fps and `speed={1}`:++| Frames | Motion |+| --- | --- |+| 0–12 | The wash fades in around `focus` |+| 12 + n × `stagger` | Tag n's dot pops onto its element |+| 15 + n × `stagger` | Its leader line draws over 14 frames |+| 25 + n × `stagger` | Its chip rises in over 12 frames |++`tokenTagsLength` is 61 with the five demo tags. `speed` scales the whole+timeline.++<PropsTable title="Props"+ rows={[+ { name: "children", type: "React.ReactNode", description: "UI to tag, laid out in a 1280×720 frame. Without it a demo dashboard is drawn" },+ { name: "tokens", type: "{ anchor: [number, number]; at: [number, number]; label: string; swatch: string }[]", description: "Tags in frame pixels: a dot on anchor, the chip centered on at. Defaults to the demo tags, or none with children" },+ { name: "focus", type: "{ x: number; y: number; w: number; h: number } | null", description: "Area kept bright while the rest washes out; null skips the wash. Defaults to the demo card row, or null with children" },+ { name: "lineColor", type: "string", default: '"#0E121B"', description: "Leader line and dot color" },+ { name: "background", type: "string", default: '"#EDEDEF"', description: "Stage color, also used for the wash" },+ { name: "stagger", type: "number", default: "6", description: "Frames between one tag and the next" },+ { name: "speed", type: "number", default: "1", description: "Playback multiplier" },+ ]}+/>diff --git a/lib/docs-meta.test.ts b/lib/docs-meta.test.tsindex a4eb07c4..c28e9182 100644--- a/lib/docs-meta.test.ts+++ b/lib/docs-meta.test.ts@@ -23,6 +23,7 @@ const UNDOCUMENTED: Record<string, string> = {"command-menu-item": "folds into the command-menu page","icons-core": "shared icon runtime",gsh: "shared gradients.sh shader engine behind the gradient grounds",+ "audit-core": "shared annotation kit behind the design-review scenes",};function isIcon(name: string): boolean {diff --git a/package.json b/package.jsonindex fac4d099..181e8d8e 100644--- a/package.json+++ b/package.json@@ -34,6 +34,7 @@"manifest:check": "bun run manifest:build && git diff --quiet -- registry/__manifest__.ts || (echo 'registry/__manifest__.ts is out of sync with registry config sources. Run: bun run manifest:build and commit the result.' && exit 1)","studio": "remotion studio","studio:motion-pack": "remotion studio src/remotion/motion-pack-root.tsx",+ "studio:design-audit": "remotion studio src/remotion/design-audit-root.tsx","remotion:browser": "bun scripts/ensure-browser.mts","bundle:remotion": "bun scripts/bundle-remotion.mts","render:demos": "bun scripts/render-demos.mts",diff --git a/registry-artifacts/audit-boxes.json b/registry-artifacts/audit-boxes.jsonnew file mode 100644index 00000000..9a54c560--- /dev/null+++ b/registry-artifacts/audit-boxes.json@@ -0,0 +1,17 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "audit-boxes",+ "title": "Audit Boxes",+ "description": "Off-spec elements of a UI get traced with red boxes, each with the fix it needs, while an issue counter ticks up.",+ "dependencies": ["remotion"],+ "registryDependencies": ["@remocn/audit-core"],+ "files": [+ {+ "path": "registry/remocn/audit-boxes/index.tsx",+ "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { AbsoluteFill } from \"remotion\";\nimport {\n AUDIT_COLORS,\n AuditClock,\n DEMO,\n DEMO_WINDOW,\n DemoDashboard,\n FONT,\n type Issue,\n IssueMarks,\n MONO,\n progress,\n useAuditFrame,\n} from \"@/lib/remocn/audit-core\";\n\nexport type AuditBoxesProps = {\n /** UI to audit, laid out in a 1280x720 frame. Defaults to a demo calendar dashboard. */\n children?: ReactNode;\n /** Off-spec elements, in frame pixels, with the fix each one needs. */\n issues?: Issue[];\n color?: string;\n background?: string;\n /** Word after the running count. Empty hides the counter. */\n counterLabel?: string;\n /** Frames between one box and the next. */\n stagger?: number;\n speed?: number;\n};\n\nexport const auditBoxesDefaults = {\n color: AUDIT_COLORS.audit,\n background: AUDIT_COLORS.stage,\n counterLabel: \"issues\",\n stagger: 4,\n speed: 1,\n};\n\nexport const auditBoxesLength = 56;\n\nconst START = 10;\n\nexport function AuditBoxes(props: AuditBoxesProps) {\n const { speed = 1 } = props;\n return (\n <AuditClock speed={speed}>\n <Scene {...props} />\n </AuditClock>\n );\n}\n\nfunction Scene({\n children,\n issues = children ? [] : DEMO.before.issues,\n color = auditBoxesDefaults.color,\n background = auditBoxesDefaults.background,\n counterLabel = auditBoxesDefaults.counterLabel,\n stagger = auditBoxesDefaults.stagger,\n}: AuditBoxesProps) {\n return (\n <AbsoluteFill style={{ background, fontFamily: FONT }}>\n {children ?? <DemoDashboard v={1} />}\n <IssueMarks\n issues={issues}\n color={color}\n start={START}\n stagger={stagger}\n />\n {counterLabel && (\n <Counter\n total={issues.length}\n stagger={stagger}\n color={color}\n label={counterLabel}\n />\n )}\n </AbsoluteFill>\n );\n}\n\n/** Count chip above the frame's top right that ticks up with every box. */\nfunction Counter({\n total,\n stagger,\n color,\n label,\n}: {\n total: number;\n stagger: number;\n color: string;\n label: string;\n}) {\n const frame = useAuditFrame();\n const count = Math.min(\n total,\n Math.max(0, Math.floor((frame - START) / stagger) + 1),\n );\n const show = progress(frame, START - 6, 10);\n return (\n <div\n style={{\n position: \"absolute\",\n right: 1280 - DEMO_WINDOW.x - DEMO_WINDOW.w,\n top: 24,\n opacity: show,\n transform: `translateY(${(1 - show) * -6}px)`,\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n fontFamily: MONO,\n fontSize: 12,\n color: AUDIT_COLORS.ink,\n }}\n >\n <span\n style={{\n background: color,\n color: \"#fff\",\n borderRadius: 4,\n padding: \"2px 7px\",\n fontWeight: 600,\n fontVariantNumeric: \"tabular-nums\",\n }}\n >\n {count}\n </span>\n {label}\n </div>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/audit-boxes.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/audit-core.json b/registry-artifacts/audit-core.jsonnew file mode 100644index 00000000..a7b5f2be--- /dev/null+++ b/registry-artifacts/audit-core.json@@ -0,0 +1,16 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "audit-core",+ "title": "Audit Core",+ "description": "Shared kit behind the design-review components: redline rulers, issue boxes, radius arcs, token tags, layout guides, the scan band and a demo dashboard to measure.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/audit-core/index.tsx",+ "content": "\"use client\";\n\nimport {\n type CSSProperties,\n createContext,\n type ReactNode,\n useContext,\n} from \"react\";\nimport { Easing, interpolate, useCurrentFrame } from \"remotion\";\n\n/**\n * Shared kit behind the design-review family (redline-measure, audit-boxes,\n * scan-fix, token-tags, layout-guides, design-audit): the annotation marks a\n * design review paints over a UI, the scan band that sweeps a fix across it,\n * and a demo calendar dashboard the marks are measured against by default.\n *\n * Every coordinate is in composition pixels of a 1280x720 frame.\n */\n\nconst AuditSpeed = createContext(1);\n\n/** Scales the clock every mark below it reads. */\nexport function AuditClock({\n speed,\n children,\n}: {\n speed: number;\n children: ReactNode;\n}) {\n return <AuditSpeed.Provider value={speed}>{children}</AuditSpeed.Provider>;\n}\n\nexport function useAuditFrame() {\n return useCurrentFrame() * useContext(AuditSpeed);\n}\n\n/* Demo dashboard */\n/**\n * A calendar dashboard drawn from one layout function, so every annotation\n * can measure the exact rects the UI paints. Version 1 is the \"before\"\n * build with drifted spacing and radii, version 2 is the fixed one.\n */\n\nexport type Rect = { x: number; y: number; w: number; h: number };\nexport type Version = 1 | 2;\n\nexport const FONT =\n \"Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\";\nexport const MONO = \"ui-monospace, 'SF Mono', Menlo, Consolas, monospace\";\n\nconst C = {\n stage: \"#EDEDEF\",\n window: \"#FFFFFF\",\n ink: \"#0E121B\",\n sub: \"#525866\",\n soft: \"#99A0AE\",\n stroke: \"#E1E4EA\",\n weak: \"#F5F7FA\",\n primary: \"#7D52F4\",\n success: \"#1FC16B\",\n successBg: \"#E0FAEC\",\n warning: \"#FA7319\",\n warningBg: \"#FFF1EB\",\n error: \"#FB3748\",\n errorBg: \"#FFEBEC\",\n blue: \"#335CFF\",\n blueBg: \"#EBF1FF\",\n orangeBg: \"#FFF3EB\",\n purpleBg: \"#EFEBFF\",\n};\n\nexport const WIN: Rect = { x: 80, y: 64, w: 1120, h: 616 };\nconst SIDE_W = 216;\nconst HEADER_H = 56;\nconst MAIN_X = WIN.x + SIDE_W;\nconst MAIN_R = WIN.x + WIN.w;\n\nconst CARDS = [\n {\n title: \"Weekly team meeting\",\n time: \"3:00 – 4:30 PM\",\n status: \"Today\",\n action: \"Join meeting\",\n dot: C.success,\n bg: C.successBg,\n },\n {\n title: \"Product launch event\",\n time: \"11:00 AM – 12:30 PM\",\n status: \"2 conflicts\",\n action: \"Review\",\n dot: C.warning,\n bg: C.warningBg,\n },\n {\n title: \"Team building workshop\",\n time: \"10:00 AM – 1:00 PM\",\n status: \"Canceled\",\n action: \"Fri, Nov 6\",\n dot: C.error,\n bg: C.errorBg,\n },\n {\n title: \"Marketing campaign\",\n time: \"2:30 – 4:00 PM\",\n status: \"In 3 days\",\n action: \"Thu, Nov 5\",\n dot: C.soft,\n bg: C.weak,\n },\n];\n\nconst TABS = [\n { label: \"All scheduled\", count: \"15\" },\n { label: \"Meetings\", count: \"12\" },\n { label: \"Events\", count: \"3\" },\n { label: \"Conflicted\", count: \"2\" },\n { label: \"Canceled\", count: \"1\" },\n];\n\nconst DAYS = [\"Mon 2\", \"Tue 3\", \"Wed 4\", \"Thu 5\", \"Fri 6\"];\nconst HOURS = [\"9 AM\", \"10 AM\", \"11 AM\", \"12 PM\", \"1 PM\"];\n\nconst EVENTS = [\n { day: 0, from: 0, to: 0.5, title: \"Brainstorming session\", tone: \"gray\" },\n { day: 0, from: 0.55, to: 1.05, title: \"Bi-weekly sync\", tone: \"gray\" },\n { day: 1, from: 0, to: 0.45, title: \"Project review\", tone: \"blue\" },\n { day: 1, from: 1.05, to: 2.6, title: \"Sales team training\", tone: \"blue\" },\n { day: 2, from: 0.5, to: 1.0, title: \"Marketing strategy\", tone: \"blue\" },\n { day: 2, from: 2.6, to: 3.6, title: \"Interview: frontend\", tone: \"purple\" },\n { day: 3, from: 0, to: 1.0, title: \"Customer feedback\", tone: \"blue\" },\n { day: 3, from: 2.2, to: 3.4, title: \"Product launch\", tone: \"orange\" },\n { day: 0, from: 2.5, to: 3.7, title: \"Workshop: design\", tone: \"orange\" },\n { day: 4, from: 1.1, to: 3.7, title: \"Team building\", tone: \"gray\" },\n] as const;\n\nconst TONES = {\n gray: { bg: C.weak, ink: C.sub },\n blue: { bg: C.blueBg, ink: \"#2547D0\" },\n purple: { bg: C.purpleBg, ink: \"#5B3CC4\" },\n orange: { bg: C.orangeBg, ink: \"#C2540A\" },\n};\n\n/** Every rect the dashboard paints, in composition pixels. */\nexport function demoLayout(v: Version) {\n const pad = v === 2 ? 24 : 20;\n const gap = v === 2 ? 16 : 10;\n const cardPad = v === 2 ? 16 : 12;\n const radius = v === 2 ? 12 : 6;\n const contentX = MAIN_X + pad;\n const contentW = MAIN_R - pad - contentX;\n\n const header: Rect = { x: MAIN_X, y: WIN.y, w: MAIN_R - MAIN_X, h: HEADER_H };\n const button: Rect = {\n x: MAIN_R - pad - 128,\n y: WIN.y + 12,\n w: 128,\n h: v === 2 ? 32 : 34,\n };\n const tabsY = WIN.y + HEADER_H + (v === 2 ? 16 : 12);\n let tabX = contentX;\n const tabs = TABS.map((tab, i) => {\n const w = 46 + tab.label.length * 7.4 + (i === 0 ? 26 : 0);\n const rect: Rect = { x: tabX, y: tabsY, w, h: 32 };\n tabX += w + 14;\n return rect;\n });\n\n const cardsY = tabsY + 32 + (v === 2 ? 16 : 12);\n const cardW = (contentW - gap * 3) / 4;\n const cards = CARDS.map((_, i) => {\n const rect: Rect = {\n x: contentX + i * (cardW + gap),\n y: cardsY,\n w: cardW,\n h: 92,\n };\n return {\n rect,\n title: { x: rect.x + cardPad, y: rect.y + cardPad, w: 150, h: 18 },\n time: { x: rect.x + cardPad, y: rect.y + cardPad + 21, w: 110, h: 15 },\n status: {\n x: rect.x + cardPad - 4,\n y: rect.y + rect.h - cardPad - 24,\n w: rect.w - cardPad * 2 + 8,\n h: 26,\n },\n chevron: {\n x: rect.x + rect.w - cardPad - 20,\n y: rect.y + cardPad - 2,\n w: 20,\n h: 20,\n },\n };\n });\n\n const calY = cardsY + 92 + 22;\n const calendar: Rect = {\n x: contentX,\n y: calY,\n w: contentW,\n h: WIN.y + WIN.h - calY - 16,\n };\n const gutter = 56;\n const colW = (contentW - gutter) / DAYS.length;\n const dayHeaderH = 30;\n const hourH = (calendar.h - dayHeaderH) / 4;\n const columns = DAYS.map(\n (_, i): Rect => ({\n x: contentX + gutter + i * colW,\n y: calY,\n w: colW,\n h: calendar.h,\n }),\n );\n const events = EVENTS.map((event) => ({\n ...event,\n rect: {\n x: columns[event.day].x + 4,\n y: calY + dayHeaderH + event.from * hourH + 3,\n w: colW - 8,\n h: (event.to - event.from) * hourH - 6,\n } satisfies Rect,\n }));\n\n return {\n v,\n pad,\n gap,\n cardPad,\n radius,\n contentX,\n header,\n button,\n tabs,\n cards,\n calendar,\n columns,\n gutter,\n dayHeaderH,\n hourH,\n events,\n sidebar: { x: WIN.x, y: WIN.y, w: SIDE_W, h: WIN.h } satisfies Rect,\n sideActive: { x: WIN.x + 10, y: WIN.y + 158, w: SIDE_W - 20, h: 30 },\n };\n}\n\nexport type DemoLayout = ReturnType<typeof demoLayout>;\n\nconst abs = (r: Rect): CSSProperties => ({\n position: \"absolute\",\n left: r.x,\n top: r.y,\n width: r.w,\n height: r.h,\n});\n\nfunction Glyph({\n size = 14,\n color = C.soft,\n}: {\n size?: number;\n color?: string;\n}) {\n return (\n <div\n style={{\n width: size,\n height: size,\n borderRadius: 4,\n border: `1.5px solid ${color}`,\n flexShrink: 0,\n }}\n />\n );\n}\n\nconst SIDE_ITEMS: (string | { section: string })[] = [\n \"Inbox\",\n \"Dashboard\",\n { section: \"Workspace\" },\n \"Calendar\",\n \"Time off\",\n \"People\",\n \"Payroll\",\n \"Projects\",\n \"Documents\",\n { section: \"Favorites\" },\n \"Loom Mobile App\",\n \"Monday Re-design\",\n \"Udemy Courses\",\n];\n\nfunction Sidebar({ l }: { l: DemoLayout }) {\n let y = WIN.y + 68;\n return (\n <>\n <div\n style={{\n ...abs({ x: WIN.x, y: WIN.y, w: SIDE_W, h: WIN.h }),\n borderRight: `1px solid ${C.stroke}`,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n left: WIN.x + 18,\n top: WIN.y + 18,\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n fontSize: 14,\n fontWeight: 600,\n color: C.ink,\n }}\n >\n <div\n style={{\n width: 22,\n height: 22,\n borderRadius: 11,\n background: C.primary,\n }}\n />\n Synergy\n </div>\n {SIDE_ITEMS.map((item) => {\n const top = y;\n if (typeof item !== \"string\") {\n y += 30;\n return (\n <div\n key={item.section}\n style={{\n position: \"absolute\",\n left: WIN.x + 20,\n top: top + 10,\n fontSize: 11,\n letterSpacing: \"0.04em\",\n textTransform: \"uppercase\",\n color: C.soft,\n }}\n >\n {item.section}\n </div>\n );\n }\n y += 30;\n const active = item === \"Calendar\";\n return (\n <div\n key={item}\n style={{\n ...abs(\n active\n ? l.sideActive\n : { x: WIN.x + 10, y: top, w: SIDE_W - 20, h: 30 },\n ),\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n paddingLeft: 10,\n borderRadius: l.v === 2 ? 8 : 5,\n background: active ? C.weak : undefined,\n fontSize: 13,\n fontWeight: active ? 500 : 400,\n color: active ? C.ink : C.sub,\n }}\n >\n <Glyph color={active ? C.primary : C.soft} />\n {item}\n </div>\n );\n })}\n <div\n style={{\n position: \"absolute\",\n left: WIN.x + 18,\n top: WIN.y + WIN.h - 44,\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n fontSize: 13,\n color: C.ink,\n }}\n >\n <div\n style={{\n width: 26,\n height: 26,\n borderRadius: 13,\n background: \"linear-gradient(135deg,#FBC5A6,#F17B6A)\",\n }}\n />\n Olivia Hart\n </div>\n </>\n );\n}\n\nfunction Header({ l }: { l: DemoLayout }) {\n return (\n <>\n <div\n style={{\n ...abs(l.header),\n borderBottom: `1px solid ${C.stroke}`,\n display: \"flex\",\n alignItems: \"center\",\n gap: 12,\n paddingLeft: l.pad,\n fontSize: 14,\n }}\n >\n <Glyph size={16} color={C.sub} />\n <span style={{ fontWeight: 600, color: C.ink }}>\n Monday, November 2\n </span>\n <span style={{ color: C.soft }}>\n You have 3 meetings and 1 event today.\n </span>\n </div>\n <div\n style={{\n ...abs({ x: l.button.x - 104, y: l.button.y, w: 92, h: l.button.h }),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: 6,\n borderRadius: l.v === 2 ? 8 : 6,\n border: `1px solid ${C.stroke}`,\n fontSize: 13,\n color: C.sub,\n }}\n >\n Schedule\n </div>\n <div\n style={{\n ...abs(l.button),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: l.v === 2 ? 8 : 6,\n background: l.v === 2 ? C.primary : \"#8B5CF6\",\n color: \"#fff\",\n fontSize: 13,\n fontWeight: 500,\n }}\n >\n + Create event\n </div>\n </>\n );\n}\n\nfunction Tabs({ l }: { l: DemoLayout }) {\n return (\n <>\n {TABS.map((tab, i) => (\n <div\n key={tab.label}\n style={{\n ...abs(l.tabs[i]),\n display: \"flex\",\n alignItems: \"center\",\n gap: 7,\n fontSize: 13,\n fontWeight: i === 0 ? 500 : 400,\n color: i === 0 ? C.ink : C.sub,\n borderBottom: i === 0 ? `2px solid ${C.primary}` : undefined,\n }}\n >\n <Glyph color={i === 0 ? C.primary : C.soft} />\n {tab.label}\n <span\n style={{\n fontSize: 11,\n fontWeight: 500,\n color: i === 0 ? \"#fff\" : C.soft,\n background:\n i === 0 ? (l.v === 2 ? C.primary : \"#8B5CF6\") : undefined,\n borderRadius: 8,\n padding: i === 0 ? \"1px 6px\" : 0,\n }}\n >\n {tab.count}\n </span>\n </div>\n ))}\n <div\n style={{\n position: \"absolute\",\n left: l.contentX,\n top: l.tabs[0].y + 32,\n width: WIN.x + WIN.w - l.pad - l.contentX,\n height: 1,\n background: C.stroke,\n }}\n />\n </>\n );\n}\n\nfunction Cards({ l }: { l: DemoLayout }) {\n return (\n <>\n {CARDS.map((card, i) => {\n const r = l.cards[i];\n return (\n <div key={card.title}>\n <div\n style={{\n ...abs(r.rect),\n borderRadius: l.radius,\n border: `1px solid ${C.stroke}`,\n background: \"#fff\",\n boxShadow: \"0 1px 2px rgba(10,13,20,0.04)\",\n }}\n />\n <div\n style={{\n ...abs(r.title),\n width: r.rect.w - l.cardPad * 2 - 24,\n fontSize: l.v === 2 ? 14 : 13.5,\n fontWeight: 600,\n color: C.ink,\n whiteSpace: \"nowrap\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n }}\n >\n {card.title}\n </div>\n <div\n style={{ ...abs(r.time), width: 160, fontSize: 12, color: C.sub }}\n >\n {card.time}\n </div>\n <div\n style={{\n ...abs(r.chevron),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: C.soft,\n fontSize: 11,\n }}\n >\n ⌄\n </div>\n <div\n style={{\n ...abs(r.status),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n padding: \"0 8px\",\n borderRadius: l.v === 2 ? 6 : 4,\n background: card.bg,\n fontSize: 12,\n }}\n >\n <span\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n color: C.ink,\n }}\n >\n <span\n style={{\n width: 8,\n height: 8,\n borderRadius: 4,\n background: card.dot,\n }}\n />\n {card.status}\n </span>\n <span\n style={{\n color: C.sub,\n textDecoration: i === 0 ? \"underline\" : undefined,\n }}\n >\n {card.action}\n </span>\n </div>\n </div>\n );\n })}\n </>\n );\n}\n\nfunction Calendar({ l }: { l: DemoLayout }) {\n const { calendar: cal, columns, dayHeaderH, hourH } = l;\n return (\n <>\n {DAYS.map((day, i) => (\n <div\n key={day}\n style={{\n ...abs({\n x: columns[i].x,\n y: cal.y,\n w: columns[i].w,\n h: dayHeaderH,\n }),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontSize: 12,\n fontWeight: i === 0 ? 600 : 400,\n color: i === 0 ? C.ink : C.soft,\n borderLeft: `1px solid ${C.stroke}`,\n borderBottom: `1px solid ${C.stroke}`,\n }}\n >\n {day}\n </div>\n ))}\n {HOURS.slice(0, 4).map((hour, i) => (\n <div\n key={hour}\n style={{\n position: \"absolute\",\n left: cal.x,\n top: cal.y + dayHeaderH + i * hourH - 2,\n width: l.gutter - 10,\n textAlign: \"right\",\n fontSize: 11,\n color: C.soft,\n }}\n >\n {hour}\n </div>\n ))}\n {columns.map((col) => (\n <div\n key={col.x}\n style={{\n position: \"absolute\",\n left: col.x,\n top: cal.y + dayHeaderH,\n width: 1,\n height: cal.h - dayHeaderH,\n background: C.stroke,\n }}\n />\n ))}\n {l.events.map((event) => {\n const tone = TONES[event.tone];\n return (\n <div\n key={`${event.day}-${event.from}`}\n style={{\n ...abs(event.rect),\n borderRadius: l.v === 2 ? 8 : 4,\n background: tone.bg,\n padding: \"6px 8px\",\n fontSize: 11.5,\n fontWeight: 500,\n color: tone.ink,\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n textOverflow: \"ellipsis\",\n }}\n >\n {event.title}\n </div>\n );\n })}\n </>\n );\n}\n\n/** The whole dashboard window, positioned in a 1280x720 frame. */\nexport function DemoDashboard({ v }: { v: Version }) {\n const l = demoLayout(v);\n return (\n <div style={{ position: \"absolute\", inset: 0, fontFamily: FONT }}>\n <div\n style={{\n ...abs(WIN),\n background: C.window,\n borderRadius: 16,\n boxShadow:\n \"0 0 0 1px rgba(10,13,20,0.04), 0 16px 40px -12px rgba(10,13,20,0.12)\",\n }}\n />\n <div\n style={{\n ...abs(WIN),\n borderRadius: 16,\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: -WIN.x,\n top: -WIN.y,\n width: 1280,\n height: 720,\n }}\n >\n <Sidebar l={l} />\n <Header l={l} />\n <Tabs l={l} />\n <Cards l={l} />\n <Calendar l={l} />\n </div>\n </div>\n </div>\n );\n}\n\n/* Marks */\n\n/**\n * Annotation primitives: the redline marks a design review paints over a UI.\n * Each takes a `delay` in frames and draws itself in from there.\n */\n\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nexport function progress(frame: number, start: number, duration: number) {\n return interpolate(frame, [start, start + duration], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n}\n\n/** Pop-in for labels and chips: a cubic ease-out, no overshoot. */\nfunction usePop(delay: number) {\n return progress(useAuditFrame(), delay, 12);\n}\n\nfunction Layer({ children }: { children: ReactNode }) {\n return (\n <svg\n width={1280}\n height={720}\n viewBox=\"0 0 1280 720\"\n style={{ position: \"absolute\", inset: 0, overflow: \"visible\" }}\n >\n {children}\n </svg>\n );\n}\n\nexport type Side =\n | \"center\"\n | \"above\"\n | \"below\"\n | \"left\"\n | \"right\"\n | \"aboveStart\"\n | \"aboveEnd\"\n | \"belowStart\";\n\n/** Small spec label: mono text on a solid color chip. */\nexport function Pill({\n x,\n y,\n text,\n color,\n delay = 0,\n anchor = \"center\",\n ink = \"#fff\",\n}: {\n x: number;\n y: number;\n text: string;\n color: string;\n delay?: number;\n anchor?: Side;\n ink?: string;\n}) {\n const pop = usePop(delay);\n const shift = {\n center: \"translate(-50%, -50%)\",\n above: \"translate(-50%, calc(-100% - 5px))\",\n below: \"translate(-50%, 5px)\",\n left: \"translate(calc(-100% - 6px), -50%)\",\n right: \"translate(6px, -50%)\",\n aboveStart: \"translate(0, calc(-100% - 5px))\",\n aboveEnd: \"translate(-100%, calc(-100% - 5px))\",\n belowStart: \"translate(0, 5px)\",\n }[anchor];\n return (\n <div\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n transform: `${shift} scale(${0.7 + 0.3 * pop})`,\n opacity: Math.min(1, pop * 1.4),\n background: color,\n color: ink,\n fontFamily: MONO,\n fontSize: 10.5,\n fontWeight: 600,\n lineHeight: \"15px\",\n padding: \"0 5px\",\n borderRadius: 3,\n whiteSpace: \"nowrap\",\n }}\n >\n {text}\n </div>\n );\n}\n\n/**\n * Measurement between two points on one axis: end ticks snap in, the line\n * grows out from its middle, then the value pops on.\n */\nexport function Ruler({\n from,\n to,\n label,\n color,\n delay = 0,\n labelSide,\n}: {\n from: [number, number];\n to: [number, number];\n label: string;\n color: string;\n delay?: number;\n labelSide?: Side;\n}) {\n const frame = useAuditFrame();\n const grow = progress(frame, delay, 12);\n const ticks = progress(frame, delay - 2, 6);\n const horizontal = Math.abs(to[0] - from[0]) >= Math.abs(to[1] - from[1]);\n const mx = (from[0] + to[0]) / 2;\n const my = (from[1] + to[1]) / 2;\n const x1 = mx + (from[0] - mx) * grow;\n const y1 = my + (from[1] - my) * grow;\n const x2 = mx + (to[0] - mx) * grow;\n const y2 = my + (to[1] - my) * grow;\n const t = 4 * ticks;\n const tick = (x: number, y: number) =>\n horizontal ? `M${x} ${y - t}V${y + t}` : `M${x - t} ${y}H${x + t}`;\n return (\n <>\n <Layer>\n <path\n d={`${tick(...from)}${tick(...to)}`}\n stroke={color}\n strokeWidth={1.25}\n fill=\"none\"\n />\n <line\n x1={x1}\n y1={y1}\n x2={x2}\n y2={y2}\n stroke={color}\n strokeWidth={1.25}\n />\n </Layer>\n <Pill\n x={mx}\n y={my}\n text={label}\n color={color}\n delay={delay + 7}\n anchor={labelSide ?? (horizontal ? \"above\" : \"left\")}\n />\n </>\n );\n}\n\n/** Hairline box traced around an element, clockwise from the top left. */\nexport function OutlineBox({\n rect,\n color,\n delay = 0,\n radius = 3,\n inset = -3,\n dashed,\n fill,\n}: {\n rect: Rect;\n color: string;\n delay?: number;\n radius?: number;\n inset?: number;\n dashed?: boolean;\n fill?: string;\n}) {\n const frame = useAuditFrame();\n const draw = progress(frame, delay, 14);\n const x = rect.x + inset;\n const y = rect.y + inset;\n const w = rect.w - inset * 2;\n const h = rect.h - inset * 2;\n return (\n <Layer>\n <rect\n x={x}\n y={y}\n width={w}\n height={h}\n rx={radius}\n fill={fill ?? \"none\"}\n fillOpacity={draw}\n stroke={color}\n strokeWidth={1.25}\n pathLength={1}\n strokeDasharray={dashed ? undefined : `${draw} 1`}\n strokeOpacity={dashed ? draw : 1}\n style={dashed ? { strokeDasharray: \"3 3\" } : undefined}\n />\n </Layer>\n );\n}\n\n/** Quarter arc swept into a corner to call out its radius. */\nexport function CornerArc({\n x,\n y,\n r,\n color,\n label,\n delay = 0,\n}: {\n x: number;\n y: number;\n r: number;\n color: string;\n label: string;\n delay?: number;\n}) {\n const frame = useAuditFrame();\n const draw = progress(frame, delay, 12);\n const size = Math.max(r, 10) + 4;\n return (\n <>\n <Layer>\n <path\n d={`M${x} ${y + size}A${size} ${size} 0 0 1 ${x + size} ${y}`}\n stroke={color}\n strokeWidth={1.5}\n fill=\"none\"\n pathLength={1}\n strokeDasharray={`${draw} 1`}\n strokeLinecap=\"round\"\n />\n </Layer>\n <Pill\n x={x - 2}\n y={y - 2}\n text={label}\n color={color}\n delay={delay + 8}\n anchor=\"aboveStart\"\n />\n </>\n );\n}\n\n/**\n * Design-token tag: a dot lands on the element, a leader line runs out with\n * one elbow, and a dark chip with the token name settles at its end.\n */\nexport function TokenTag({\n anchor,\n at,\n label,\n swatch,\n delay = 0,\n lineColor = \"#0E121B\",\n}: {\n anchor: [number, number];\n at: [number, number];\n label: string;\n swatch: string;\n delay?: number;\n lineColor?: string;\n}) {\n const frame = useAuditFrame();\n const dot = usePop(delay);\n const draw = progress(frame, delay + 3, 14);\n const elbowY = at[1];\n const path = `M${anchor[0]} ${anchor[1]}L${anchor[0] + (at[0] - anchor[0]) * 0.35} ${elbowY}H${at[0]}`;\n return (\n <>\n <Layer>\n <path\n d={path}\n stroke={lineColor}\n strokeOpacity={0.55}\n strokeWidth={1}\n fill=\"none\"\n pathLength={1}\n strokeDasharray={`${draw} 1`}\n />\n <circle\n cx={anchor[0]}\n cy={anchor[1]}\n r={3.5 * dot}\n fill=\"#fff\"\n stroke={lineColor}\n strokeWidth={1.5}\n />\n </Layer>\n <TokenChip\n x={at[0]}\n y={at[1]}\n label={label}\n swatch={swatch}\n delay={delay + 13}\n />\n </>\n );\n}\n\nexport function TokenChip({\n x,\n y,\n label,\n swatch,\n delay = 0,\n}: {\n x: number;\n y: number;\n label: string;\n swatch: string;\n delay?: number;\n}) {\n const pop = usePop(delay);\n return (\n <div\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n transform: `translate(-50%, -50%) translateY(${(1 - pop) * 6}px)`,\n opacity: Math.min(1, pop * 1.4),\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n background: \"#0E121B\",\n color: \"#fff\",\n fontFamily: MONO,\n fontSize: 11,\n lineHeight: \"22px\",\n padding: \"0 8px\",\n borderRadius: 5,\n whiteSpace: \"nowrap\",\n boxShadow: \"0 4px 10px -4px rgba(10,13,20,0.4)\",\n }}\n >\n <span\n style={{\n width: 8,\n height: 8,\n borderRadius: 4,\n background: swatch,\n boxShadow: \"0 0 0 1px rgba(255,255,255,0.35)\",\n }}\n />\n {label}\n </div>\n );\n}\n\n/** Guide line that drops down (vertical) or slides across (horizontal). */\nexport function Guide({\n x,\n y,\n length,\n vertical,\n color,\n delay = 0,\n dashed,\n width = 1,\n}: {\n x: number;\n y: number;\n length: number;\n vertical?: boolean;\n color: string;\n delay?: number;\n dashed?: boolean;\n width?: number;\n}) {\n const frame = useAuditFrame();\n const draw = progress(frame, delay, 16) * length;\n return (\n <Layer>\n <line\n x1={x}\n y1={y}\n x2={vertical ? x : x + draw}\n y2={vertical ? y + draw : y}\n stroke={color}\n strokeWidth={width}\n strokeDasharray={dashed ? \"4 4\" : undefined}\n />\n </Layer>\n );\n}\n\n/**\n * Scan band: a crisp line with a soft wash trailing behind it, the way the\n * fix pass sweeps the screen. `y` is the line's position.\n */\nexport function ScanBand({\n y,\n color,\n x = 0,\n w = 1280,\n trail = 90,\n opacity = 1,\n}: {\n y: number;\n color: string;\n x?: number;\n w?: number;\n trail?: number;\n opacity?: number;\n}) {\n return (\n <div\n style={{ position: \"absolute\", inset: 0, opacity, pointerEvents: \"none\" }}\n >\n <div\n style={{\n position: \"absolute\",\n left: x,\n width: w,\n top: y - trail,\n height: trail,\n background: `linear-gradient(to bottom, transparent, ${color}2E)`,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n left: x,\n width: w,\n top: y - 1,\n height: 2,\n background: color,\n boxShadow: `0 0 12px 1px ${color}`,\n }}\n />\n </div>\n );\n}\n\n/** Stage-colored wash over everything except one rect, to push focus. */\nexport function Spotlight({\n rect,\n opacity,\n color = C.stage,\n}: {\n rect: Rect;\n opacity: number;\n color?: string;\n}) {\n const pad = 10;\n const x = rect.x - pad;\n const y = rect.y - pad;\n const w = rect.w + pad * 2;\n const h = rect.h + pad * 2;\n const r = 12;\n return (\n <svg\n width={1280}\n height={720}\n style={{ position: \"absolute\", inset: 0, opacity }}\n >\n <path\n fillRule=\"evenodd\"\n fill={color}\n fillOpacity={0.72}\n d={`M0 0H1280V720H0Z M${x + r} ${y}H${x + w - r}Q${x + w} ${y} ${x + w} ${y + r}V${y + h - r}Q${x + w} ${y + h} ${x + w - r} ${y + h}H${x + r}Q${x} ${y + h} ${x} ${y + h - r}V${y + r}Q${x} ${y} ${x + r} ${y}Z`}\n />\n </svg>\n );\n}\n\n/** Two full frames split at `y`: `top` shows above the line, `bottom` below. */\nexport function SplitAt({\n y,\n top,\n bottom,\n}: {\n y: number;\n top: ReactNode;\n bottom: ReactNode;\n}) {\n return (\n <>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n clipPath: `inset(${Math.max(0, y)}px 0 0 0)`,\n }}\n >\n {bottom}\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n clipPath: `inset(0 0 ${Math.max(0, 720 - y)}px 0)`,\n }}\n >\n {top}\n </div>\n </>\n );\n}\n\n/** Cubic ease-in-out between keyframes, clamped at both ends. */\nexport function easeInOut(frame: number, input: number[], output: number[]) {\n return interpolate(frame, input, output, {\n ...clamp,\n easing: Easing.inOut(Easing.cubic),\n });\n}\n\n/* Mark data */\n\nexport type Point = [number, number];\n\n/** A distance between two points on one axis, with its value. */\nexport type Measure = { from: Point; to: Point; label: string; side?: Side };\n/** A corner whose radius gets an arc and a label. `x`, `y` is the corner. */\nexport type RadiusMark = { x: number; y: number; r: number; label: string };\n/** An off-spec element and the fix it needs. */\nexport type Issue = {\n rect: Rect;\n note: string;\n side?: \"start\" | \"end\" | \"below\";\n};\n/** A token tag: dot on `anchor`, chip centered on `at`. */\nexport type TokenSpec = {\n anchor: Point;\n at: Point;\n label: string;\n swatch: string;\n};\n/** Layout guides over a column grid. */\nexport type GuideSpec = {\n /** x of every column edge, left to right. */\n columns: number[];\n top: number;\n bottom: number;\n /** One column (or any rect) to fill and label. */\n highlight?: { rect: Rect; label: string };\n /** A measurement drawn with the guides, like a gutter width. */\n ruler?: Measure;\n /** A horizontal marker line across the grid, like a calendar's now line. */\n now?: { y: number; from: number; to: number; label: string };\n};\n\nexport const AUDIT_COLORS = {\n audit: C.error,\n fix: C.blue,\n scan: C.primary,\n ink: C.ink,\n stage: C.stage,\n};\n\n/** Spacing and size redlines across the demo header, tabs and first cards. */\nfunction demoMeasures(l: DemoLayout): Measure[] {\n const card = l.cards[0];\n const next = l.cards[1];\n const tabsBottom = l.tabs[0].y + 32;\n const headerBottom = l.header.y + l.header.h;\n const tabGapX = l.tabs[1].x + l.tabs[1].w + 7;\n const right = l.button.x + l.button.w + 8;\n return [\n {\n from: [l.header.x, l.tabs[0].y + 16],\n to: [l.contentX, l.tabs[0].y + 16],\n label: `pad ${l.pad}`,\n side: \"below\",\n },\n {\n from: [tabGapX, headerBottom],\n to: [tabGapX, l.tabs[0].y],\n label: `${l.tabs[0].y - headerBottom}`,\n side: \"right\",\n },\n {\n from: [next.rect.x + 150, tabsBottom],\n to: [next.rect.x + 150, next.rect.y],\n label: `${next.rect.y - tabsBottom}`,\n side: \"right\",\n },\n {\n from: [card.rect.x + card.rect.w, card.rect.y + 46],\n to: [next.rect.x, card.rect.y + 46],\n label: `gap ${l.gap}`,\n },\n {\n from: [card.rect.x, card.title.y + 9],\n to: [card.title.x, card.title.y + 9],\n label: `${l.cardPad}`,\n side: \"left\",\n },\n {\n from: [card.title.x + 96, card.rect.y],\n to: [card.title.x + 96, card.title.y],\n label: `${l.cardPad}`,\n side: \"right\",\n },\n {\n from: [right, l.button.y],\n to: [right, l.button.y + l.button.h],\n label: `h ${l.button.h}`,\n side: \"below\",\n },\n ];\n}\n\nfunction demoRadii(l: DemoLayout): RadiusMark[] {\n const next = l.cards[1].rect;\n return [{ x: next.x, y: next.y, r: l.radius, label: `radius ${l.radius}` }];\n}\n\nfunction demoIssues(l: DemoLayout): Issue[] {\n return [\n { rect: l.cards[0].title, note: \"13.5 → 14\", side: \"start\" },\n { rect: l.cards[0].status, note: \"radius 4 → 6\", side: \"below\" },\n { rect: l.cards[0].chevron, note: \"hit 20 → 24\", side: \"end\" },\n { rect: l.button, note: \"#8B5CF6 ≠ primary\", side: \"end\" },\n { rect: l.sideActive, note: \"radius 5 → 8\", side: \"start\" },\n { rect: l.events[2].rect, note: \"radius 4 → 8\", side: \"start\" },\n { rect: l.events[6].rect, note: \"pad 6 → 8\", side: \"start\" },\n ];\n}\n\nfunction demoTokens(l: DemoLayout): TokenSpec[] {\n const [c0, c1, c2, c3] = l.cards;\n const chipY = l.calendar.y + 70;\n return [\n {\n anchor: [c0.status.x + 12, c0.status.y + 13],\n at: [c0.rect.x + 50, chipY + 50],\n label: \"state/success/lighter\",\n swatch: C.successBg,\n },\n {\n anchor: [c0.title.x + 40, c0.title.y + 9],\n at: [c0.rect.x + 170, chipY],\n label: \"text/strong-950\",\n swatch: C.ink,\n },\n {\n anchor: [c1.status.x + 12, c1.status.y + 13],\n at: [c1.rect.x + 110, chipY + 92],\n label: \"state/warning/base\",\n swatch: C.warning,\n },\n {\n anchor: [c2.status.x + 12, c2.status.y + 13],\n at: [c2.rect.x + 90, chipY + 20],\n label: \"state/error/base\",\n swatch: C.error,\n },\n {\n anchor: [c3.rect.x + c3.rect.w, c3.rect.y + 40],\n at: [c3.rect.x + 90, chipY + 70],\n label: \"stroke/soft-200\",\n swatch: C.stroke,\n },\n ];\n}\n\nfunction demoGuides(l: DemoLayout): GuideSpec {\n const cal = l.calendar;\n const today = l.columns[0];\n return {\n columns: [...l.columns.map((col) => col.x), cal.x + cal.w],\n top: cal.y,\n bottom: cal.y + cal.h,\n highlight: { rect: today, label: \"Mon 2 · today\" },\n ruler: {\n from: [cal.x, cal.y + l.dayHeaderH + 14],\n to: [cal.x + l.gutter, cal.y + l.dayHeaderH + 14],\n label: `w ${l.gutter}`,\n side: \"below\",\n },\n now: {\n y: cal.y + l.dayHeaderH + 1.25 * l.hourH,\n from: cal.x + l.gutter,\n to: cal.x + cal.w,\n label: \"10:15 AM\",\n },\n };\n}\n\n/** Close-up spec of the first card, sized for a zoomed camera. */\nfunction demoFocus(l: DemoLayout) {\n const card = l.cards[0];\n const r = card.rect;\n const below = r.y + r.h + 34;\n return {\n rect: r,\n measures: [\n {\n from: [r.x, card.title.y + 9],\n to: [card.title.x, card.title.y + 9],\n label: `${l.cardPad}`,\n side: \"below\",\n },\n {\n from: [card.title.x + 110, r.y],\n to: [card.title.x + 110, card.title.y],\n label: `${l.cardPad}`,\n side: \"right\",\n },\n {\n from: [r.x + r.w + 8, card.status.y],\n to: [r.x + r.w + 8, card.status.y + card.status.h],\n label: `h ${card.status.h}`,\n side: \"right\",\n },\n {\n from: [card.chevron.x - 2, card.chevron.y - 6],\n to: [card.chevron.x + card.chevron.w + 2, card.chevron.y - 6],\n label: \"24\",\n },\n ] as Measure[],\n radii: [{ x: r.x, y: r.y, r: l.radius, label: `radius ${l.radius}` }],\n tokens: [\n {\n anchor: [card.status.x + 12, card.status.y + 13],\n at: [r.x + 40, below],\n label: \"state/success/base\",\n swatch: C.success,\n },\n {\n anchor: [card.title.x + 60, card.title.y + 9],\n at: [r.x + 205, below - 4],\n label: \"text/strong-950\",\n swatch: C.ink,\n },\n {\n anchor: [card.time.x + 40, card.time.y + 8],\n at: [r.x + 70, below + 30],\n label: \"text/sub-600\",\n swatch: C.sub,\n },\n {\n anchor: [r.x + r.w, r.y + 30],\n at: [r.x + 230, below + 30],\n label: \"stroke/soft-200\",\n swatch: C.stroke,\n },\n ] as TokenSpec[],\n };\n}\n\nfunction demoSet(v: Version) {\n const l = demoLayout(v);\n return {\n layout: l,\n measures: demoMeasures(l),\n radii: demoRadii(l),\n issues: demoIssues(l),\n tokens: demoTokens(l),\n guides: demoGuides(l),\n focus: demoFocus(l),\n /** Rect around the tabs and the card row. */\n cardRow: {\n x: l.contentX,\n y: l.tabs[0].y,\n w: l.calendar.w,\n h: l.cards[0].rect.y + 92 - l.tabs[0].y,\n } satisfies Rect,\n };\n}\n\n/** Mark data measured off the demo dashboard: `before` is v1, `after` v2. */\nexport const DEMO = { before: demoSet(1), after: demoSet(2) };\nexport const DEMO_WINDOW = WIN;\n\n/* Mark sets */\n\n/** Rulers then radius arcs, each `stagger` frames after the last. */\nexport function MeasureMarks({\n measures,\n radii = [],\n color,\n start = 0,\n stagger = 5,\n}: {\n measures: Measure[];\n radii?: RadiusMark[];\n color: string;\n start?: number;\n stagger?: number;\n}) {\n return (\n <>\n {measures.map((m, i) => (\n <Ruler\n key={`${m.from.join()}-${m.to.join()}`}\n from={m.from}\n to={m.to}\n label={m.label}\n color={color}\n delay={start + i * stagger}\n labelSide={m.side}\n />\n ))}\n {radii.map((r, i) => (\n <CornerArc\n key={`${r.x}-${r.y}`}\n x={r.x}\n y={r.y}\n r={r.r}\n label={r.label}\n color={color}\n delay={start + (measures.length + i) * stagger}\n />\n ))}\n </>\n );\n}\n\nconst NOTE_SPOT = {\n start: (r: Rect) => ({\n x: r.x - 3,\n y: r.y - 3,\n anchor: \"aboveStart\" as const,\n }),\n end: (r: Rect) => ({\n x: r.x + r.w + 3,\n y: r.y - 3,\n anchor: \"aboveEnd\" as const,\n }),\n below: (r: Rect) => ({\n x: r.x - 3,\n y: r.y + r.h + 3,\n anchor: \"belowStart\" as const,\n }),\n};\n\n/** Every issue boxed, with its note popping on once the box closes. */\nexport function IssueMarks({\n issues,\n color,\n start = 0,\n stagger = 4,\n}: {\n issues: Issue[];\n color: string;\n start?: number;\n stagger?: number;\n}) {\n return (\n <>\n {issues.map((issue, i) => (\n <div key={`${issue.rect.x}-${issue.rect.y}-${issue.note}`}>\n <OutlineBox\n rect={issue.rect}\n color={color}\n delay={start + i * stagger}\n />\n <Pill\n {...NOTE_SPOT[issue.side ?? \"start\"](issue.rect)}\n text={issue.note}\n color={color}\n delay={start + i * stagger + 10}\n />\n </div>\n ))}\n </>\n );\n}\n\nexport function TokenMarks({\n tokens,\n start = 0,\n stagger = 6,\n lineColor,\n}: {\n tokens: TokenSpec[];\n start?: number;\n stagger?: number;\n lineColor?: string;\n}) {\n return (\n <>\n {tokens.map((tag, i) => (\n <TokenTag\n key={`${tag.label}-${tag.anchor.join()}`}\n anchor={tag.anchor}\n at={tag.at}\n label={tag.label}\n swatch={tag.swatch}\n lineColor={lineColor}\n delay={start + i * stagger}\n />\n ))}\n </>\n );\n}\n\n/** Column guides drop in, the highlight fills, then the now line slides across. */\nexport function GuideMarks({\n guides,\n color,\n nowColor = C.primary,\n start = 0,\n}: {\n guides: GuideSpec;\n color: string;\n nowColor?: string;\n start?: number;\n}) {\n const { columns, top, bottom, highlight, ruler, now } = guides;\n const h = highlight?.rect;\n return (\n <>\n {columns.map((x, i) => (\n <Guide\n key={x}\n x={x}\n y={top}\n length={bottom - top}\n vertical\n color={color}\n dashed\n delay={start + i * 3}\n />\n ))}\n {h && highlight && (\n <>\n <OutlineBox\n rect={h}\n color={color}\n fill={`${color}14`}\n inset={0}\n radius={0}\n delay={start + 14}\n />\n <OutlineBox\n rect={{ x: h.x + 6, y: h.y + 4, w: h.w - 12, h: 22 }}\n color={color}\n radius={4}\n inset={0}\n delay={start + 20}\n />\n <Pill\n x={h.x + h.w / 2}\n y={h.y + 4}\n text={highlight.label}\n color={color}\n delay={start + 26}\n anchor=\"above\"\n />\n </>\n )}\n {ruler && (\n <Ruler\n from={ruler.from}\n to={ruler.to}\n label={ruler.label}\n color={color}\n delay={start + 24}\n labelSide={ruler.side}\n />\n )}\n {now && (\n <>\n <Guide\n x={now.from}\n y={now.y}\n length={now.to - now.from}\n color={nowColor}\n width={1.5}\n delay={start + 30}\n />\n <Pill\n x={now.from}\n y={now.y}\n text={now.label}\n color={nowColor}\n delay={start + 30}\n anchor=\"left\"\n />\n </>\n )}\n </>\n );\n}\n\n/** Brand name with a version chip that flips once the fix lands. */\nexport function VersionChip({\n brand,\n versions,\n fixed,\n colors,\n}: {\n brand: string;\n versions: [string, string];\n fixed: boolean;\n colors: [string, string];\n}) {\n return (\n <div\n style={{\n position: \"absolute\",\n left: WIN.x,\n top: 26,\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n fontSize: 15,\n fontWeight: 600,\n color: C.ink,\n }}\n >\n {brand}\n <span\n style={{\n fontFamily: MONO,\n fontSize: 11,\n color: \"#fff\",\n background: fixed ? colors[1] : colors[0],\n borderRadius: 999,\n padding: \"1px 8px\",\n }}\n >\n {fixed ? versions[1] : versions[0]}\n </span>\n </div>\n );\n}\n",+ "type": "registry:lib",+ "target": "lib/remocn/audit-core.tsx"+ }+ ],+ "type": "registry:lib"+}diff --git a/registry-artifacts/design-audit.json b/registry-artifacts/design-audit.jsonnew file mode 100644index 00000000..99d46d02--- /dev/null+++ b/registry-artifacts/design-audit.json@@ -0,0 +1,17 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "design-audit",+ "title": "Design Audit",+ "description": "A full design review in one scene: redlines and issue boxes, a scan that ships the fix, a camera push into one card with specs and tokens, then layout guides.",+ "dependencies": ["remotion"],+ "registryDependencies": ["@remocn/audit-core"],+ "files": [+ {+ "path": "registry/remocn/design-audit/index.tsx",+ "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { AbsoluteFill } from \"remotion\";\nimport {\n AUDIT_COLORS,\n AuditClock,\n DEMO,\n DEMO_WINDOW,\n DemoDashboard,\n easeInOut,\n FONT,\n GuideMarks,\n type GuideSpec,\n type Issue,\n IssueMarks,\n type Measure,\n MeasureMarks,\n progress,\n type RadiusMark,\n type Rect,\n ScanBand,\n SplitAt,\n Spotlight,\n TokenMarks,\n type TokenSpec,\n useAuditFrame,\n VersionChip,\n} from \"@/lib/remocn/audit-core\";\n\nexport type DesignAuditMarks = {\n measures?: Measure[];\n radii?: RadiusMark[];\n};\n\nexport type DesignAuditFocus = {\n /** Element the camera pushes in on. */\n rect: Rect;\n measures?: Measure[];\n radii?: RadiusMark[];\n tokens?: TokenSpec[];\n};\n\nexport type DesignAuditProps = {\n /** UI before the fix, 1280x720. Defaults to a demo dashboard with drifted spacing. */\n before?: ReactNode;\n /** The fixed UI, same layout. */\n after?: ReactNode;\n /** Red redlines drawn over `before`. */\n beforeMarks?: DesignAuditMarks;\n /** Off-spec elements boxed on `before`. */\n issues?: Issue[];\n /** Blue redlines over `after`, shown once the scan lands. */\n afterMarks?: DesignAuditMarks;\n /** Close-up the camera pushes into, with its specs and tokens. `null` skips the zoom. */\n focus?: DesignAuditFocus | null;\n /** Guides drawn after the camera pulls back. */\n guides?: GuideSpec | null;\n /** Four step names lit one by one across the top. */\n steps?: string[];\n /** Name next to the version chip. Empty hides the top bar. */\n brand?: string;\n versions?: [string, string];\n auditColor?: string;\n fixColor?: string;\n scanColor?: string;\n background?: string;\n speed?: number;\n};\n\nexport const designAuditDefaults = {\n steps: [\"Audit\", \"Layout\", \"Components\", \"Tokens\"],\n brand: \"Synergy\",\n versions: [\"v1.0\", \"v2.0\"] as [string, string],\n auditColor: AUDIT_COLORS.audit,\n fixColor: AUDIT_COLORS.fix,\n scanColor: AUDIT_COLORS.scan,\n background: AUDIT_COLORS.stage,\n speed: 1,\n};\n\nconst T = {\n redline: 14,\n audit: 34,\n scan: 72,\n scanLength: 64,\n zoomIn: 156,\n callouts: 180,\n tokens: 208,\n zoomOut: 252,\n guides: 278,\n};\n\nexport const designAuditLength = 332;\n\nexport function DesignAudit(props: DesignAuditProps) {\n const { speed = 1 } = props;\n return (\n <AuditClock speed={speed}>\n <Scene {...props} />\n </AuditClock>\n );\n}\n\nfunction Scene({\n before,\n after,\n beforeMarks,\n issues,\n afterMarks,\n focus,\n guides,\n steps = designAuditDefaults.steps,\n brand = designAuditDefaults.brand,\n versions = designAuditDefaults.versions,\n auditColor = designAuditDefaults.auditColor,\n fixColor = designAuditDefaults.fixColor,\n scanColor = designAuditDefaults.scanColor,\n background = designAuditDefaults.background,\n}: DesignAuditProps) {\n const frame = useAuditFrame();\n const demo = !before && !after;\n const redBefore = beforeMarks ?? (demo ? DEMO.before : {});\n const blueAfter = afterMarks ?? (demo ? DEMO.after : {});\n const flagged = issues ?? (demo ? DEMO.before.issues : []);\n const zoomed = focus === undefined ? (demo ? DEMO.after.focus : null) : focus;\n const grid =\n guides === undefined ? (demo ? DEMO.after.guides : null) : guides;\n\n const y = easeInOut(frame, [T.scan, T.scan + T.scanLength], [-20, 760]);\n const band = easeInOut(\n frame,\n [T.scan - 4, T.scan + 2, T.scan + T.scanLength - 8, T.scan + T.scanLength],\n [0, 1, 1, 0],\n );\n const enter = progress(frame, 0, 18);\n const zoom = zoomed\n ? easeInOut(\n frame,\n [T.zoomIn, T.zoomIn + 22, T.zoomOut, T.zoomOut + 22],\n [0, 1, 1, 0],\n )\n : 0;\n const card = zoomed?.rect ?? { x: 640, y: 360, w: 0, h: 0 };\n const center = { x: card.x + card.w / 2 + 40, y: card.y + card.h / 2 + 46 };\n const camera = `translate(${(640 - center.x) * zoom}px, ${(360 - center.y) * zoom}px) scale(${1 + zoom * 1.35})`;\n const fadeOut = (at: number) => easeInOut(frame, [at - 10, at], [1, 0]);\n\n const active =\n frame < T.scan ? 0 : frame < T.zoomIn ? 1 : frame < T.tokens ? 2 : 3;\n\n return (\n <AbsoluteFill style={{ background, fontFamily: FONT }}>\n <AbsoluteFill\n style={{\n transform: camera,\n transformOrigin: `${center.x}px ${center.y}px`,\n }}\n >\n <AbsoluteFill\n style={{\n opacity: enter,\n transform: `translateY(${(1 - enter) * 18}px) scale(${0.97 + 0.03 * enter})`,\n }}\n >\n <SplitAt\n y={y}\n bottom={\n <>\n {before ?? <DemoDashboard v={1} />}\n <MeasureMarks\n measures={redBefore.measures ?? []}\n radii={redBefore.radii}\n color={auditColor}\n start={T.redline}\n />\n <IssueMarks\n issues={flagged}\n color={auditColor}\n start={T.audit}\n />\n </>\n }\n top={\n <>\n {after ?? <DemoDashboard v={2} />}\n <AbsoluteFill\n style={{ opacity: zoomed ? fadeOut(T.zoomIn) : 1 }}\n >\n <MeasureMarks\n measures={blueAfter.measures ?? []}\n radii={blueAfter.radii}\n color={fixColor}\n start={-200}\n />\n </AbsoluteFill>\n </>\n }\n />\n <ScanBand y={y} color={scanColor} opacity={band} />\n {zoomed && (\n <>\n <Spotlight rect={zoomed.rect} color={background} opacity={zoom} />\n {frame >= T.callouts && (\n <AbsoluteFill style={{ opacity: fadeOut(T.zoomOut + 6) }}>\n <MeasureMarks\n measures={zoomed.measures ?? []}\n radii={zoomed.radii}\n color={fixColor}\n start={T.callouts}\n stagger={4}\n />\n <TokenMarks tokens={zoomed.tokens ?? []} start={T.tokens} />\n </AbsoluteFill>\n )}\n </>\n )}\n {grid && (\n <GuideMarks guides={grid} color={fixColor} start={T.guides} />\n )}\n </AbsoluteFill>\n </AbsoluteFill>\n {brand && (\n <AbsoluteFill style={{ opacity: enter * (1 - zoom) }}>\n <VersionChip\n brand={brand}\n versions={versions}\n fixed={y > 36}\n colors={[auditColor, fixColor]}\n />\n <StepBar\n steps={steps}\n active={active}\n colors={[auditColor, fixColor]}\n />\n </AbsoluteFill>\n )}\n </AbsoluteFill>\n );\n}\n\nfunction StepBar({\n steps,\n active,\n colors,\n}: {\n steps: string[];\n active: number;\n colors: [string, string];\n}) {\n return (\n <div\n style={{\n position: \"absolute\",\n right: 1280 - DEMO_WINDOW.x - DEMO_WINDOW.w,\n top: 28,\n display: \"flex\",\n gap: 18,\n fontSize: 12.5,\n }}\n >\n {steps.map((step, i) => {\n const on = i <= active;\n return (\n <span\n key={step}\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n color: on ? AUDIT_COLORS.ink : \"#99A0AE\",\n fontWeight: i === active ? 600 : 400,\n }}\n >\n <span\n style={{\n width: 6,\n height: 6,\n borderRadius: 3,\n background: on\n ? active === 0\n ? colors[0]\n : colors[1]\n : \"#E1E4EA\",\n }}\n />\n {step}\n </span>\n );\n })}\n </div>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/design-audit.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/elements/audit-boxes.json b/registry-artifacts/elements/audit-boxes.jsonnew file mode 100644index 00000000..8e4935f3--- /dev/null+++ b/registry-artifacts/elements/audit-boxes.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Audit Boxes",+ "durationInFrames": 56,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "audit-boxes",+ "sourceCode": "import { createContext, forwardRef, useContext, useImperativeHandle, useRef, type CSSProperties, type ComponentProps, type ReactNode } from \"react\";\nimport { AbsoluteFill, Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\n/**\n * Shared kit behind the design-review family (redline-measure, audit-boxes,\n * scan-fix, token-tags, layout-guides, design-audit): the annotation marks a\n * design review paints over a UI, the scan band that sweeps a fix across it,\n * and a demo calendar dashboard the marks are measured against by default.\n *\n * Every coordinate is in composition pixels of a 1280x720 frame.\n */\n\nconst AuditSpeed = createContext(1);\n\n/** Scales the clock every mark below it reads. */\nfunction AuditClock({\n speed,\n children,\n}: {\n speed: number;\n children: ReactNode;\n}) {\n return <AuditSpeed.Provider value={speed}>{children}</AuditSpeed.Provider>;\n}\n\nfunction useAuditFrame() {\n return useCurrentFrame() * useContext(AuditSpeed);\n}\n\n/* Demo dashboard */\n/**\n * A calendar dashboard drawn from one layout function, so every annotation\n * can measure the exact rects the UI paints. Version 1 is the \"before\"\n * build with drifted spacing and radii, version 2 is the fixed one.\n */\n\ntype Rect = { x: number; y: number; w: number; h: number };\ntype Version = 1 | 2;\n\nconst FONT =\n \"Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\";\nconst MONO = \"ui-monospace, 'SF Mono', Menlo, Consolas, monospace\";\n\nconst C = {\n stage: \"#EDEDEF\",\n window: \"#FFFFFF\",\n ink: \"#0E121B\",\n sub: \"#525866\",\n soft: \"#99A0AE\",\n stroke: \"#E1E4EA\",\n weak: \"#F5F7FA\",\n primary: \"#7D52F4\",\n success: \"#1FC16B\",\n successBg: \"#E0FAEC\",\n warning: \"#FA7319\",\n warningBg: \"#FFF1EB\",\n error: \"#FB3748\",\n errorBg: \"#FFEBEC\",\n blue: \"#335CFF\",\n blueBg: \"#EBF1FF\",\n orangeBg: \"#FFF3EB\",\n purpleBg: \"#EFEBFF\",\n};\n\nconst WIN: Rect = { x: 80, y: 64, w: 1120, h: 616 };\nconst SIDE_W = 216;\nconst HEADER_H = 56;\nconst MAIN_X = WIN.x + SIDE_W;\nconst MAIN_R = WIN.x + WIN.w;\n\nconst CARDS = [\n {\n title: \"Weekly team meeting\",\n time: \"3:00 – 4:30 PM\",\n status: \"Today\",\n action: \"Join meeting\",\n dot: C.success,\n bg: C.successBg,\n },\n {\n title: \"Product launch event\",\n time: \"11:00 AM – 12:30 PM\",\n status: \"2 conflicts\",\n action: \"Review\",\n dot: C.warning,\n bg: C.warningBg,\n },\n {\n title: \"Team building workshop\",\n time: \"10:00 AM – 1:00 PM\",\n status: \"Canceled\",\n action: \"Fri, Nov 6\",\n dot: C.error,\n bg: C.errorBg,\n },\n {\n title: \"Marketing campaign\",\n time: \"2:30 – 4:00 PM\",\n status: \"In 3 days\",\n action: \"Thu, Nov 5\",\n dot: C.soft,\n bg: C.weak,\n },\n];\n\nconst TABS = [\n { label: \"All scheduled\", count: \"15\" },\n { label: \"Meetings\", count: \"12\" },\n { label: \"Events\", count: \"3\" },\n { label: \"Conflicted\", count: \"2\" },\n { label: \"Canceled\", count: \"1\" },\n];\n\nconst DAYS = [\"Mon 2\", \"Tue 3\", \"Wed 4\", \"Thu 5\", \"Fri 6\"];\nconst HOURS = [\"9 AM\", \"10 AM\", \"11 AM\", \"12 PM\", \"1 PM\"];\n\nconst EVENTS = [\n { day: 0, from: 0, to: 0.5, title: \"Brainstorming session\", tone: \"gray\" },\n { day: 0, from: 0.55, to: 1.05, title: \"Bi-weekly sync\", tone: \"gray\" },\n { day: 1, from: 0, to: 0.45, title: \"Project review\", tone: \"blue\" },\n { day: 1, from: 1.05, to: 2.6, title: \"Sales team training\", tone: \"blue\" },\n { day: 2, from: 0.5, to: 1.0, title: \"Marketing strategy\", tone: \"blue\" },\n { day: 2, from: 2.6, to: 3.6, title: \"Interview: frontend\", tone: \"purple\" },\n { day: 3, from: 0, to: 1.0, title: \"Customer feedback\", tone: \"blue\" },\n { day: 3, from: 2.2, to: 3.4, title: \"Product launch\", tone: \"orange\" },\n { day: 0, from: 2.5, to: 3.7, title: \"Workshop: design\", tone: \"orange\" },\n { day: 4, from: 1.1, to: 3.7, title: \"Team building\", tone: \"gray\" },\n] as const;\n\nconst TONES = {\n gray: { bg: C.weak, ink: C.sub },\n blue: { bg: C.blueBg, ink: \"#2547D0\" },\n purple: { bg: C.purpleBg, ink: \"#5B3CC4\" },\n orange: { bg: C.orangeBg, ink: \"#C2540A\" },\n};\n\n/** Every rect the dashboard paints, in composition pixels. */\nfunction demoLayout(v: Version) {\n const pad = v === 2 ? 24 : 20;\n const gap = v === 2 ? 16 : 10;\n const cardPad = v === 2 ? 16 : 12;\n const radius = v === 2 ? 12 : 6;\n const contentX = MAIN_X + pad;\n const contentW = MAIN_R - pad - contentX;\n\n const header: Rect = { x: MAIN_X, y: WIN.y, w: MAIN_R - MAIN_X, h: HEADER_H };\n const button: Rect = {\n x: MAIN_R - pad - 128,\n y: WIN.y + 12,\n w: 128,\n h: v === 2 ? 32 : 34,\n };\n const tabsY = WIN.y + HEADER_H + (v === 2 ? 16 : 12);\n let tabX = contentX;\n const tabs = TABS.map((tab, i) => {\n const w = 46 + tab.label.length * 7.4 + (i === 0 ? 26 : 0);\n const rect: Rect = { x: tabX, y: tabsY, w, h: 32 };\n tabX += w + 14;\n return rect;\n });\n\n const cardsY = tabsY + 32 + (v === 2 ? 16 : 12);\n const cardW = (contentW - gap * 3) / 4;\n const cards = CARDS.map((_, i) => {\n const rect: Rect = {\n x: contentX + i * (cardW + gap),\n y: cardsY,\n w: cardW,\n h: 92,\n };\n return {\n rect,\n title: { x: rect.x + cardPad, y: rect.y + cardPad, w: 150, h: 18 },\n time: { x: rect.x + cardPad, y: rect.y + cardPad + 21, w: 110, h: 15 },\n status: {\n x: rect.x + cardPad - 4,\n y: rect.y + rect.h - cardPad - 24,\n w: rect.w - cardPad * 2 + 8,\n h: 26,\n },\n chevron: {\n x: rect.x + rect.w - cardPad - 20,\n y: rect.y + cardPad - 2,\n w: 20,\n h: 20,\n },\n };\n });\n\n const calY = cardsY + 92 + 22;\n const calendar: Rect = {\n x: contentX,\n y: calY,\n w: contentW,\n h: WIN.y + WIN.h - calY - 16,\n };\n const gutter = 56;\n const colW = (contentW - gutter) / DAYS.length;\n const dayHeaderH = 30;\n const hourH = (calendar.h - dayHeaderH) / 4;\n const columns = DAYS.map(\n (_, i): Rect => ({\n x: contentX + gutter + i * colW,\n y: calY,\n w: colW,\n h: calendar.h,\n }),\n );\n const events = EVENTS.map((event) => ({\n ...event,\n rect: {\n x: columns[event.day].x + 4,\n y: calY + dayHeaderH + event.from * hourH + 3,\n w: colW - 8,\n h: (event.to - event.from) * hourH - 6,\n } satisfies Rect,\n }));\n\n return {\n v,\n pad,\n gap,\n cardPad,\n radius,\n contentX,\n header,\n button,\n tabs,\n cards,\n calendar,\n columns,\n gutter,\n dayHeaderH,\n hourH,\n events,\n sidebar: { x: WIN.x, y: WIN.y, w: SIDE_W, h: WIN.h } satisfies Rect,\n sideActive: { x: WIN.x + 10, y: WIN.y + 158, w: SIDE_W - 20, h: 30 },\n };\n}\n\ntype DemoLayout = ReturnType<typeof demoLayout>;\n\nconst abs = (r: Rect): CSSProperties => ({\n position: \"absolute\",\n left: r.x,\n top: r.y,\n width: r.w,\n height: r.h,\n});\n\nfunction Glyph({\n size = 14,\n color = C.soft,\n}: {\n size?: number;\n color?: string;\n}) {\n return (\n <div\n style={{\n width: size,\n height: size,\n borderRadius: 4,\n border: `1.5px solid ${color}`,\n flexShrink: 0,\n }}\n />\n );\n}\n\nconst SIDE_ITEMS: (string | { section: string })[] = [\n \"Inbox\",\n \"Dashboard\",\n { section: \"Workspace\" },\n \"Calendar\",\n \"Time off\",\n \"People\",\n \"Payroll\",\n \"Projects\",\n \"Documents\",\n { section: \"Favorites\" },\n \"Loom Mobile App\",\n \"Monday Re-design\",\n \"Udemy Courses\",\n];\n\nfunction Sidebar({ l }: { l: DemoLayout }) {\n let y = WIN.y + 68;\n return (\n <>\n <div\n style={{\n ...abs({ x: WIN.x, y: WIN.y, w: SIDE_W, h: WIN.h }),\n borderRight: `1px solid ${C.stroke}`,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n left: WIN.x + 18,\n top: WIN.y + 18,\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n fontSize: 14,\n fontWeight: 600,\n color: C.ink,\n }}\n >\n <div\n style={{\n width: 22,\n height: 22,\n borderRadius: 11,\n background: C.primary,\n }}\n />\n Synergy\n </div>\n {SIDE_ITEMS.map((item) => {\n const top = y;\n if (typeof item !== \"string\") {\n y += 30;\n return (\n <div\n key={item.section}\n style={{\n position: \"absolute\",\n left: WIN.x + 20,\n top: top + 10,\n fontSize: 11,\n letterSpacing: \"0.04em\",\n textTransform: \"uppercase\",\n color: C.soft,\n }}\n >\n {item.section}\n </div>\n );\n }\n y += 30;\n const active = item === \"Calendar\";\n return (\n <div\n key={item}\n style={{\n ...abs(\n active\n ? l.sideActive\n : { x: WIN.x + 10, y: top, w: SIDE_W - 20, h: 30 },\n ),\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n paddingLeft: 10,\n borderRadius: l.v === 2 ? 8 : 5,\n background: active ? C.weak : undefined,\n fontSize: 13,\n fontWeight: active ? 500 : 400,\n color: active ? C.ink : C.sub,\n }}\n >\n <Glyph color={active ? C.primary : C.soft} />\n {item}\n </div>\n );\n })}\n <div\n style={{\n position: \"absolute\",\n left: WIN.x + 18,\n top: WIN.y + WIN.h - 44,\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n fontSize: 13,\n color: C.ink,\n }}\n >\n <div\n style={{\n width: 26,\n height: 26,\n borderRadius: 13,\n background: \"linear-gradient(135deg,#FBC5A6,#F17B6A)\",\n }}\n />\n Olivia Hart\n </div>\n </>\n );\n}\n\nfunction Header({ l }: { l: DemoLayout }) {\n return (\n <>\n <div\n style={{\n ...abs(l.header),\n borderBottom: `1px solid ${C.stroke}`,\n display: \"flex\",\n alignItems: \"center\",\n gap: 12,\n paddingLeft: l.pad,\n fontSize: 14,\n }}\n >\n <Glyph size={16} color={C.sub} />\n <span style={{ fontWeight: 600, color: C.ink }}>\n Monday, November 2\n </span>\n <span style={{ color: C.soft }}>\n You have 3 meetings and 1 event today.\n </span>\n </div>\n <div\n style={{\n ...abs({ x: l.button.x - 104, y: l.button.y, w: 92, h: l.button.h }),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: 6,\n borderRadius: l.v === 2 ? 8 : 6,\n border: `1px solid ${C.stroke}`,\n fontSize: 13,\n color: C.sub,\n }}\n >\n Schedule\n </div>\n <div\n style={{\n ...abs(l.button),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: l.v === 2 ? 8 : 6,\n background: l.v === 2 ? C.primary : \"#8B5CF6\",\n color: \"#fff\",\n fontSize: 13,\n fontWeight: 500,\n }}\n >\n + Create event\n </div>\n </>\n );\n}\n\nfunction Tabs({ l }: { l: DemoLayout }) {\n return (\n <>\n {TABS.map((tab, i) => (\n <div\n key={tab.label}\n style={{\n ...abs(l.tabs[i]),\n display: \"flex\",\n alignItems: \"center\",\n gap: 7,\n fontSize: 13,\n fontWeight: i === 0 ? 500 : 400,\n color: i === 0 ? C.ink : C.sub,\n borderBottom: i === 0 ? `2px solid ${C.primary}` : undefined,\n }}\n >\n <Glyph color={i === 0 ? C.primary : C.soft} />\n {tab.label}\n <span\n style={{\n fontSize: 11,\n fontWeight: 500,\n color: i === 0 ? \"#fff\" : C.soft,\n background:\n i === 0 ? (l.v === 2 ? C.primary : \"#8B5CF6\") : undefined,\n borderRadius: 8,\n padding: i === 0 ? \"1px 6px\" : 0,\n }}\n >\n {tab.count}\n </span>\n </div>\n ))}\n <div\n style={{\n position: \"absolute\",\n left: l.contentX,\n top: l.tabs[0].y + 32,\n width: WIN.x + WIN.w - l.pad - l.contentX,\n height: 1,\n background: C.stroke,\n }}\n />\n </>\n );\n}\n\nfunction Cards({ l }: { l: DemoLayout }) {\n return (\n <>\n {CARDS.map((card, i) => {\n const r = l.cards[i];\n return (\n <div key={card.title}>\n <div\n style={{\n ...abs(r.rect),\n borderRadius: l.radius,\n border: `1px solid ${C.stroke}`,\n background: \"#fff\",\n boxShadow: \"0 1px 2px rgba(10,13,20,0.04)\",\n }}\n />\n <div\n style={{\n ...abs(r.title),\n width: r.rect.w - l.cardPad * 2 - 24,\n fontSize: l.v === 2 ? 14 : 13.5,\n fontWeight: 600,\n color: C.ink,\n whiteSpace: \"nowrap\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n }}\n >\n {card.title}\n </div>\n <div\n style={{ ...abs(r.time), width: 160, fontSize: 12, color: C.sub }}\n >\n {card.time}\n </div>\n <div\n style={{\n ...abs(r.chevron),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: C.soft,\n fontSize: 11,\n }}\n >\n ⌄\n </div>\n <div\n style={{\n ...abs(r.status),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n padding: \"0 8px\",\n borderRadius: l.v === 2 ? 6 : 4,\n background: card.bg,\n fontSize: 12,\n }}\n >\n <span\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n color: C.ink,\n }}\n >\n <span\n style={{\n width: 8,\n height: 8,\n borderRadius: 4,\n background: card.dot,\n }}\n />\n {card.status}\n </span>\n <span\n style={{\n color: C.sub,\n textDecoration: i === 0 ? \"underline\" : undefined,\n }}\n >\n {card.action}\n </span>\n </div>\n </div>\n );\n })}\n </>\n );\n}\n\nfunction Calendar({ l }: { l: DemoLayout }) {\n const { calendar: cal, columns, dayHeaderH, hourH } = l;\n return (\n <>\n {DAYS.map((day, i) => (\n <div\n key={day}\n style={{\n ...abs({\n x: columns[i].x,\n y: cal.y,\n w: columns[i].w,\n h: dayHeaderH,\n }),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontSize: 12,\n fontWeight: i === 0 ? 600 : 400,\n color: i === 0 ? C.ink : C.soft,\n borderLeft: `1px solid ${C.stroke}`,\n borderBottom: `1px solid ${C.stroke}`,\n }}\n >\n {day}\n </div>\n ))}\n {HOURS.slice(0, 4).map((hour, i) => (\n <div\n key={hour}\n style={{\n position: \"absolute\",\n left: cal.x,\n top: cal.y + dayHeaderH + i * hourH - 2,\n width: l.gutter - 10,\n textAlign: \"right\",\n fontSize: 11,\n color: C.soft,\n }}\n >\n {hour}\n </div>\n ))}\n {columns.map((col) => (\n <div\n key={col.x}\n style={{\n position: \"absolute\",\n left: col.x,\n top: cal.y + dayHeaderH,\n width: 1,\n height: cal.h - dayHeaderH,\n background: C.stroke,\n }}\n />\n ))}\n {l.events.map((event) => {\n const tone = TONES[event.tone];\n return (\n <div\n key={`${event.day}-${event.from}`}\n style={{\n ...abs(event.rect),\n borderRadius: l.v === 2 ? 8 : 4,\n background: tone.bg,\n padding: \"6px 8px\",\n fontSize: 11.5,\n fontWeight: 500,\n color: tone.ink,\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n textOverflow: \"ellipsis\",\n }}\n >\n {event.title}\n </div>\n );\n })}\n </>\n );\n}\n\n/** The whole dashboard window, positioned in a 1280x720 frame. */\nfunction DemoDashboard({ v }: { v: Version }) {\n const l = demoLayout(v);\n return (\n <div style={{ position: \"absolute\", inset: 0, fontFamily: FONT }}>\n <div\n style={{\n ...abs(WIN),\n background: C.window,\n borderRadius: 16,\n boxShadow:\n \"0 0 0 1px rgba(10,13,20,0.04), 0 16px 40px -12px rgba(10,13,20,0.12)\",\n }}\n />\n <div\n style={{\n ...abs(WIN),\n borderRadius: 16,\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: -WIN.x,\n top: -WIN.y,\n width: 1280,\n height: 720,\n }}\n >\n <Sidebar l={l} />\n <Header l={l} />\n <Tabs l={l} />\n <Cards l={l} />\n <Calendar l={l} />\n </div>\n </div>\n </div>\n );\n}\n\n/* Marks */\n\n/**\n * Annotation primitives: the redline marks a design review paints over a UI.\n * Each takes a `delay` in frames and draws itself in from there.\n */\n\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nfunction progress(frame: number, start: number, duration: number) {\n return interpolate(frame, [start, start + duration], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n}\n\n/** Pop-in for labels and chips: a cubic ease-out, no overshoot. */\nfunction usePop(delay: number) {\n return progress(useAuditFrame(), delay, 12);\n}\n\nfunction Layer({ children }: { children: ReactNode }) {\n return (\n <svg\n width={1280}\n height={720}\n viewBox=\"0 0 1280 720\"\n style={{ position: \"absolute\", inset: 0, overflow: \"visible\" }}\n >\n {children}\n </svg>\n );\n}\n\ntype Side =\n | \"center\"\n | \"above\"\n | \"below\"\n | \"left\"\n | \"right\"\n | \"aboveStart\"\n | \"aboveEnd\"\n | \"belowStart\";\n\n/** Small spec label: mono text on a solid color chip. */\nfunction Pill({\n x,\n y,\n text,\n color,\n delay = 0,\n anchor = \"center\",\n ink = \"#fff\",\n}: {\n x: number;\n y: number;\n text: string;\n color: string;\n delay?: number;\n anchor?: Side;\n ink?: string;\n}) {\n const pop = usePop(delay);\n const shift = {\n center: \"translate(-50%, -50%)\",\n above: \"translate(-50%, calc(-100% - 5px))\",\n below: \"translate(-50%, 5px)\",\n left: \"translate(calc(-100% - 6px), -50%)\",\n right: \"translate(6px, -50%)\",\n aboveStart: \"translate(0, calc(-100% - 5px))\",\n aboveEnd: \"translate(-100%, calc(-100% - 5px))\",\n belowStart: \"translate(0, 5px)\",\n }[anchor];\n return (\n <div\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n transform: `${shift} scale(${0.7 + 0.3 * pop})`,\n opacity: Math.min(1, pop * 1.4),\n background: color,\n color: ink,\n fontFamily: MONO,\n fontSize: 10.5,\n fontWeight: 600,\n lineHeight: \"15px\",\n padding: \"0 5px\",\n borderRadius: 3,\n whiteSpace: \"nowrap\",\n }}\n >\n {text}\n </div>\n );\n}\n\n/**\n * Measurement between two points on one axis: end ticks snap in, the line\n * grows out from its middle, then the value pops on.\n */\nfunction Ruler({\n from,\n to,\n label,\n color,\n delay = 0,\n labelSide,\n}: {\n from: [number, number];\n to: [number, number];\n label: string;\n color: string;\n delay?: number;\n labelSide?: Side;\n}) {\n const frame = useAuditFrame();\n const grow = progress(frame, delay, 12);\n const ticks = progress(frame, delay - 2, 6);\n const horizontal = Math.abs(to[0] - from[0]) >= Math.abs(to[1] - from[1]);\n const mx = (from[0] + to[0]) / 2;\n const my = (from[1] + to[1]) / 2;\n const x1 = mx + (from[0] - mx) * grow;\n const y1 = my + (from[1] - my) * grow;\n const x2 = mx + (to[0] - mx) * grow;\n const y2 = my + (to[1] - my) * grow;\n const t = 4 * ticks;\n const tick = (x: number, y: number) =>\n horizontal ? `M${x} ${y - t}V${y + t}` : `M${x - t} ${y}H${x + t}`;\n return (\n <>\n <Layer>\n <path\n d={`${tick(...from)}${tick(...to)}`}\n stroke={color}\n strokeWidth={1.25}\n fill=\"none\"\n />\n <line\n x1={x1}\n y1={y1}\n x2={x2}\n y2={y2}\n stroke={color}\n strokeWidth={1.25}\n />\n </Layer>\n <Pill\n x={mx}\n y={my}\n text={label}\n color={color}\n delay={delay + 7}\n anchor={labelSide ?? (horizontal ? \"above\" : \"left\")}\n />\n </>\n );\n}\n\n/** Hairline box traced around an element, clockwise from the top left. */\nfunction OutlineBox({\n rect,\n color,\n delay = 0,\n radius = 3,\n inset = -3,\n dashed,\n fill,\n}: {\n rect: Rect;\n color: string;\n delay?: number;\n radius?: number;\n inset?: number;\n dashed?: boolean;\n fill?: string;\n}) {\n const frame = useAuditFrame();\n const draw = progress(frame, delay, 14);\n const x = rect.x + inset;\n const y = rect.y + inset;\n const w = rect.w - inset * 2;\n const h = rect.h - inset * 2;\n return (\n <Layer>\n <rect\n x={x}\n y={y}\n width={w}\n height={h}\n rx={radius}\n fill={fill ?? \"none\"}\n fillOpacity={draw}\n stroke={color}\n strokeWidth={1.25}\n pathLength={1}\n strokeDasharray={dashed ? undefined : `${draw} 1`}\n strokeOpacity={dashed ? draw : 1}\n style={dashed ? { strokeDasharray: \"3 3\" } : undefined}\n />\n </Layer>\n );\n}\n\n/** Quarter arc swept into a corner to call out its radius. */\nfunction CornerArc({\n x,\n y,\n r,\n color,\n label,\n delay = 0,\n}: {\n x: number;\n y: number;\n r: number;\n color: string;\n label: string;\n delay?: number;\n}) {\n const frame = useAuditFrame();\n const draw = progress(frame, delay, 12);\n const size = Math.max(r, 10) + 4;\n return (\n <>\n <Layer>\n <path\n d={`M${x} ${y + size}A${size} ${size} 0 0 1 ${x + size} ${y}`}\n stroke={color}\n strokeWidth={1.5}\n fill=\"none\"\n pathLength={1}\n strokeDasharray={`${draw} 1`}\n strokeLinecap=\"round\"\n />\n </Layer>\n <Pill\n x={x - 2}\n y={y - 2}\n text={label}\n color={color}\n delay={delay + 8}\n anchor=\"aboveStart\"\n />\n </>\n );\n}\n\n/**\n * Design-token tag: a dot lands on the element, a leader line runs out with\n * one elbow, and a dark chip with the token name settles at its end.\n */\nfunction TokenTag({\n anchor,\n at,\n label,\n swatch,\n delay = 0,\n lineColor = \"#0E121B\",\n}: {\n anchor: [number, number];\n at: [number, number];\n label: string;\n swatch: string;\n delay?: number;\n lineColor?: string;\n}) {\n const frame = useAuditFrame();\n const dot = usePop(delay);\n const draw = progress(frame, delay + 3, 14);\n const elbowY = at[1];\n const path = `M${anchor[0]} ${anchor[1]}L${anchor[0] + (at[0] - anchor[0]) * 0.35} ${elbowY}H${at[0]}`;\n return (\n <>\n <Layer>\n <path\n d={path}\n stroke={lineColor}\n strokeOpacity={0.55}\n strokeWidth={1}\n fill=\"none\"\n pathLength={1}\n strokeDasharray={`${draw} 1`}\n />\n <circle\n cx={anchor[0]}\n cy={anchor[1]}\n r={3.5 * dot}\n fill=\"#fff\"\n stroke={lineColor}\n strokeWidth={1.5}\n />\n </Layer>\n <TokenChip\n x={at[0]}\n y={at[1]}\n label={label}\n swatch={swatch}\n delay={delay + 13}\n />\n </>\n );\n}\n\nfunction TokenChip({\n x,\n y,\n label,\n swatch,\n delay = 0,\n}: {\n x: number;\n y: number;\n label: string;\n swatch: string;\n delay?: number;\n}) {\n const pop = usePop(delay);\n return (\n <div\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n transform: `translate(-50%, -50%) translateY(${(1 - pop) * 6}px)`,\n opacity: Math.min(1, pop * 1.4),\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n background: \"#0E121B\",\n color: \"#fff\",\n fontFamily: MONO,\n fontSize: 11,\n lineHeight: \"22px\",\n padding: \"0 8px\",\n borderRadius: 5,\n whiteSpace: \"nowrap\",\n boxShadow: \"0 4px 10px -4px rgba(10,13,20,0.4)\",\n }}\n >\n <span\n style={{\n width: 8,\n height: 8,\n borderRadius: 4,\n background: swatch,\n boxShadow: \"0 0 0 1px rgba(255,255,255,0.35)\",\n }}\n />\n {label}\n </div>\n );\n}\n\n/** Guide line that drops down (vertical) or slides across (horizontal). */\nfunction Guide({\n x,\n y,\n length,\n vertical,\n color,\n delay = 0,\n dashed,\n width = 1,\n}: {\n x: number;\n y: number;\n length: number;\n vertical?: boolean;\n color: string;\n delay?: number;\n dashed?: boolean;\n width?: number;\n}) {\n const frame = useAuditFrame();\n const draw = progress(frame, delay, 16) * length;\n return (\n <Layer>\n <line\n x1={x}\n y1={y}\n x2={vertical ? x : x + draw}\n y2={vertical ? y + draw : y}\n stroke={color}\n strokeWidth={width}\n strokeDasharray={dashed ? \"4 4\" : undefined}\n />\n </Layer>\n );\n}\n\n/**\n * Scan band: a crisp line with a soft wash trailing behind it, the way the\n * fix pass sweeps the screen. `y` is the line's position.\n */\nfunction ScanBand({\n y,\n color,\n x = 0,\n w = 1280,\n trail = 90,\n opacity = 1,\n}: {\n y: number;\n color: string;\n x?: number;\n w?: number;\n trail?: number;\n opacity?: number;\n}) {\n return (\n <div\n style={{ position: \"absolute\", inset: 0, opacity, pointerEvents: \"none\" }}\n >\n <div\n style={{\n position: \"absolute\",\n left: x,\n width: w,\n top: y - trail,\n height: trail,\n background: `linear-gradient(to bottom, transparent, ${color}2E)`,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n left: x,\n width: w,\n top: y - 1,\n height: 2,\n background: color,\n boxShadow: `0 0 12px 1px ${color}`,\n }}\n />\n </div>\n );\n}\n\n/** Stage-colored wash over everything except one rect, to push focus. */\nfunction Spotlight({\n rect,\n opacity,\n color = C.stage,\n}: {\n rect: Rect;\n opacity: number;\n color?: string;\n}) {\n const pad = 10;\n const x = rect.x - pad;\n const y = rect.y - pad;\n const w = rect.w + pad * 2;\n const h = rect.h + pad * 2;\n const r = 12;\n return (\n <svg\n width={1280}\n height={720}\n style={{ position: \"absolute\", inset: 0, opacity }}\n >\n <path\n fillRule=\"evenodd\"\n fill={color}\n fillOpacity={0.72}\n d={`M0 0H1280V720H0Z M${x + r} ${y}H${x + w - r}Q${x + w} ${y} ${x + w} ${y + r}V${y + h - r}Q${x + w} ${y + h} ${x + w - r} ${y + h}H${x + r}Q${x} ${y + h} ${x} ${y + h - r}V${y + r}Q${x} ${y} ${x + r} ${y}Z`}\n />\n </svg>\n );\n}\n\n/** Two full frames split at `y`: `top` shows above the line, `bottom` below. */\nfunction SplitAt({\n y,\n top,\n bottom,\n}: {\n y: number;\n top: ReactNode;\n bottom: ReactNode;\n}) {\n return (\n <>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n clipPath: `inset(${Math.max(0, y)}px 0 0 0)`,\n }}\n >\n {bottom}\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n clipPath: `inset(0 0 ${Math.max(0, 720 - y)}px 0)`,\n }}\n >\n {top}\n </div>\n </>\n );\n}\n\n/** Cubic ease-in-out between keyframes, clamped at both ends. */\nfunction easeInOut(frame: number, input: number[], output: number[]) {\n return interpolate(frame, input, output, {\n ...clamp,\n easing: Easing.inOut(Easing.cubic),\n });\n}\n\n/* Mark data */\n\ntype Point = [number, number];\n\n/** A distance between two points on one axis, with its value. */\ntype Measure = { from: Point; to: Point; label: string; side?: Side };\n/** A corner whose radius gets an arc and a label. `x`, `y` is the corner. */\ntype RadiusMark = { x: number; y: number; r: number; label: string };\n/** An off-spec element and the fix it needs. */\ntype Issue = {\n rect: Rect;\n note: string;\n side?: \"start\" | \"end\" | \"below\";\n};\n/** A token tag: dot on `anchor`, chip centered on `at`. */\ntype TokenSpec = {\n anchor: Point;\n at: Point;\n label: string;\n swatch: string;\n};\n/** Layout guides over a column grid. */\ntype GuideSpec = {\n /** x of every column edge, left to right. */\n columns: number[];\n top: number;\n bottom: number;\n /** One column (or any rect) to fill and label. */\n highlight?: { rect: Rect; label: string };\n /** A measurement drawn with the guides, like a gutter width. */\n ruler?: Measure;\n /** A horizontal marker line across the grid, like a calendar's now line. */\n now?: { y: number; from: number; to: number; label: string };\n};\n\nconst AUDIT_COLORS = {\n audit: C.error,\n fix: C.blue,\n scan: C.primary,\n ink: C.ink,\n stage: C.stage,\n};\n\n/** Spacing and size redlines across the demo header, tabs and first cards. */\nfunction demoMeasures(l: DemoLayout): Measure[] {\n const card = l.cards[0];\n const next = l.cards[1];\n const tabsBottom = l.tabs[0].y + 32;\n const headerBottom = l.header.y + l.header.h;\n const tabGapX = l.tabs[1].x + l.tabs[1].w + 7;\n const right = l.button.x + l.button.w + 8;\n return [\n {\n from: [l.header.x, l.tabs[0].y + 16],\n to: [l.contentX, l.tabs[0].y + 16],\n label: `pad ${l.pad}`,\n side: \"below\",\n },\n {\n from: [tabGapX, headerBottom],\n to: [tabGapX, l.tabs[0].y],\n label: `${l.tabs[0].y - headerBottom}`,\n side: \"right\",\n },\n {\n from: [next.rect.x + 150, tabsBottom],\n to: [next.rect.x + 150, next.rect.y],\n label: `${next.rect.y - tabsBottom}`,\n side: \"right\",\n },\n {\n from: [card.rect.x + card.rect.w, card.rect.y + 46],\n to: [next.rect.x, card.rect.y + 46],\n label: `gap ${l.gap}`,\n },\n {\n from: [card.rect.x, card.title.y + 9],\n to: [card.title.x, card.title.y + 9],\n label: `${l.cardPad}`,\n side: \"left\",\n },\n {\n from: [card.title.x + 96, card.rect.y],\n to: [card.title.x + 96, card.title.y],\n label: `${l.cardPad}`,\n side: \"right\",\n },\n {\n from: [right, l.button.y],\n to: [right, l.button.y + l.button.h],\n label: `h ${l.button.h}`,\n side: \"below\",\n },\n ];\n}\n\nfunction demoRadii(l: DemoLayout): RadiusMark[] {\n const next = l.cards[1].rect;\n return [{ x: next.x, y: next.y, r: l.radius, label: `radius ${l.radius}` }];\n}\n\nfunction demoIssues(l: DemoLayout): Issue[] {\n return [\n { rect: l.cards[0].title, note: \"13.5 → 14\", side: \"start\" },\n { rect: l.cards[0].status, note: \"radius 4 → 6\", side: \"below\" },\n { rect: l.cards[0].chevron, note: \"hit 20 → 24\", side: \"end\" },\n { rect: l.button, note: \"#8B5CF6 ≠ primary\", side: \"end\" },\n { rect: l.sideActive, note: \"radius 5 → 8\", side: \"start\" },\n { rect: l.events[2].rect, note: \"radius 4 → 8\", side: \"start\" },\n { rect: l.events[6].rect, note: \"pad 6 → 8\", side: \"start\" },\n ];\n}\n\nfunction demoTokens(l: DemoLayout): TokenSpec[] {\n const [c0, c1, c2, c3] = l.cards;\n const chipY = l.calendar.y + 70;\n return [\n {\n anchor: [c0.status.x + 12, c0.status.y + 13],\n at: [c0.rect.x + 50, chipY + 50],\n label: \"state/success/lighter\",\n swatch: C.successBg,\n },\n {\n anchor: [c0.title.x + 40, c0.title.y + 9],\n at: [c0.rect.x + 170, chipY],\n label: \"text/strong-950\",\n swatch: C.ink,\n },\n {\n anchor: [c1.status.x + 12, c1.status.y + 13],\n at: [c1.rect.x + 110, chipY + 92],\n label: \"state/warning/base\",\n swatch: C.warning,\n },\n {\n anchor: [c2.status.x + 12, c2.status.y + 13],\n at: [c2.rect.x + 90, chipY + 20],\n label: \"state/error/base\",\n swatch: C.error,\n },\n {\n anchor: [c3.rect.x + c3.rect.w, c3.rect.y + 40],\n at: [c3.rect.x + 90, chipY + 70],\n label: \"stroke/soft-200\",\n swatch: C.stroke,\n },\n ];\n}\n\nfunction demoGuides(l: DemoLayout): GuideSpec {\n const cal = l.calendar;\n const today = l.columns[0];\n return {\n columns: [...l.columns.map((col) => col.x), cal.x + cal.w],\n top: cal.y,\n bottom: cal.y + cal.h,\n highlight: { rect: today, label: \"Mon 2 · today\" },\n ruler: {\n from: [cal.x, cal.y + l.dayHeaderH + 14],\n to: [cal.x + l.gutter, cal.y + l.dayHeaderH + 14],\n label: `w ${l.gutter}`,\n side: \"below\",\n },\n now: {\n y: cal.y + l.dayHeaderH + 1.25 * l.hourH,\n from: cal.x + l.gutter,\n to: cal.x + cal.w,\n label: \"10:15 AM\",\n },\n };\n}\n\n/** Close-up spec of the first card, sized for a zoomed camera. */\nfunction demoFocus(l: DemoLayout) {\n const card = l.cards[0];\n const r = card.rect;\n const below = r.y + r.h + 34;\n return {\n rect: r,\n measures: [\n {\n from: [r.x, card.title.y + 9],\n to: [card.title.x, card.title.y + 9],\n label: `${l.cardPad}`,\n side: \"below\",\n },\n {\n from: [card.title.x + 110, r.y],\n to: [card.title.x + 110, card.title.y],\n label: `${l.cardPad}`,\n side: \"right\",\n },\n {\n from: [r.x + r.w + 8, card.status.y],\n to: [r.x + r.w + 8, card.status.y + card.status.h],\n label: `h ${card.status.h}`,\n side: \"right\",\n },\n {\n from: [card.chevron.x - 2, card.chevron.y - 6],\n to: [card.chevron.x + card.chevron.w + 2, card.chevron.y - 6],\n label: \"24\",\n },\n ] as Measure[],\n radii: [{ x: r.x, y: r.y, r: l.radius, label: `radius ${l.radius}` }],\n tokens: [\n {\n anchor: [card.status.x + 12, card.status.y + 13],\n at: [r.x + 40, below],\n label: \"state/success/base\",\n swatch: C.success,\n },\n {\n anchor: [card.title.x + 60, card.title.y + 9],\n at: [r.x + 205, below - 4],\n label: \"text/strong-950\",\n swatch: C.ink,\n },\n {\n anchor: [card.time.x + 40, card.time.y + 8],\n at: [r.x + 70, below + 30],\n label: \"text/sub-600\",\n swatch: C.sub,\n },\n {\n anchor: [r.x + r.w, r.y + 30],\n at: [r.x + 230, below + 30],\n label: \"stroke/soft-200\",\n swatch: C.stroke,\n },\n ] as TokenSpec[],\n };\n}\n\nfunction demoSet(v: Version) {\n const l = demoLayout(v);\n return {\n layout: l,\n measures: demoMeasures(l),\n radii: demoRadii(l),\n issues: demoIssues(l),\n tokens: demoTokens(l),\n guides: demoGuides(l),\n focus: demoFocus(l),\n /** Rect around the tabs and the card row. */\n cardRow: {\n x: l.contentX,\n y: l.tabs[0].y,\n w: l.calendar.w,\n h: l.cards[0].rect.y + 92 - l.tabs[0].y,\n } satisfies Rect,\n };\n}\n\n/** Mark data measured off the demo dashboard: `before` is v1, `after` v2. */\nconst DEMO = { before: demoSet(1), after: demoSet(2) };\nconst DEMO_WINDOW = WIN;\n\n/* Mark sets */\n\n/** Rulers then radius arcs, each `stagger` frames after the last. */\nfunction MeasureMarks({\n measures,\n radii = [],\n color,\n start = 0,\n stagger = 5,\n}: {\n measures: Measure[];\n radii?: RadiusMark[];\n color: string;\n start?: number;\n stagger?: number;\n}) {\n return (\n <>\n {measures.map((m, i) => (\n <Ruler\n key={`${m.from.join()}-${m.to.join()}`}\n from={m.from}\n to={m.to}\n label={m.label}\n color={color}\n delay={start + i * stagger}\n labelSide={m.side}\n />\n ))}\n {radii.map((r, i) => (\n <CornerArc\n key={`${r.x}-${r.y}`}\n x={r.x}\n y={r.y}\n r={r.r}\n label={r.label}\n color={color}\n delay={start + (measures.length + i) * stagger}\n />\n ))}\n </>\n );\n}\n\nconst NOTE_SPOT = {\n start: (r: Rect) => ({\n x: r.x - 3,\n y: r.y - 3,\n anchor: \"aboveStart\" as const,\n }),\n end: (r: Rect) => ({\n x: r.x + r.w + 3,\n y: r.y - 3,\n anchor: \"aboveEnd\" as const,\n }),\n below: (r: Rect) => ({\n x: r.x - 3,\n y: r.y + r.h + 3,\n anchor: \"belowStart\" as const,\n }),\n};\n\n/** Every issue boxed, with its note popping on once the box closes. */\nfunction IssueMarks({\n issues,\n color,\n start = 0,\n stagger = 4,\n}: {\n issues: Issue[];\n color: string;\n start?: number;\n stagger?: number;\n}) {\n return (\n <>\n {issues.map((issue, i) => (\n <div key={`${issue.rect.x}-${issue.rect.y}-${issue.note}`}>\n <OutlineBox\n rect={issue.rect}\n color={color}\n delay={start + i * stagger}\n />\n <Pill\n {...NOTE_SPOT[issue.side ?? \"start\"](issue.rect)}\n text={issue.note}\n color={color}\n delay={start + i * stagger + 10}\n />\n </div>\n ))}\n </>\n );\n}\n\nfunction TokenMarks({\n tokens,\n start = 0,\n stagger = 6,\n lineColor,\n}: {\n tokens: TokenSpec[];\n start?: number;\n stagger?: number;\n lineColor?: string;\n}) {\n return (\n <>\n {tokens.map((tag, i) => (\n <TokenTag\n key={`${tag.label}-${tag.anchor.join()}`}\n anchor={tag.anchor}\n at={tag.at}\n label={tag.label}\n swatch={tag.swatch}\n lineColor={lineColor}\n delay={start + i * stagger}\n />\n ))}\n </>\n );\n}\n\n/** Column guides drop in, the highlight fills, then the now line slides across. */\nfunction GuideMarks({\n guides,\n color,\n nowColor = C.primary,\n start = 0,\n}: {\n guides: GuideSpec;\n color: string;\n nowColor?: string;\n start?: number;\n}) {\n const { columns, top, bottom, highlight, ruler, now } = guides;\n const h = highlight?.rect;\n return (\n <>\n {columns.map((x, i) => (\n <Guide\n key={x}\n x={x}\n y={top}\n length={bottom - top}\n vertical\n color={color}\n dashed\n delay={start + i * 3}\n />\n ))}\n {h && highlight && (\n <>\n <OutlineBox\n rect={h}\n color={color}\n fill={`${color}14`}\n inset={0}\n radius={0}\n delay={start + 14}\n />\n <OutlineBox\n rect={{ x: h.x + 6, y: h.y + 4, w: h.w - 12, h: 22 }}\n color={color}\n radius={4}\n inset={0}\n delay={start + 20}\n />\n <Pill\n x={h.x + h.w / 2}\n y={h.y + 4}\n text={highlight.label}\n color={color}\n delay={start + 26}\n anchor=\"above\"\n />\n </>\n )}\n {ruler && (\n <Ruler\n from={ruler.from}\n to={ruler.to}\n label={ruler.label}\n color={color}\n delay={start + 24}\n labelSide={ruler.side}\n />\n )}\n {now && (\n <>\n <Guide\n x={now.from}\n y={now.y}\n length={now.to - now.from}\n color={nowColor}\n width={1.5}\n delay={start + 30}\n />\n <Pill\n x={now.from}\n y={now.y}\n text={now.label}\n color={nowColor}\n delay={start + 30}\n anchor=\"left\"\n />\n </>\n )}\n </>\n );\n}\n\n/** Brand name with a version chip that flips once the fix lands. */\nfunction VersionChip({\n brand,\n versions,\n fixed,\n colors,\n}: {\n brand: string;\n versions: [string, string];\n fixed: boolean;\n colors: [string, string];\n}) {\n return (\n <div\n style={{\n position: \"absolute\",\n left: WIN.x,\n top: 26,\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n fontSize: 15,\n fontWeight: 600,\n color: C.ink,\n }}\n >\n {brand}\n <span\n style={{\n fontFamily: MONO,\n fontSize: 11,\n color: \"#fff\",\n background: fixed ? colors[1] : colors[0],\n borderRadius: 999,\n padding: \"1px 8px\",\n }}\n >\n {fixed ? versions[1] : versions[0]}\n </span>\n </div>\n );\n}\n\ntype AuditBoxesProps = {\n /** UI to audit, laid out in a 1280x720 frame. Defaults to a demo calendar dashboard. */\n children?: ReactNode;\n /** Off-spec elements, in frame pixels, with the fix each one needs. */\n issues?: Issue[];\n color?: string;\n background?: string;\n /** Word after the running count. Empty hides the counter. */\n counterLabel?: string;\n /** Frames between one box and the next. */\n stagger?: number;\n speed?: number;\n};\n\nconst auditBoxesDefaults = {\n color: AUDIT_COLORS.audit,\n background: AUDIT_COLORS.stage,\n counterLabel: \"issues\",\n stagger: 4,\n speed: 1,\n};\n\nconst auditBoxesLength = 56;\n\nconst START = 10;\n\nfunction AuditBoxesBase(props: AuditBoxesProps) {\n const { speed = 1 } = props;\n return (\n <AuditClock speed={speed}>\n <Scene {...props} />\n </AuditClock>\n );\n}\n\nfunction Scene({\n children,\n issues = children ? [] : DEMO.before.issues,\n color = auditBoxesDefaults.color,\n background = auditBoxesDefaults.background,\n counterLabel = auditBoxesDefaults.counterLabel,\n stagger = auditBoxesDefaults.stagger,\n}: AuditBoxesProps) {\n return (\n <AbsoluteFill style={{ background, fontFamily: FONT }}>\n {children ?? <DemoDashboard v={1} />}\n <IssueMarks\n issues={issues}\n color={color}\n start={START}\n stagger={stagger}\n />\n {counterLabel && (\n <Counter\n total={issues.length}\n stagger={stagger}\n color={color}\n label={counterLabel}\n />\n )}\n </AbsoluteFill>\n );\n}\n\n/** Count chip above the frame's top right that ticks up with every box. */\nfunction Counter({\n total,\n stagger,\n color,\n label,\n}: {\n total: number;\n stagger: number;\n color: string;\n label: string;\n}) {\n const frame = useAuditFrame();\n const count = Math.min(\n total,\n Math.max(0, Math.floor((frame - START) / stagger) + 1),\n );\n const show = progress(frame, START - 6, 10);\n return (\n <div\n style={{\n position: \"absolute\",\n right: 1280 - DEMO_WINDOW.x - DEMO_WINDOW.w,\n top: 24,\n opacity: show,\n transform: `translateY(${(1 - show) * -6}px)`,\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n fontFamily: MONO,\n fontSize: 12,\n color: AUDIT_COLORS.ink,\n }}\n >\n <span\n style={{\n background: color,\n color: \"#fff\",\n borderRadius: 4,\n padding: \"2px 7px\",\n fontWeight: 600,\n fontVariantNumeric: \"tabular-nums\",\n }}\n >\n {count}\n </span>\n {label}\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n color: {\n type: \"color\",\n default: \"#FB3748\",\n description: \"Marks\",\n },\n background: {\n type: \"color\",\n default: \"#EDEDEF\",\n description: \"Background\",\n },\n counterLabel: {\n type: \"text-content\",\n default: \"issues\",\n description: \"Counter label\",\n },\n stagger: {\n type: \"number\",\n min: 1,\n max: 12,\n step: 1,\n default: 4,\n description: \"Stagger\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"color\",\"background\",\"counterLabel\",\"stagger\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n color: \"#FB3748\",\n background: \"#EDEDEF\",\n counterLabel: \"issues\",\n stagger: 4,\n speed: 1,\n};\n\ntype AuditBoxesElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof AuditBoxesBase>;\n\nconst AuditBoxesInner = forwardRef<\n HTMLDivElement,\n AuditBoxesElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<AuditBoxes>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <AuditBoxesBase\n {...(componentProps as unknown as ComponentProps<typeof AuditBoxesBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const AuditBoxes = Interactive.withSchema({\n Component: AuditBoxesInner,\n componentName: \"<AuditBoxes>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 56+}diff --git a/registry-artifacts/elements/design-audit.json b/registry-artifacts/elements/design-audit.jsonnew file mode 100644index 00000000..5eb7bcd9--- /dev/null+++ b/registry-artifacts/elements/design-audit.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Design Audit",+ "durationInFrames": 332,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "design-audit",+ "sourceCode": "import { createContext, forwardRef, useContext, useImperativeHandle, useRef, type CSSProperties, type ComponentProps, type ReactNode } from \"react\";\nimport { AbsoluteFill, Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\n/**\n * Shared kit behind the design-review family (redline-measure, audit-boxes,\n * scan-fix, token-tags, layout-guides, design-audit): the annotation marks a\n * design review paints over a UI, the scan band that sweeps a fix across it,\n * and a demo calendar dashboard the marks are measured against by default.\n *\n * Every coordinate is in composition pixels of a 1280x720 frame.\n */\n\nconst AuditSpeed = createContext(1);\n\n/** Scales the clock every mark below it reads. */\nfunction AuditClock({\n speed,\n children,\n}: {\n speed: number;\n children: ReactNode;\n}) {\n return <AuditSpeed.Provider value={speed}>{children}</AuditSpeed.Provider>;\n}\n\nfunction useAuditFrame() {\n return useCurrentFrame() * useContext(AuditSpeed);\n}\n\n/* Demo dashboard */\n/**\n * A calendar dashboard drawn from one layout function, so every annotation\n * can measure the exact rects the UI paints. Version 1 is the \"before\"\n * build with drifted spacing and radii, version 2 is the fixed one.\n */\n\ntype Rect = { x: number; y: number; w: number; h: number };\ntype Version = 1 | 2;\n\nconst FONT =\n \"Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\";\nconst MONO = \"ui-monospace, 'SF Mono', Menlo, Consolas, monospace\";\n\nconst C = {\n stage: \"#EDEDEF\",\n window: \"#FFFFFF\",\n ink: \"#0E121B\",\n sub: \"#525866\",\n soft: \"#99A0AE\",\n stroke: \"#E1E4EA\",\n weak: \"#F5F7FA\",\n primary: \"#7D52F4\",\n success: \"#1FC16B\",\n successBg: \"#E0FAEC\",\n warning: \"#FA7319\",\n warningBg: \"#FFF1EB\",\n error: \"#FB3748\",\n errorBg: \"#FFEBEC\",\n blue: \"#335CFF\",\n blueBg: \"#EBF1FF\",\n orangeBg: \"#FFF3EB\",\n purpleBg: \"#EFEBFF\",\n};\n\nconst WIN: Rect = { x: 80, y: 64, w: 1120, h: 616 };\nconst SIDE_W = 216;\nconst HEADER_H = 56;\nconst MAIN_X = WIN.x + SIDE_W;\nconst MAIN_R = WIN.x + WIN.w;\n\nconst CARDS = [\n {\n title: \"Weekly team meeting\",\n time: \"3:00 – 4:30 PM\",\n status: \"Today\",\n action: \"Join meeting\",\n dot: C.success,\n bg: C.successBg,\n },\n {\n title: \"Product launch event\",\n time: \"11:00 AM – 12:30 PM\",\n status: \"2 conflicts\",\n action: \"Review\",\n dot: C.warning,\n bg: C.warningBg,\n },\n {\n title: \"Team building workshop\",\n time: \"10:00 AM – 1:00 PM\",\n status: \"Canceled\",\n action: \"Fri, Nov 6\",\n dot: C.error,\n bg: C.errorBg,\n },\n {\n title: \"Marketing campaign\",\n time: \"2:30 – 4:00 PM\",\n status: \"In 3 days\",\n action: \"Thu, Nov 5\",\n dot: C.soft,\n bg: C.weak,\n },\n];\n\nconst TABS = [\n { label: \"All scheduled\", count: \"15\" },\n { label: \"Meetings\", count: \"12\" },\n { label: \"Events\", count: \"3\" },\n { label: \"Conflicted\", count: \"2\" },\n { label: \"Canceled\", count: \"1\" },\n];\n\nconst DAYS = [\"Mon 2\", \"Tue 3\", \"Wed 4\", \"Thu 5\", \"Fri 6\"];\nconst HOURS = [\"9 AM\", \"10 AM\", \"11 AM\", \"12 PM\", \"1 PM\"];\n\nconst EVENTS = [\n { day: 0, from: 0, to: 0.5, title: \"Brainstorming session\", tone: \"gray\" },\n { day: 0, from: 0.55, to: 1.05, title: \"Bi-weekly sync\", tone: \"gray\" },\n { day: 1, from: 0, to: 0.45, title: \"Project review\", tone: \"blue\" },\n { day: 1, from: 1.05, to: 2.6, title: \"Sales team training\", tone: \"blue\" },\n { day: 2, from: 0.5, to: 1.0, title: \"Marketing strategy\", tone: \"blue\" },\n { day: 2, from: 2.6, to: 3.6, title: \"Interview: frontend\", tone: \"purple\" },\n { day: 3, from: 0, to: 1.0, title: \"Customer feedback\", tone: \"blue\" },\n { day: 3, from: 2.2, to: 3.4, title: \"Product launch\", tone: \"orange\" },\n { day: 0, from: 2.5, to: 3.7, title: \"Workshop: design\", tone: \"orange\" },\n { day: 4, from: 1.1, to: 3.7, title: \"Team building\", tone: \"gray\" },\n] as const;\n\nconst TONES = {\n gray: { bg: C.weak, ink: C.sub },\n blue: { bg: C.blueBg, ink: \"#2547D0\" },\n purple: { bg: C.purpleBg, ink: \"#5B3CC4\" },\n orange: { bg: C.orangeBg, ink: \"#C2540A\" },\n};\n\n/** Every rect the dashboard paints, in composition pixels. */\nfunction demoLayout(v: Version) {\n const pad = v === 2 ? 24 : 20;\n const gap = v === 2 ? 16 : 10;\n const cardPad = v === 2 ? 16 : 12;\n const radius = v === 2 ? 12 : 6;\n const contentX = MAIN_X + pad;\n const contentW = MAIN_R - pad - contentX;\n\n const header: Rect = { x: MAIN_X, y: WIN.y, w: MAIN_R - MAIN_X, h: HEADER_H };\n const button: Rect = {\n x: MAIN_R - pad - 128,\n y: WIN.y + 12,\n w: 128,\n h: v === 2 ? 32 : 34,\n };\n const tabsY = WIN.y + HEADER_H + (v === 2 ? 16 : 12);\n let tabX = contentX;\n const tabs = TABS.map((tab, i) => {\n const w = 46 + tab.label.length * 7.4 + (i === 0 ? 26 : 0);\n const rect: Rect = { x: tabX, y: tabsY, w, h: 32 };\n tabX += w + 14;\n return rect;\n });\n\n const cardsY = tabsY + 32 + (v === 2 ? 16 : 12);\n const cardW = (contentW - gap * 3) / 4;\n const cards = CARDS.map((_, i) => {\n const rect: Rect = {\n x: contentX + i * (cardW + gap),\n y: cardsY,\n w: cardW,\n h: 92,\n };\n return {\n rect,\n title: { x: rect.x + cardPad, y: rect.y + cardPad, w: 150, h: 18 },\n time: { x: rect.x + cardPad, y: rect.y + cardPad + 21, w: 110, h: 15 },\n status: {\n x: rect.x + cardPad - 4,\n y: rect.y + rect.h - cardPad - 24,\n w: rect.w - cardPad * 2 + 8,\n h: 26,\n },\n chevron: {\n x: rect.x + rect.w - cardPad - 20,\n y: rect.y + cardPad - 2,\n w: 20,\n h: 20,\n },\n };\n });\n\n const calY = cardsY + 92 + 22;\n const calendar: Rect = {\n x: contentX,\n y: calY,\n w: contentW,\n h: WIN.y + WIN.h - calY - 16,\n };\n const gutter = 56;\n const colW = (contentW - gutter) / DAYS.length;\n const dayHeaderH = 30;\n const hourH = (calendar.h - dayHeaderH) / 4;\n const columns = DAYS.map(\n (_, i): Rect => ({\n x: contentX + gutter + i * colW,\n y: calY,\n w: colW,\n h: calendar.h,\n }),\n );\n const events = EVENTS.map((event) => ({\n ...event,\n rect: {\n x: columns[event.day].x + 4,\n y: calY + dayHeaderH + event.from * hourH + 3,\n w: colW - 8,\n h: (event.to - event.from) * hourH - 6,\n } satisfies Rect,\n }));\n\n return {\n v,\n pad,\n gap,\n cardPad,\n radius,\n contentX,\n header,\n button,\n tabs,\n cards,\n calendar,\n columns,\n gutter,\n dayHeaderH,\n hourH,\n events,\n sidebar: { x: WIN.x, y: WIN.y, w: SIDE_W, h: WIN.h } satisfies Rect,\n sideActive: { x: WIN.x + 10, y: WIN.y + 158, w: SIDE_W - 20, h: 30 },\n };\n}\n\ntype DemoLayout = ReturnType<typeof demoLayout>;\n\nconst abs = (r: Rect): CSSProperties => ({\n position: \"absolute\",\n left: r.x,\n top: r.y,\n width: r.w,\n height: r.h,\n});\n\nfunction Glyph({\n size = 14,\n color = C.soft,\n}: {\n size?: number;\n color?: string;\n}) {\n return (\n <div\n style={{\n width: size,\n height: size,\n borderRadius: 4,\n border: `1.5px solid ${color}`,\n flexShrink: 0,\n }}\n />\n );\n}\n\nconst SIDE_ITEMS: (string | { section: string })[] = [\n \"Inbox\",\n \"Dashboard\",\n { section: \"Workspace\" },\n \"Calendar\",\n \"Time off\",\n \"People\",\n \"Payroll\",\n \"Projects\",\n \"Documents\",\n { section: \"Favorites\" },\n \"Loom Mobile App\",\n \"Monday Re-design\",\n \"Udemy Courses\",\n];\n\nfunction Sidebar({ l }: { l: DemoLayout }) {\n let y = WIN.y + 68;\n return (\n <>\n <div\n style={{\n ...abs({ x: WIN.x, y: WIN.y, w: SIDE_W, h: WIN.h }),\n borderRight: `1px solid ${C.stroke}`,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n left: WIN.x + 18,\n top: WIN.y + 18,\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n fontSize: 14,\n fontWeight: 600,\n color: C.ink,\n }}\n >\n <div\n style={{\n width: 22,\n height: 22,\n borderRadius: 11,\n background: C.primary,\n }}\n />\n Synergy\n </div>\n {SIDE_ITEMS.map((item) => {\n const top = y;\n if (typeof item !== \"string\") {\n y += 30;\n return (\n <div\n key={item.section}\n style={{\n position: \"absolute\",\n left: WIN.x + 20,\n top: top + 10,\n fontSize: 11,\n letterSpacing: \"0.04em\",\n textTransform: \"uppercase\",\n color: C.soft,\n }}\n >\n {item.section}\n </div>\n );\n }\n y += 30;\n const active = item === \"Calendar\";\n return (\n <div\n key={item}\n style={{\n ...abs(\n active\n ? l.sideActive\n : { x: WIN.x + 10, y: top, w: SIDE_W - 20, h: 30 },\n ),\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n paddingLeft: 10,\n borderRadius: l.v === 2 ? 8 : 5,\n background: active ? C.weak : undefined,\n fontSize: 13,\n fontWeight: active ? 500 : 400,\n color: active ? C.ink : C.sub,\n }}\n >\n <Glyph color={active ? C.primary : C.soft} />\n {item}\n </div>\n );\n })}\n <div\n style={{\n position: \"absolute\",\n left: WIN.x + 18,\n top: WIN.y + WIN.h - 44,\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n fontSize: 13,\n color: C.ink,\n }}\n >\n <div\n style={{\n width: 26,\n height: 26,\n borderRadius: 13,\n background: \"linear-gradient(135deg,#FBC5A6,#F17B6A)\",\n }}\n />\n Olivia Hart\n </div>\n </>\n );\n}\n\nfunction Header({ l }: { l: DemoLayout }) {\n return (\n <>\n <div\n style={{\n ...abs(l.header),\n borderBottom: `1px solid ${C.stroke}`,\n display: \"flex\",\n alignItems: \"center\",\n gap: 12,\n paddingLeft: l.pad,\n fontSize: 14,\n }}\n >\n <Glyph size={16} color={C.sub} />\n <span style={{ fontWeight: 600, color: C.ink }}>\n Monday, November 2\n </span>\n <span style={{ color: C.soft }}>\n You have 3 meetings and 1 event today.\n </span>\n </div>\n <div\n style={{\n ...abs({ x: l.button.x - 104, y: l.button.y, w: 92, h: l.button.h }),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: 6,\n borderRadius: l.v === 2 ? 8 : 6,\n border: `1px solid ${C.stroke}`,\n fontSize: 13,\n color: C.sub,\n }}\n >\n Schedule\n </div>\n <div\n style={{\n ...abs(l.button),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: l.v === 2 ? 8 : 6,\n background: l.v === 2 ? C.primary : \"#8B5CF6\",\n color: \"#fff\",\n fontSize: 13,\n fontWeight: 500,\n }}\n >\n + Create event\n </div>\n </>\n );\n}\n\nfunction Tabs({ l }: { l: DemoLayout }) {\n return (\n <>\n {TABS.map((tab, i) => (\n <div\n key={tab.label}\n style={{\n ...abs(l.tabs[i]),\n display: \"flex\",\n alignItems: \"center\",\n gap: 7,\n fontSize: 13,\n fontWeight: i === 0 ? 500 : 400,\n color: i === 0 ? C.ink : C.sub,\n borderBottom: i === 0 ? `2px solid ${C.primary}` : undefined,\n }}\n >\n <Glyph color={i === 0 ? C.primary : C.soft} />\n {tab.label}\n <span\n style={{\n fontSize: 11,\n fontWeight: 500,\n color: i === 0 ? \"#fff\" : C.soft,\n background:\n i === 0 ? (l.v === 2 ? C.primary : \"#8B5CF6\") : undefined,\n borderRadius: 8,\n padding: i === 0 ? \"1px 6px\" : 0,\n }}\n >\n {tab.count}\n </span>\n </div>\n ))}\n <div\n style={{\n position: \"absolute\",\n left: l.contentX,\n top: l.tabs[0].y + 32,\n width: WIN.x + WIN.w - l.pad - l.contentX,\n height: 1,\n background: C.stroke,\n }}\n />\n </>\n );\n}\n\nfunction Cards({ l }: { l: DemoLayout }) {\n return (\n <>\n {CARDS.map((card, i) => {\n const r = l.cards[i];\n return (\n <div key={card.title}>\n <div\n style={{\n ...abs(r.rect),\n borderRadius: l.radius,\n border: `1px solid ${C.stroke}`,\n background: \"#fff\",\n boxShadow: \"0 1px 2px rgba(10,13,20,0.04)\",\n }}\n />\n <div\n style={{\n ...abs(r.title),\n width: r.rect.w - l.cardPad * 2 - 24,\n fontSize: l.v === 2 ? 14 : 13.5,\n fontWeight: 600,\n color: C.ink,\n whiteSpace: \"nowrap\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n }}\n >\n {card.title}\n </div>\n <div\n style={{ ...abs(r.time), width: 160, fontSize: 12, color: C.sub }}\n >\n {card.time}\n </div>\n <div\n style={{\n ...abs(r.chevron),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: C.soft,\n fontSize: 11,\n }}\n >\n ⌄\n </div>\n <div\n style={{\n ...abs(r.status),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n padding: \"0 8px\",\n borderRadius: l.v === 2 ? 6 : 4,\n background: card.bg,\n fontSize: 12,\n }}\n >\n <span\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n color: C.ink,\n }}\n >\n <span\n style={{\n width: 8,\n height: 8,\n borderRadius: 4,\n background: card.dot,\n }}\n />\n {card.status}\n </span>\n <span\n style={{\n color: C.sub,\n textDecoration: i === 0 ? \"underline\" : undefined,\n }}\n >\n {card.action}\n </span>\n </div>\n </div>\n );\n })}\n </>\n );\n}\n\nfunction Calendar({ l }: { l: DemoLayout }) {\n const { calendar: cal, columns, dayHeaderH, hourH } = l;\n return (\n <>\n {DAYS.map((day, i) => (\n <div\n key={day}\n style={{\n ...abs({\n x: columns[i].x,\n y: cal.y,\n w: columns[i].w,\n h: dayHeaderH,\n }),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontSize: 12,\n fontWeight: i === 0 ? 600 : 400,\n color: i === 0 ? C.ink : C.soft,\n borderLeft: `1px solid ${C.stroke}`,\n borderBottom: `1px solid ${C.stroke}`,\n }}\n >\n {day}\n </div>\n ))}\n {HOURS.slice(0, 4).map((hour, i) => (\n <div\n key={hour}\n style={{\n position: \"absolute\",\n left: cal.x,\n top: cal.y + dayHeaderH + i * hourH - 2,\n width: l.gutter - 10,\n textAlign: \"right\",\n fontSize: 11,\n color: C.soft,\n }}\n >\n {hour}\n </div>\n ))}\n {columns.map((col) => (\n <div\n key={col.x}\n style={{\n position: \"absolute\",\n left: col.x,\n top: cal.y + dayHeaderH,\n width: 1,\n height: cal.h - dayHeaderH,\n background: C.stroke,\n }}\n />\n ))}\n {l.events.map((event) => {\n const tone = TONES[event.tone];\n return (\n <div\n key={`${event.day}-${event.from}`}\n style={{\n ...abs(event.rect),\n borderRadius: l.v === 2 ? 8 : 4,\n background: tone.bg,\n padding: \"6px 8px\",\n fontSize: 11.5,\n fontWeight: 500,\n color: tone.ink,\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n textOverflow: \"ellipsis\",\n }}\n >\n {event.title}\n </div>\n );\n })}\n </>\n );\n}\n\n/** The whole dashboard window, positioned in a 1280x720 frame. */\nfunction DemoDashboard({ v }: { v: Version }) {\n const l = demoLayout(v);\n return (\n <div style={{ position: \"absolute\", inset: 0, fontFamily: FONT }}>\n <div\n style={{\n ...abs(WIN),\n background: C.window,\n borderRadius: 16,\n boxShadow:\n \"0 0 0 1px rgba(10,13,20,0.04), 0 16px 40px -12px rgba(10,13,20,0.12)\",\n }}\n />\n <div\n style={{\n ...abs(WIN),\n borderRadius: 16,\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: -WIN.x,\n top: -WIN.y,\n width: 1280,\n height: 720,\n }}\n >\n <Sidebar l={l} />\n <Header l={l} />\n <Tabs l={l} />\n <Cards l={l} />\n <Calendar l={l} />\n </div>\n </div>\n </div>\n );\n}\n\n/* Marks */\n\n/**\n * Annotation primitives: the redline marks a design review paints over a UI.\n * Each takes a `delay` in frames and draws itself in from there.\n */\n\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nfunction progress(frame: number, start: number, duration: number) {\n return interpolate(frame, [start, start + duration], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n}\n\n/** Pop-in for labels and chips: a cubic ease-out, no overshoot. */\nfunction usePop(delay: number) {\n return progress(useAuditFrame(), delay, 12);\n}\n\nfunction Layer({ children }: { children: ReactNode }) {\n return (\n <svg\n width={1280}\n height={720}\n viewBox=\"0 0 1280 720\"\n style={{ position: \"absolute\", inset: 0, overflow: \"visible\" }}\n >\n {children}\n </svg>\n );\n}\n\ntype Side =\n | \"center\"\n | \"above\"\n | \"below\"\n | \"left\"\n | \"right\"\n | \"aboveStart\"\n | \"aboveEnd\"\n | \"belowStart\";\n\n/** Small spec label: mono text on a solid color chip. */\nfunction Pill({\n x,\n y,\n text,\n color,\n delay = 0,\n anchor = \"center\",\n ink = \"#fff\",\n}: {\n x: number;\n y: number;\n text: string;\n color: string;\n delay?: number;\n anchor?: Side;\n ink?: string;\n}) {\n const pop = usePop(delay);\n const shift = {\n center: \"translate(-50%, -50%)\",\n above: \"translate(-50%, calc(-100% - 5px))\",\n below: \"translate(-50%, 5px)\",\n left: \"translate(calc(-100% - 6px), -50%)\",\n right: \"translate(6px, -50%)\",\n aboveStart: \"translate(0, calc(-100% - 5px))\",\n aboveEnd: \"translate(-100%, calc(-100% - 5px))\",\n belowStart: \"translate(0, 5px)\",\n }[anchor];\n return (\n <div\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n transform: `${shift} scale(${0.7 + 0.3 * pop})`,\n opacity: Math.min(1, pop * 1.4),\n background: color,\n color: ink,\n fontFamily: MONO,\n fontSize: 10.5,\n fontWeight: 600,\n lineHeight: \"15px\",\n padding: \"0 5px\",\n borderRadius: 3,\n whiteSpace: \"nowrap\",\n }}\n >\n {text}\n </div>\n );\n}\n\n/**\n * Measurement between two points on one axis: end ticks snap in, the line\n * grows out from its middle, then the value pops on.\n */\nfunction Ruler({\n from,\n to,\n label,\n color,\n delay = 0,\n labelSide,\n}: {\n from: [number, number];\n to: [number, number];\n label: string;\n color: string;\n delay?: number;\n labelSide?: Side;\n}) {\n const frame = useAuditFrame();\n const grow = progress(frame, delay, 12);\n const ticks = progress(frame, delay - 2, 6);\n const horizontal = Math.abs(to[0] - from[0]) >= Math.abs(to[1] - from[1]);\n const mx = (from[0] + to[0]) / 2;\n const my = (from[1] + to[1]) / 2;\n const x1 = mx + (from[0] - mx) * grow;\n const y1 = my + (from[1] - my) * grow;\n const x2 = mx + (to[0] - mx) * grow;\n const y2 = my + (to[1] - my) * grow;\n const t = 4 * ticks;\n const tick = (x: number, y: number) =>\n horizontal ? `M${x} ${y - t}V${y + t}` : `M${x - t} ${y}H${x + t}`;\n return (\n <>\n <Layer>\n <path\n d={`${tick(...from)}${tick(...to)}`}\n stroke={color}\n strokeWidth={1.25}\n fill=\"none\"\n />\n <line\n x1={x1}\n y1={y1}\n x2={x2}\n y2={y2}\n stroke={color}\n strokeWidth={1.25}\n />\n </Layer>\n <Pill\n x={mx}\n y={my}\n text={label}\n color={color}\n delay={delay + 7}\n anchor={labelSide ?? (horizontal ? \"above\" : \"left\")}\n />\n </>\n );\n}\n\n/** Hairline box traced around an element, clockwise from the top left. */\nfunction OutlineBox({\n rect,\n color,\n delay = 0,\n radius = 3,\n inset = -3,\n dashed,\n fill,\n}: {\n rect: Rect;\n color: string;\n delay?: number;\n radius?: number;\n inset?: number;\n dashed?: boolean;\n fill?: string;\n}) {\n const frame = useAuditFrame();\n const draw = progress(frame, delay, 14);\n const x = rect.x + inset;\n const y = rect.y + inset;\n const w = rect.w - inset * 2;\n const h = rect.h - inset * 2;\n return (\n <Layer>\n <rect\n x={x}\n y={y}\n width={w}\n height={h}\n rx={radius}\n fill={fill ?? \"none\"}\n fillOpacity={draw}\n stroke={color}\n strokeWidth={1.25}\n pathLength={1}\n strokeDasharray={dashed ? undefined : `${draw} 1`}\n strokeOpacity={dashed ? draw : 1}\n style={dashed ? { strokeDasharray: \"3 3\" } : undefined}\n />\n </Layer>\n );\n}\n\n/** Quarter arc swept into a corner to call out its radius. */\nfunction CornerArc({\n x,\n y,\n r,\n color,\n label,\n delay = 0,\n}: {\n x: number;\n y: number;\n r: number;\n color: string;\n label: string;\n delay?: number;\n}) {\n const frame = useAuditFrame();\n const draw = progress(frame, delay, 12);\n const size = Math.max(r, 10) + 4;\n return (\n <>\n <Layer>\n <path\n d={`M${x} ${y + size}A${size} ${size} 0 0 1 ${x + size} ${y}`}\n stroke={color}\n strokeWidth={1.5}\n fill=\"none\"\n pathLength={1}\n strokeDasharray={`${draw} 1`}\n strokeLinecap=\"round\"\n />\n </Layer>\n <Pill\n x={x - 2}\n y={y - 2}\n text={label}\n color={color}\n delay={delay + 8}\n anchor=\"aboveStart\"\n />\n </>\n );\n}\n\n/**\n * Design-token tag: a dot lands on the element, a leader line runs out with\n * one elbow, and a dark chip with the token name settles at its end.\n */\nfunction TokenTag({\n anchor,\n at,\n label,\n swatch,\n delay = 0,\n lineColor = \"#0E121B\",\n}: {\n anchor: [number, number];\n at: [number, number];\n label: string;\n swatch: string;\n delay?: number;\n lineColor?: string;\n}) {\n const frame = useAuditFrame();\n const dot = usePop(delay);\n const draw = progress(frame, delay + 3, 14);\n const elbowY = at[1];\n const path = `M${anchor[0]} ${anchor[1]}L${anchor[0] + (at[0] - anchor[0]) * 0.35} ${elbowY}H${at[0]}`;\n return (\n <>\n <Layer>\n <path\n d={path}\n stroke={lineColor}\n strokeOpacity={0.55}\n strokeWidth={1}\n fill=\"none\"\n pathLength={1}\n strokeDasharray={`${draw} 1`}\n />\n <circle\n cx={anchor[0]}\n cy={anchor[1]}\n r={3.5 * dot}\n fill=\"#fff\"\n stroke={lineColor}\n strokeWidth={1.5}\n />\n </Layer>\n <TokenChip\n x={at[0]}\n y={at[1]}\n label={label}\n swatch={swatch}\n delay={delay + 13}\n />\n </>\n );\n}\n\nfunction TokenChip({\n x,\n y,\n label,\n swatch,\n delay = 0,\n}: {\n x: number;\n y: number;\n label: string;\n swatch: string;\n delay?: number;\n}) {\n const pop = usePop(delay);\n return (\n <div\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n transform: `translate(-50%, -50%) translateY(${(1 - pop) * 6}px)`,\n opacity: Math.min(1, pop * 1.4),\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n background: \"#0E121B\",\n color: \"#fff\",\n fontFamily: MONO,\n fontSize: 11,\n lineHeight: \"22px\",\n padding: \"0 8px\",\n borderRadius: 5,\n whiteSpace: \"nowrap\",\n boxShadow: \"0 4px 10px -4px rgba(10,13,20,0.4)\",\n }}\n >\n <span\n style={{\n width: 8,\n height: 8,\n borderRadius: 4,\n background: swatch,\n boxShadow: \"0 0 0 1px rgba(255,255,255,0.35)\",\n }}\n />\n {label}\n </div>\n );\n}\n\n/** Guide line that drops down (vertical) or slides across (horizontal). */\nfunction Guide({\n x,\n y,\n length,\n vertical,\n color,\n delay = 0,\n dashed,\n width = 1,\n}: {\n x: number;\n y: number;\n length: number;\n vertical?: boolean;\n color: string;\n delay?: number;\n dashed?: boolean;\n width?: number;\n}) {\n const frame = useAuditFrame();\n const draw = progress(frame, delay, 16) * length;\n return (\n <Layer>\n <line\n x1={x}\n y1={y}\n x2={vertical ? x : x + draw}\n y2={vertical ? y + draw : y}\n stroke={color}\n strokeWidth={width}\n strokeDasharray={dashed ? \"4 4\" : undefined}\n />\n </Layer>\n );\n}\n\n/**\n * Scan band: a crisp line with a soft wash trailing behind it, the way the\n * fix pass sweeps the screen. `y` is the line's position.\n */\nfunction ScanBand({\n y,\n color,\n x = 0,\n w = 1280,\n trail = 90,\n opacity = 1,\n}: {\n y: number;\n color: string;\n x?: number;\n w?: number;\n trail?: number;\n opacity?: number;\n}) {\n return (\n <div\n style={{ position: \"absolute\", inset: 0, opacity, pointerEvents: \"none\" }}\n >\n <div\n style={{\n position: \"absolute\",\n left: x,\n width: w,\n top: y - trail,\n height: trail,\n background: `linear-gradient(to bottom, transparent, ${color}2E)`,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n left: x,\n width: w,\n top: y - 1,\n height: 2,\n background: color,\n boxShadow: `0 0 12px 1px ${color}`,\n }}\n />\n </div>\n );\n}\n\n/** Stage-colored wash over everything except one rect, to push focus. */\nfunction Spotlight({\n rect,\n opacity,\n color = C.stage,\n}: {\n rect: Rect;\n opacity: number;\n color?: string;\n}) {\n const pad = 10;\n const x = rect.x - pad;\n const y = rect.y - pad;\n const w = rect.w + pad * 2;\n const h = rect.h + pad * 2;\n const r = 12;\n return (\n <svg\n width={1280}\n height={720}\n style={{ position: \"absolute\", inset: 0, opacity }}\n >\n <path\n fillRule=\"evenodd\"\n fill={color}\n fillOpacity={0.72}\n d={`M0 0H1280V720H0Z M${x + r} ${y}H${x + w - r}Q${x + w} ${y} ${x + w} ${y + r}V${y + h - r}Q${x + w} ${y + h} ${x + w - r} ${y + h}H${x + r}Q${x} ${y + h} ${x} ${y + h - r}V${y + r}Q${x} ${y} ${x + r} ${y}Z`}\n />\n </svg>\n );\n}\n\n/** Two full frames split at `y`: `top` shows above the line, `bottom` below. */\nfunction SplitAt({\n y,\n top,\n bottom,\n}: {\n y: number;\n top: ReactNode;\n bottom: ReactNode;\n}) {\n return (\n <>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n clipPath: `inset(${Math.max(0, y)}px 0 0 0)`,\n }}\n >\n {bottom}\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n clipPath: `inset(0 0 ${Math.max(0, 720 - y)}px 0)`,\n }}\n >\n {top}\n </div>\n </>\n );\n}\n\n/** Cubic ease-in-out between keyframes, clamped at both ends. */\nfunction easeInOut(frame: number, input: number[], output: number[]) {\n return interpolate(frame, input, output, {\n ...clamp,\n easing: Easing.inOut(Easing.cubic),\n });\n}\n\n/* Mark data */\n\ntype Point = [number, number];\n\n/** A distance between two points on one axis, with its value. */\ntype Measure = { from: Point; to: Point; label: string; side?: Side };\n/** A corner whose radius gets an arc and a label. `x`, `y` is the corner. */\ntype RadiusMark = { x: number; y: number; r: number; label: string };\n/** An off-spec element and the fix it needs. */\ntype Issue = {\n rect: Rect;\n note: string;\n side?: \"start\" | \"end\" | \"below\";\n};\n/** A token tag: dot on `anchor`, chip centered on `at`. */\ntype TokenSpec = {\n anchor: Point;\n at: Point;\n label: string;\n swatch: string;\n};\n/** Layout guides over a column grid. */\ntype GuideSpec = {\n /** x of every column edge, left to right. */\n columns: number[];\n top: number;\n bottom: number;\n /** One column (or any rect) to fill and label. */\n highlight?: { rect: Rect; label: string };\n /** A measurement drawn with the guides, like a gutter width. */\n ruler?: Measure;\n /** A horizontal marker line across the grid, like a calendar's now line. */\n now?: { y: number; from: number; to: number; label: string };\n};\n\nconst AUDIT_COLORS = {\n audit: C.error,\n fix: C.blue,\n scan: C.primary,\n ink: C.ink,\n stage: C.stage,\n};\n\n/** Spacing and size redlines across the demo header, tabs and first cards. */\nfunction demoMeasures(l: DemoLayout): Measure[] {\n const card = l.cards[0];\n const next = l.cards[1];\n const tabsBottom = l.tabs[0].y + 32;\n const headerBottom = l.header.y + l.header.h;\n const tabGapX = l.tabs[1].x + l.tabs[1].w + 7;\n const right = l.button.x + l.button.w + 8;\n return [\n {\n from: [l.header.x, l.tabs[0].y + 16],\n to: [l.contentX, l.tabs[0].y + 16],\n label: `pad ${l.pad}`,\n side: \"below\",\n },\n {\n from: [tabGapX, headerBottom],\n to: [tabGapX, l.tabs[0].y],\n label: `${l.tabs[0].y - headerBottom}`,\n side: \"right\",\n },\n {\n from: [next.rect.x + 150, tabsBottom],\n to: [next.rect.x + 150, next.rect.y],\n label: `${next.rect.y - tabsBottom}`,\n side: \"right\",\n },\n {\n from: [card.rect.x + card.rect.w, card.rect.y + 46],\n to: [next.rect.x, card.rect.y + 46],\n label: `gap ${l.gap}`,\n },\n {\n from: [card.rect.x, card.title.y + 9],\n to: [card.title.x, card.title.y + 9],\n label: `${l.cardPad}`,\n side: \"left\",\n },\n {\n from: [card.title.x + 96, card.rect.y],\n to: [card.title.x + 96, card.title.y],\n label: `${l.cardPad}`,\n side: \"right\",\n },\n {\n from: [right, l.button.y],\n to: [right, l.button.y + l.button.h],\n label: `h ${l.button.h}`,\n side: \"below\",\n },\n ];\n}\n\nfunction demoRadii(l: DemoLayout): RadiusMark[] {\n const next = l.cards[1].rect;\n return [{ x: next.x, y: next.y, r: l.radius, label: `radius ${l.radius}` }];\n}\n\nfunction demoIssues(l: DemoLayout): Issue[] {\n return [\n { rect: l.cards[0].title, note: \"13.5 → 14\", side: \"start\" },\n { rect: l.cards[0].status, note: \"radius 4 → 6\", side: \"below\" },\n { rect: l.cards[0].chevron, note: \"hit 20 → 24\", side: \"end\" },\n { rect: l.button, note: \"#8B5CF6 ≠ primary\", side: \"end\" },\n { rect: l.sideActive, note: \"radius 5 → 8\", side: \"start\" },\n { rect: l.events[2].rect, note: \"radius 4 → 8\", side: \"start\" },\n { rect: l.events[6].rect, note: \"pad 6 → 8\", side: \"start\" },\n ];\n}\n\nfunction demoTokens(l: DemoLayout): TokenSpec[] {\n const [c0, c1, c2, c3] = l.cards;\n const chipY = l.calendar.y + 70;\n return [\n {\n anchor: [c0.status.x + 12, c0.status.y + 13],\n at: [c0.rect.x + 50, chipY + 50],\n label: \"state/success/lighter\",\n swatch: C.successBg,\n },\n {\n anchor: [c0.title.x + 40, c0.title.y + 9],\n at: [c0.rect.x + 170, chipY],\n label: \"text/strong-950\",\n swatch: C.ink,\n },\n {\n anchor: [c1.status.x + 12, c1.status.y + 13],\n at: [c1.rect.x + 110, chipY + 92],\n label: \"state/warning/base\",\n swatch: C.warning,\n },\n {\n anchor: [c2.status.x + 12, c2.status.y + 13],\n at: [c2.rect.x + 90, chipY + 20],\n label: \"state/error/base\",\n swatch: C.error,\n },\n {\n anchor: [c3.rect.x + c3.rect.w, c3.rect.y + 40],\n at: [c3.rect.x + 90, chipY + 70],\n label: \"stroke/soft-200\",\n swatch: C.stroke,\n },\n ];\n}\n\nfunction demoGuides(l: DemoLayout): GuideSpec {\n const cal = l.calendar;\n const today = l.columns[0];\n return {\n columns: [...l.columns.map((col) => col.x), cal.x + cal.w],\n top: cal.y,\n bottom: cal.y + cal.h,\n highlight: { rect: today, label: \"Mon 2 · today\" },\n ruler: {\n from: [cal.x, cal.y + l.dayHeaderH + 14],\n to: [cal.x + l.gutter, cal.y + l.dayHeaderH + 14],\n label: `w ${l.gutter}`,\n side: \"below\",\n },\n now: {\n y: cal.y + l.dayHeaderH + 1.25 * l.hourH,\n from: cal.x + l.gutter,\n to: cal.x + cal.w,\n label: \"10:15 AM\",\n },\n };\n}\n\n/** Close-up spec of the first card, sized for a zoomed camera. */\nfunction demoFocus(l: DemoLayout) {\n const card = l.cards[0];\n const r = card.rect;\n const below = r.y + r.h + 34;\n return {\n rect: r,\n measures: [\n {\n from: [r.x, card.title.y + 9],\n to: [card.title.x, card.title.y + 9],\n label: `${l.cardPad}`,\n side: \"below\",\n },\n {\n from: [card.title.x + 110, r.y],\n to: [card.title.x + 110, card.title.y],\n label: `${l.cardPad}`,\n side: \"right\",\n },\n {\n from: [r.x + r.w + 8, card.status.y],\n to: [r.x + r.w + 8, card.status.y + card.status.h],\n label: `h ${card.status.h}`,\n side: \"right\",\n },\n {\n from: [card.chevron.x - 2, card.chevron.y - 6],\n to: [card.chevron.x + card.chevron.w + 2, card.chevron.y - 6],\n label: \"24\",\n },\n ] as Measure[],\n radii: [{ x: r.x, y: r.y, r: l.radius, label: `radius ${l.radius}` }],\n tokens: [\n {\n anchor: [card.status.x + 12, card.status.y + 13],\n at: [r.x + 40, below],\n label: \"state/success/base\",\n swatch: C.success,\n },\n {\n anchor: [card.title.x + 60, card.title.y + 9],\n at: [r.x + 205, below - 4],\n label: \"text/strong-950\",\n swatch: C.ink,\n },\n {\n anchor: [card.time.x + 40, card.time.y + 8],\n at: [r.x + 70, below + 30],\n label: \"text/sub-600\",\n swatch: C.sub,\n },\n {\n anchor: [r.x + r.w, r.y + 30],\n at: [r.x + 230, below + 30],\n label: \"stroke/soft-200\",\n swatch: C.stroke,\n },\n ] as TokenSpec[],\n };\n}\n\nfunction demoSet(v: Version) {\n const l = demoLayout(v);\n return {\n layout: l,\n measures: demoMeasures(l),\n radii: demoRadii(l),\n issues: demoIssues(l),\n tokens: demoTokens(l),\n guides: demoGuides(l),\n focus: demoFocus(l),\n /** Rect around the tabs and the card row. */\n cardRow: {\n x: l.contentX,\n y: l.tabs[0].y,\n w: l.calendar.w,\n h: l.cards[0].rect.y + 92 - l.tabs[0].y,\n } satisfies Rect,\n };\n}\n\n/** Mark data measured off the demo dashboard: `before` is v1, `after` v2. */\nconst DEMO = { before: demoSet(1), after: demoSet(2) };\nconst DEMO_WINDOW = WIN;\n\n/* Mark sets */\n\n/** Rulers then radius arcs, each `stagger` frames after the last. */\nfunction MeasureMarks({\n measures,\n radii = [],\n color,\n start = 0,\n stagger = 5,\n}: {\n measures: Measure[];\n radii?: RadiusMark[];\n color: string;\n start?: number;\n stagger?: number;\n}) {\n return (\n <>\n {measures.map((m, i) => (\n <Ruler\n key={`${m.from.join()}-${m.to.join()}`}\n from={m.from}\n to={m.to}\n label={m.label}\n color={color}\n delay={start + i * stagger}\n labelSide={m.side}\n />\n ))}\n {radii.map((r, i) => (\n <CornerArc\n key={`${r.x}-${r.y}`}\n x={r.x}\n y={r.y}\n r={r.r}\n label={r.label}\n color={color}\n delay={start + (measures.length + i) * stagger}\n />\n ))}\n </>\n );\n}\n\nconst NOTE_SPOT = {\n start: (r: Rect) => ({\n x: r.x - 3,\n y: r.y - 3,\n anchor: \"aboveStart\" as const,\n }),\n end: (r: Rect) => ({\n x: r.x + r.w + 3,\n y: r.y - 3,\n anchor: \"aboveEnd\" as const,\n }),\n below: (r: Rect) => ({\n x: r.x - 3,\n y: r.y + r.h + 3,\n anchor: \"belowStart\" as const,\n }),\n};\n\n/** Every issue boxed, with its note popping on once the box closes. */\nfunction IssueMarks({\n issues,\n color,\n start = 0,\n stagger = 4,\n}: {\n issues: Issue[];\n color: string;\n start?: number;\n stagger?: number;\n}) {\n return (\n <>\n {issues.map((issue, i) => (\n <div key={`${issue.rect.x}-${issue.rect.y}-${issue.note}`}>\n <OutlineBox\n rect={issue.rect}\n color={color}\n delay={start + i * stagger}\n />\n <Pill\n {...NOTE_SPOT[issue.side ?? \"start\"](issue.rect)}\n text={issue.note}\n color={color}\n delay={start + i * stagger + 10}\n />\n </div>\n ))}\n </>\n );\n}\n\nfunction TokenMarks({\n tokens,\n start = 0,\n stagger = 6,\n lineColor,\n}: {\n tokens: TokenSpec[];\n start?: number;\n stagger?: number;\n lineColor?: string;\n}) {\n return (\n <>\n {tokens.map((tag, i) => (\n <TokenTag\n key={`${tag.label}-${tag.anchor.join()}`}\n anchor={tag.anchor}\n at={tag.at}\n label={tag.label}\n swatch={tag.swatch}\n lineColor={lineColor}\n delay={start + i * stagger}\n />\n ))}\n </>\n );\n}\n\n/** Column guides drop in, the highlight fills, then the now line slides across. */\nfunction GuideMarks({\n guides,\n color,\n nowColor = C.primary,\n start = 0,\n}: {\n guides: GuideSpec;\n color: string;\n nowColor?: string;\n start?: number;\n}) {\n const { columns, top, bottom, highlight, ruler, now } = guides;\n const h = highlight?.rect;\n return (\n <>\n {columns.map((x, i) => (\n <Guide\n key={x}\n x={x}\n y={top}\n length={bottom - top}\n vertical\n color={color}\n dashed\n delay={start + i * 3}\n />\n ))}\n {h && highlight && (\n <>\n <OutlineBox\n rect={h}\n color={color}\n fill={`${color}14`}\n inset={0}\n radius={0}\n delay={start + 14}\n />\n <OutlineBox\n rect={{ x: h.x + 6, y: h.y + 4, w: h.w - 12, h: 22 }}\n color={color}\n radius={4}\n inset={0}\n delay={start + 20}\n />\n <Pill\n x={h.x + h.w / 2}\n y={h.y + 4}\n text={highlight.label}\n color={color}\n delay={start + 26}\n anchor=\"above\"\n />\n </>\n )}\n {ruler && (\n <Ruler\n from={ruler.from}\n to={ruler.to}\n label={ruler.label}\n color={color}\n delay={start + 24}\n labelSide={ruler.side}\n />\n )}\n {now && (\n <>\n <Guide\n x={now.from}\n y={now.y}\n length={now.to - now.from}\n color={nowColor}\n width={1.5}\n delay={start + 30}\n />\n <Pill\n x={now.from}\n y={now.y}\n text={now.label}\n color={nowColor}\n delay={start + 30}\n anchor=\"left\"\n />\n </>\n )}\n </>\n );\n}\n\n/** Brand name with a version chip that flips once the fix lands. */\nfunction VersionChip({\n brand,\n versions,\n fixed,\n colors,\n}: {\n brand: string;\n versions: [string, string];\n fixed: boolean;\n colors: [string, string];\n}) {\n return (\n <div\n style={{\n position: \"absolute\",\n left: WIN.x,\n top: 26,\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n fontSize: 15,\n fontWeight: 600,\n color: C.ink,\n }}\n >\n {brand}\n <span\n style={{\n fontFamily: MONO,\n fontSize: 11,\n color: \"#fff\",\n background: fixed ? colors[1] : colors[0],\n borderRadius: 999,\n padding: \"1px 8px\",\n }}\n >\n {fixed ? versions[1] : versions[0]}\n </span>\n </div>\n );\n}\n\ntype DesignAuditMarks = {\n measures?: Measure[];\n radii?: RadiusMark[];\n};\n\ntype DesignAuditFocus = {\n /** Element the camera pushes in on. */\n rect: Rect;\n measures?: Measure[];\n radii?: RadiusMark[];\n tokens?: TokenSpec[];\n};\n\ntype DesignAuditProps = {\n /** UI before the fix, 1280x720. Defaults to a demo dashboard with drifted spacing. */\n before?: ReactNode;\n /** The fixed UI, same layout. */\n after?: ReactNode;\n /** Red redlines drawn over `before`. */\n beforeMarks?: DesignAuditMarks;\n /** Off-spec elements boxed on `before`. */\n issues?: Issue[];\n /** Blue redlines over `after`, shown once the scan lands. */\n afterMarks?: DesignAuditMarks;\n /** Close-up the camera pushes into, with its specs and tokens. `null` skips the zoom. */\n focus?: DesignAuditFocus | null;\n /** Guides drawn after the camera pulls back. */\n guides?: GuideSpec | null;\n /** Four step names lit one by one across the top. */\n steps?: string[];\n /** Name next to the version chip. Empty hides the top bar. */\n brand?: string;\n versions?: [string, string];\n auditColor?: string;\n fixColor?: string;\n scanColor?: string;\n background?: string;\n speed?: number;\n};\n\nconst designAuditDefaults = {\n steps: [\"Audit\", \"Layout\", \"Components\", \"Tokens\"],\n brand: \"Synergy\",\n versions: [\"v1.0\", \"v2.0\"] as [string, string],\n auditColor: AUDIT_COLORS.audit,\n fixColor: AUDIT_COLORS.fix,\n scanColor: AUDIT_COLORS.scan,\n background: AUDIT_COLORS.stage,\n speed: 1,\n};\n\nconst T = {\n redline: 14,\n audit: 34,\n scan: 72,\n scanLength: 64,\n zoomIn: 156,\n callouts: 180,\n tokens: 208,\n zoomOut: 252,\n guides: 278,\n};\n\nconst designAuditLength = 332;\n\nfunction DesignAuditBase(props: DesignAuditProps) {\n const { speed = 1 } = props;\n return (\n <AuditClock speed={speed}>\n <Scene {...props} />\n </AuditClock>\n );\n}\n\nfunction Scene({\n before,\n after,\n beforeMarks,\n issues,\n afterMarks,\n focus,\n guides,\n steps = designAuditDefaults.steps,\n brand = designAuditDefaults.brand,\n versions = designAuditDefaults.versions,\n auditColor = designAuditDefaults.auditColor,\n fixColor = designAuditDefaults.fixColor,\n scanColor = designAuditDefaults.scanColor,\n background = designAuditDefaults.background,\n}: DesignAuditProps) {\n const frame = useAuditFrame();\n const demo = !before && !after;\n const redBefore = beforeMarks ?? (demo ? DEMO.before : {});\n const blueAfter = afterMarks ?? (demo ? DEMO.after : {});\n const flagged = issues ?? (demo ? DEMO.before.issues : []);\n const zoomed = focus === undefined ? (demo ? DEMO.after.focus : null) : focus;\n const grid =\n guides === undefined ? (demo ? DEMO.after.guides : null) : guides;\n\n const y = easeInOut(frame, [T.scan, T.scan + T.scanLength], [-20, 760]);\n const band = easeInOut(\n frame,\n [T.scan - 4, T.scan + 2, T.scan + T.scanLength - 8, T.scan + T.scanLength],\n [0, 1, 1, 0],\n );\n const enter = progress(frame, 0, 18);\n const zoom = zoomed\n ? easeInOut(\n frame,\n [T.zoomIn, T.zoomIn + 22, T.zoomOut, T.zoomOut + 22],\n [0, 1, 1, 0],\n )\n : 0;\n const card = zoomed?.rect ?? { x: 640, y: 360, w: 0, h: 0 };\n const center = { x: card.x + card.w / 2 + 40, y: card.y + card.h / 2 + 46 };\n const camera = `translate(${(640 - center.x) * zoom}px, ${(360 - center.y) * zoom}px) scale(${1 + zoom * 1.35})`;\n const fadeOut = (at: number) => easeInOut(frame, [at - 10, at], [1, 0]);\n\n const active =\n frame < T.scan ? 0 : frame < T.zoomIn ? 1 : frame < T.tokens ? 2 : 3;\n\n return (\n <AbsoluteFill style={{ background, fontFamily: FONT }}>\n <AbsoluteFill\n style={{\n transform: camera,\n transformOrigin: `${center.x}px ${center.y}px`,\n }}\n >\n <AbsoluteFill\n style={{\n opacity: enter,\n transform: `translateY(${(1 - enter) * 18}px) scale(${0.97 + 0.03 * enter})`,\n }}\n >\n <SplitAt\n y={y}\n bottom={\n <>\n {before ?? <DemoDashboard v={1} />}\n <MeasureMarks\n measures={redBefore.measures ?? []}\n radii={redBefore.radii}\n color={auditColor}\n start={T.redline}\n />\n <IssueMarks\n issues={flagged}\n color={auditColor}\n start={T.audit}\n />\n </>\n }\n top={\n <>\n {after ?? <DemoDashboard v={2} />}\n <AbsoluteFill\n style={{ opacity: zoomed ? fadeOut(T.zoomIn) : 1 }}\n >\n <MeasureMarks\n measures={blueAfter.measures ?? []}\n radii={blueAfter.radii}\n color={fixColor}\n start={-200}\n />\n </AbsoluteFill>\n </>\n }\n />\n <ScanBand y={y} color={scanColor} opacity={band} />\n {zoomed && (\n <>\n <Spotlight rect={zoomed.rect} color={background} opacity={zoom} />\n {frame >= T.callouts && (\n <AbsoluteFill style={{ opacity: fadeOut(T.zoomOut + 6) }}>\n <MeasureMarks\n measures={zoomed.measures ?? []}\n radii={zoomed.radii}\n color={fixColor}\n start={T.callouts}\n stagger={4}\n />\n <TokenMarks tokens={zoomed.tokens ?? []} start={T.tokens} />\n </AbsoluteFill>\n )}\n </>\n )}\n {grid && (\n <GuideMarks guides={grid} color={fixColor} start={T.guides} />\n )}\n </AbsoluteFill>\n </AbsoluteFill>\n {brand && (\n <AbsoluteFill style={{ opacity: enter * (1 - zoom) }}>\n <VersionChip\n brand={brand}\n versions={versions}\n fixed={y > 36}\n colors={[auditColor, fixColor]}\n />\n <StepBar\n steps={steps}\n active={active}\n colors={[auditColor, fixColor]}\n />\n </AbsoluteFill>\n )}\n </AbsoluteFill>\n );\n}\n\nfunction StepBar({\n steps,\n active,\n colors,\n}: {\n steps: string[];\n active: number;\n colors: [string, string];\n}) {\n return (\n <div\n style={{\n position: \"absolute\",\n right: 1280 - DEMO_WINDOW.x - DEMO_WINDOW.w,\n top: 28,\n display: \"flex\",\n gap: 18,\n fontSize: 12.5,\n }}\n >\n {steps.map((step, i) => {\n const on = i <= active;\n return (\n <span\n key={step}\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n color: on ? AUDIT_COLORS.ink : \"#99A0AE\",\n fontWeight: i === active ? 600 : 400,\n }}\n >\n <span\n style={{\n width: 6,\n height: 6,\n borderRadius: 3,\n background: on\n ? active === 0\n ? colors[0]\n : colors[1]\n : \"#E1E4EA\",\n }}\n />\n {step}\n </span>\n );\n })}\n </div>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n brand: {\n type: \"text-content\",\n default: \"Synergy\",\n description: \"Brand\",\n },\n auditColor: {\n type: \"color\",\n default: \"#FB3748\",\n description: \"Audit\",\n },\n fixColor: {\n type: \"color\",\n default: \"#335CFF\",\n description: \"Fix\",\n },\n scanColor: {\n type: \"color\",\n default: \"#7D52F4\",\n description: \"Scan\",\n },\n background: {\n type: \"color\",\n default: \"#EDEDEF\",\n description: \"Background\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"brand\",\"auditColor\",\"fixColor\",\"scanColor\",\"background\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n brand: \"Synergy\",\n auditColor: \"#FB3748\",\n fixColor: \"#335CFF\",\n scanColor: \"#7D52F4\",\n background: \"#EDEDEF\",\n speed: 1,\n};\n\ntype DesignAuditElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof DesignAuditBase>;\n\nconst DesignAuditInner = forwardRef<\n HTMLDivElement,\n DesignAuditElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<DesignAudit>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <DesignAuditBase\n {...(componentProps as unknown as ComponentProps<typeof DesignAuditBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const DesignAudit = Interactive.withSchema({\n Component: DesignAuditInner,\n componentName: \"<DesignAudit>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 332+}diff --git a/registry-artifacts/elements/layout-guides.json b/registry-artifacts/elements/layout-guides.jsonnew file mode 100644index 00000000..2f0ad71b--- /dev/null+++ b/registry-artifacts/elements/layout-guides.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Layout Guides",+ "durationInFrames": 54,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "layout-guides",+ "sourceCode": "import { createContext, forwardRef, useContext, useImperativeHandle, useRef, type CSSProperties, type ComponentProps, type ReactNode } from \"react\";\nimport { AbsoluteFill, Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\n/**\n * Shared kit behind the design-review family (redline-measure, audit-boxes,\n * scan-fix, token-tags, layout-guides, design-audit): the annotation marks a\n * design review paints over a UI, the scan band that sweeps a fix across it,\n * and a demo calendar dashboard the marks are measured against by default.\n *\n * Every coordinate is in composition pixels of a 1280x720 frame.\n */\n\nconst AuditSpeed = createContext(1);\n\n/** Scales the clock every mark below it reads. */\nfunction AuditClock({\n speed,\n children,\n}: {\n speed: number;\n children: ReactNode;\n}) {\n return <AuditSpeed.Provider value={speed}>{children}</AuditSpeed.Provider>;\n}\n\nfunction useAuditFrame() {\n return useCurrentFrame() * useContext(AuditSpeed);\n}\n\n/* Demo dashboard */\n/**\n * A calendar dashboard drawn from one layout function, so every annotation\n * can measure the exact rects the UI paints. Version 1 is the \"before\"\n * build with drifted spacing and radii, version 2 is the fixed one.\n */\n\ntype Rect = { x: number; y: number; w: number; h: number };\ntype Version = 1 | 2;\n\nconst FONT =\n \"Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\";\nconst MONO = \"ui-monospace, 'SF Mono', Menlo, Consolas, monospace\";\n\nconst C = {\n stage: \"#EDEDEF\",\n window: \"#FFFFFF\",\n ink: \"#0E121B\",\n sub: \"#525866\",\n soft: \"#99A0AE\",\n stroke: \"#E1E4EA\",\n weak: \"#F5F7FA\",\n primary: \"#7D52F4\",\n success: \"#1FC16B\",\n successBg: \"#E0FAEC\",\n warning: \"#FA7319\",\n warningBg: \"#FFF1EB\",\n error: \"#FB3748\",\n errorBg: \"#FFEBEC\",\n blue: \"#335CFF\",\n blueBg: \"#EBF1FF\",\n orangeBg: \"#FFF3EB\",\n purpleBg: \"#EFEBFF\",\n};\n\nconst WIN: Rect = { x: 80, y: 64, w: 1120, h: 616 };\nconst SIDE_W = 216;\nconst HEADER_H = 56;\nconst MAIN_X = WIN.x + SIDE_W;\nconst MAIN_R = WIN.x + WIN.w;\n\nconst CARDS = [\n {\n title: \"Weekly team meeting\",\n time: \"3:00 – 4:30 PM\",\n status: \"Today\",\n action: \"Join meeting\",\n dot: C.success,\n bg: C.successBg,\n },\n {\n title: \"Product launch event\",\n time: \"11:00 AM – 12:30 PM\",\n status: \"2 conflicts\",\n action: \"Review\",\n dot: C.warning,\n bg: C.warningBg,\n },\n {\n title: \"Team building workshop\",\n time: \"10:00 AM – 1:00 PM\",\n status: \"Canceled\",\n action: \"Fri, Nov 6\",\n dot: C.error,\n bg: C.errorBg,\n },\n {\n title: \"Marketing campaign\",\n time: \"2:30 – 4:00 PM\",\n status: \"In 3 days\",\n action: \"Thu, Nov 5\",\n dot: C.soft,\n bg: C.weak,\n },\n];\n\nconst TABS = [\n { label: \"All scheduled\", count: \"15\" },\n { label: \"Meetings\", count: \"12\" },\n { label: \"Events\", count: \"3\" },\n { label: \"Conflicted\", count: \"2\" },\n { label: \"Canceled\", count: \"1\" },\n];\n\nconst DAYS = [\"Mon 2\", \"Tue 3\", \"Wed 4\", \"Thu 5\", \"Fri 6\"];\nconst HOURS = [\"9 AM\", \"10 AM\", \"11 AM\", \"12 PM\", \"1 PM\"];\n\nconst EVENTS = [\n { day: 0, from: 0, to: 0.5, title: \"Brainstorming session\", tone: \"gray\" },\n { day: 0, from: 0.55, to: 1.05, title: \"Bi-weekly sync\", tone: \"gray\" },\n { day: 1, from: 0, to: 0.45, title: \"Project review\", tone: \"blue\" },\n { day: 1, from: 1.05, to: 2.6, title: \"Sales team training\", tone: \"blue\" },\n { day: 2, from: 0.5, to: 1.0, title: \"Marketing strategy\", tone: \"blue\" },\n { day: 2, from: 2.6, to: 3.6, title: \"Interview: frontend\", tone: \"purple\" },\n { day: 3, from: 0, to: 1.0, title: \"Customer feedback\", tone: \"blue\" },\n { day: 3, from: 2.2, to: 3.4, title: \"Product launch\", tone: \"orange\" },\n { day: 0, from: 2.5, to: 3.7, title: \"Workshop: design\", tone: \"orange\" },\n { day: 4, from: 1.1, to: 3.7, title: \"Team building\", tone: \"gray\" },\n] as const;\n\nconst TONES = {\n gray: { bg: C.weak, ink: C.sub },\n blue: { bg: C.blueBg, ink: \"#2547D0\" },\n purple: { bg: C.purpleBg, ink: \"#5B3CC4\" },\n orange: { bg: C.orangeBg, ink: \"#C2540A\" },\n};\n\n/** Every rect the dashboard paints, in composition pixels. */\nfunction demoLayout(v: Version) {\n const pad = v === 2 ? 24 : 20;\n const gap = v === 2 ? 16 : 10;\n const cardPad = v === 2 ? 16 : 12;\n const radius = v === 2 ? 12 : 6;\n const contentX = MAIN_X + pad;\n const contentW = MAIN_R - pad - contentX;\n\n const header: Rect = { x: MAIN_X, y: WIN.y, w: MAIN_R - MAIN_X, h: HEADER_H };\n const button: Rect = {\n x: MAIN_R - pad - 128,\n y: WIN.y + 12,\n w: 128,\n h: v === 2 ? 32 : 34,\n };\n const tabsY = WIN.y + HEADER_H + (v === 2 ? 16 : 12);\n let tabX = contentX;\n const tabs = TABS.map((tab, i) => {\n const w = 46 + tab.label.length * 7.4 + (i === 0 ? 26 : 0);\n const rect: Rect = { x: tabX, y: tabsY, w, h: 32 };\n tabX += w + 14;\n return rect;\n });\n\n const cardsY = tabsY + 32 + (v === 2 ? 16 : 12);\n const cardW = (contentW - gap * 3) / 4;\n const cards = CARDS.map((_, i) => {\n const rect: Rect = {\n x: contentX + i * (cardW + gap),\n y: cardsY,\n w: cardW,\n h: 92,\n };\n return {\n rect,\n title: { x: rect.x + cardPad, y: rect.y + cardPad, w: 150, h: 18 },\n time: { x: rect.x + cardPad, y: rect.y + cardPad + 21, w: 110, h: 15 },\n status: {\n x: rect.x + cardPad - 4,\n y: rect.y + rect.h - cardPad - 24,\n w: rect.w - cardPad * 2 + 8,\n h: 26,\n },\n chevron: {\n x: rect.x + rect.w - cardPad - 20,\n y: rect.y + cardPad - 2,\n w: 20,\n h: 20,\n },\n };\n });\n\n const calY = cardsY + 92 + 22;\n const calendar: Rect = {\n x: contentX,\n y: calY,\n w: contentW,\n h: WIN.y + WIN.h - calY - 16,\n };\n const gutter = 56;\n const colW = (contentW - gutter) / DAYS.length;\n const dayHeaderH = 30;\n const hourH = (calendar.h - dayHeaderH) / 4;\n const columns = DAYS.map(\n (_, i): Rect => ({\n x: contentX + gutter + i * colW,\n y: calY,\n w: colW,\n h: calendar.h,\n }),\n );\n const events = EVENTS.map((event) => ({\n ...event,\n rect: {\n x: columns[event.day].x + 4,\n y: calY + dayHeaderH + event.from * hourH + 3,\n w: colW - 8,\n h: (event.to - event.from) * hourH - 6,\n } satisfies Rect,\n }));\n\n return {\n v,\n pad,\n gap,\n cardPad,\n radius,\n contentX,\n header,\n button,\n tabs,\n cards,\n calendar,\n columns,\n gutter,\n dayHeaderH,\n hourH,\n events,\n sidebar: { x: WIN.x, y: WIN.y, w: SIDE_W, h: WIN.h } satisfies Rect,\n sideActive: { x: WIN.x + 10, y: WIN.y + 158, w: SIDE_W - 20, h: 30 },\n };\n}\n\ntype DemoLayout = ReturnType<typeof demoLayout>;\n\nconst abs = (r: Rect): CSSProperties => ({\n position: \"absolute\",\n left: r.x,\n top: r.y,\n width: r.w,\n height: r.h,\n});\n\nfunction Glyph({\n size = 14,\n color = C.soft,\n}: {\n size?: number;\n color?: string;\n}) {\n return (\n <div\n style={{\n width: size,\n height: size,\n borderRadius: 4,\n border: `1.5px solid ${color}`,\n flexShrink: 0,\n }}\n />\n );\n}\n\nconst SIDE_ITEMS: (string | { section: string })[] = [\n \"Inbox\",\n \"Dashboard\",\n { section: \"Workspace\" },\n \"Calendar\",\n \"Time off\",\n \"People\",\n \"Payroll\",\n \"Projects\",\n \"Documents\",\n { section: \"Favorites\" },\n \"Loom Mobile App\",\n \"Monday Re-design\",\n \"Udemy Courses\",\n];\n\nfunction Sidebar({ l }: { l: DemoLayout }) {\n let y = WIN.y + 68;\n return (\n <>\n <div\n style={{\n ...abs({ x: WIN.x, y: WIN.y, w: SIDE_W, h: WIN.h }),\n borderRight: `1px solid ${C.stroke}`,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n left: WIN.x + 18,\n top: WIN.y + 18,\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n fontSize: 14,\n fontWeight: 600,\n color: C.ink,\n }}\n >\n <div\n style={{\n width: 22,\n height: 22,\n borderRadius: 11,\n background: C.primary,\n }}\n />\n Synergy\n </div>\n {SIDE_ITEMS.map((item) => {\n const top = y;\n if (typeof item !== \"string\") {\n y += 30;\n return (\n <div\n key={item.section}\n style={{\n position: \"absolute\",\n left: WIN.x + 20,\n top: top + 10,\n fontSize: 11,\n letterSpacing: \"0.04em\",\n textTransform: \"uppercase\",\n color: C.soft,\n }}\n >\n {item.section}\n </div>\n );\n }\n y += 30;\n const active = item === \"Calendar\";\n return (\n <div\n key={item}\n style={{\n ...abs(\n active\n ? l.sideActive\n : { x: WIN.x + 10, y: top, w: SIDE_W - 20, h: 30 },\n ),\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n paddingLeft: 10,\n borderRadius: l.v === 2 ? 8 : 5,\n background: active ? C.weak : undefined,\n fontSize: 13,\n fontWeight: active ? 500 : 400,\n color: active ? C.ink : C.sub,\n }}\n >\n <Glyph color={active ? C.primary : C.soft} />\n {item}\n </div>\n );\n })}\n <div\n style={{\n position: \"absolute\",\n left: WIN.x + 18,\n top: WIN.y + WIN.h - 44,\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n fontSize: 13,\n color: C.ink,\n }}\n >\n <div\n style={{\n width: 26,\n height: 26,\n borderRadius: 13,\n background: \"linear-gradient(135deg,#FBC5A6,#F17B6A)\",\n }}\n />\n Olivia Hart\n </div>\n </>\n );\n}\n\nfunction Header({ l }: { l: DemoLayout }) {\n return (\n <>\n <div\n style={{\n ...abs(l.header),\n borderBottom: `1px solid ${C.stroke}`,\n display: \"flex\",\n alignItems: \"center\",\n gap: 12,\n paddingLeft: l.pad,\n fontSize: 14,\n }}\n >\n <Glyph size={16} color={C.sub} />\n <span style={{ fontWeight: 600, color: C.ink }}>\n Monday, November 2\n </span>\n <span style={{ color: C.soft }}>\n You have 3 meetings and 1 event today.\n </span>\n </div>\n <div\n style={{\n ...abs({ x: l.button.x - 104, y: l.button.y, w: 92, h: l.button.h }),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: 6,\n borderRadius: l.v === 2 ? 8 : 6,\n border: `1px solid ${C.stroke}`,\n fontSize: 13,\n color: C.sub,\n }}\n >\n Schedule\n </div>\n <div\n style={{\n ...abs(l.button),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: l.v === 2 ? 8 : 6,\n background: l.v === 2 ? C.primary : \"#8B5CF6\",\n color: \"#fff\",\n fontSize: 13,\n fontWeight: 500,\n }}\n >\n + Create event\n </div>\n </>\n );\n}\n\nfunction Tabs({ l }: { l: DemoLayout }) {\n return (\n <>\n {TABS.map((tab, i) => (\n <div\n key={tab.label}\n style={{\n ...abs(l.tabs[i]),\n display: \"flex\",\n alignItems: \"center\",\n gap: 7,\n fontSize: 13,\n fontWeight: i === 0 ? 500 : 400,\n color: i === 0 ? C.ink : C.sub,\n borderBottom: i === 0 ? `2px solid ${C.primary}` : undefined,\n }}\n >\n <Glyph color={i === 0 ? C.primary : C.soft} />\n {tab.label}\n <span\n style={{\n fontSize: 11,\n fontWeight: 500,\n color: i === 0 ? \"#fff\" : C.soft,\n background:\n i === 0 ? (l.v === 2 ? C.primary : \"#8B5CF6\") : undefined,\n borderRadius: 8,\n padding: i === 0 ? \"1px 6px\" : 0,\n }}\n >\n {tab.count}\n </span>\n </div>\n ))}\n <div\n style={{\n position: \"absolute\",\n left: l.contentX,\n top: l.tabs[0].y + 32,\n width: WIN.x + WIN.w - l.pad - l.contentX,\n height: 1,\n background: C.stroke,\n }}\n />\n </>\n );\n}\n\nfunction Cards({ l }: { l: DemoLayout }) {\n return (\n <>\n {CARDS.map((card, i) => {\n const r = l.cards[i];\n return (\n <div key={card.title}>\n <div\n style={{\n ...abs(r.rect),\n borderRadius: l.radius,\n border: `1px solid ${C.stroke}`,\n background: \"#fff\",\n boxShadow: \"0 1px 2px rgba(10,13,20,0.04)\",\n }}\n />\n <div\n style={{\n ...abs(r.title),\n width: r.rect.w - l.cardPad * 2 - 24,\n fontSize: l.v === 2 ? 14 : 13.5,\n fontWeight: 600,\n color: C.ink,\n whiteSpace: \"nowrap\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n }}\n >\n {card.title}\n </div>\n <div\n style={{ ...abs(r.time), width: 160, fontSize: 12, color: C.sub }}\n >\n {card.time}\n </div>\n <div\n style={{\n ...abs(r.chevron),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: C.soft,\n fontSize: 11,\n }}\n >\n ⌄\n </div>\n <div\n style={{\n ...abs(r.status),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n padding: \"0 8px\",\n borderRadius: l.v === 2 ? 6 : 4,\n background: card.bg,\n fontSize: 12,\n }}\n >\n <span\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n color: C.ink,\n }}\n >\n <span\n style={{\n width: 8,\n height: 8,\n borderRadius: 4,\n background: card.dot,\n }}\n />\n {card.status}\n </span>\n <span\n style={{\n color: C.sub,\n textDecoration: i === 0 ? \"underline\" : undefined,\n }}\n >\n {card.action}\n </span>\n </div>\n </div>\n );\n })}\n </>\n );\n}\n\nfunction Calendar({ l }: { l: DemoLayout }) {\n const { calendar: cal, columns, dayHeaderH, hourH } = l;\n return (\n <>\n {DAYS.map((day, i) => (\n <div\n key={day}\n style={{\n ...abs({\n x: columns[i].x,\n y: cal.y,\n w: columns[i].w,\n h: dayHeaderH,\n }),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontSize: 12,\n fontWeight: i === 0 ? 600 : 400,\n color: i === 0 ? C.ink : C.soft,\n borderLeft: `1px solid ${C.stroke}`,\n borderBottom: `1px solid ${C.stroke}`,\n }}\n >\n {day}\n </div>\n ))}\n {HOURS.slice(0, 4).map((hour, i) => (\n <div\n key={hour}\n style={{\n position: \"absolute\",\n left: cal.x,\n top: cal.y + dayHeaderH + i * hourH - 2,\n width: l.gutter - 10,\n textAlign: \"right\",\n fontSize: 11,\n color: C.soft,\n }}\n >\n {hour}\n </div>\n ))}\n {columns.map((col) => (\n <div\n key={col.x}\n style={{\n position: \"absolute\",\n left: col.x,\n top: cal.y + dayHeaderH,\n width: 1,\n height: cal.h - dayHeaderH,\n background: C.stroke,\n }}\n />\n ))}\n {l.events.map((event) => {\n const tone = TONES[event.tone];\n return (\n <div\n key={`${event.day}-${event.from}`}\n style={{\n ...abs(event.rect),\n borderRadius: l.v === 2 ? 8 : 4,\n background: tone.bg,\n padding: \"6px 8px\",\n fontSize: 11.5,\n fontWeight: 500,\n color: tone.ink,\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n textOverflow: \"ellipsis\",\n }}\n >\n {event.title}\n </div>\n );\n })}\n </>\n );\n}\n\n/** The whole dashboard window, positioned in a 1280x720 frame. */\nfunction DemoDashboard({ v }: { v: Version }) {\n const l = demoLayout(v);\n return (\n <div style={{ position: \"absolute\", inset: 0, fontFamily: FONT }}>\n <div\n style={{\n ...abs(WIN),\n background: C.window,\n borderRadius: 16,\n boxShadow:\n \"0 0 0 1px rgba(10,13,20,0.04), 0 16px 40px -12px rgba(10,13,20,0.12)\",\n }}\n />\n <div\n style={{\n ...abs(WIN),\n borderRadius: 16,\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: -WIN.x,\n top: -WIN.y,\n width: 1280,\n height: 720,\n }}\n >\n <Sidebar l={l} />\n <Header l={l} />\n <Tabs l={l} />\n <Cards l={l} />\n <Calendar l={l} />\n </div>\n </div>\n </div>\n );\n}\n\n/* Marks */\n\n/**\n * Annotation primitives: the redline marks a design review paints over a UI.\n * Each takes a `delay` in frames and draws itself in from there.\n */\n\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nfunction progress(frame: number, start: number, duration: number) {\n return interpolate(frame, [start, start + duration], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n}\n\n/** Pop-in for labels and chips: a cubic ease-out, no overshoot. */\nfunction usePop(delay: number) {\n return progress(useAuditFrame(), delay, 12);\n}\n\nfunction Layer({ children }: { children: ReactNode }) {\n return (\n <svg\n width={1280}\n height={720}\n viewBox=\"0 0 1280 720\"\n style={{ position: \"absolute\", inset: 0, overflow: \"visible\" }}\n >\n {children}\n </svg>\n );\n}\n\ntype Side =\n | \"center\"\n | \"above\"\n | \"below\"\n | \"left\"\n | \"right\"\n | \"aboveStart\"\n | \"aboveEnd\"\n | \"belowStart\";\n\n/** Small spec label: mono text on a solid color chip. */\nfunction Pill({\n x,\n y,\n text,\n color,\n delay = 0,\n anchor = \"center\",\n ink = \"#fff\",\n}: {\n x: number;\n y: number;\n text: string;\n color: string;\n delay?: number;\n anchor?: Side;\n ink?: string;\n}) {\n const pop = usePop(delay);\n const shift = {\n center: \"translate(-50%, -50%)\",\n above: \"translate(-50%, calc(-100% - 5px))\",\n below: \"translate(-50%, 5px)\",\n left: \"translate(calc(-100% - 6px), -50%)\",\n right: \"translate(6px, -50%)\",\n aboveStart: \"translate(0, calc(-100% - 5px))\",\n aboveEnd: \"translate(-100%, calc(-100% - 5px))\",\n belowStart: \"translate(0, 5px)\",\n }[anchor];\n return (\n <div\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n transform: `${shift} scale(${0.7 + 0.3 * pop})`,\n opacity: Math.min(1, pop * 1.4),\n background: color,\n color: ink,\n fontFamily: MONO,\n fontSize: 10.5,\n fontWeight: 600,\n lineHeight: \"15px\",\n padding: \"0 5px\",\n borderRadius: 3,\n whiteSpace: \"nowrap\",\n }}\n >\n {text}\n </div>\n );\n}\n\n/**\n * Measurement between two points on one axis: end ticks snap in, the line\n * grows out from its middle, then the value pops on.\n */\nfunction Ruler({\n from,\n to,\n label,\n color,\n delay = 0,\n labelSide,\n}: {\n from: [number, number];\n to: [number, number];\n label: string;\n color: string;\n delay?: number;\n labelSide?: Side;\n}) {\n const frame = useAuditFrame();\n const grow = progress(frame, delay, 12);\n const ticks = progress(frame, delay - 2, 6);\n const horizontal = Math.abs(to[0] - from[0]) >= Math.abs(to[1] - from[1]);\n const mx = (from[0] + to[0]) / 2;\n const my = (from[1] + to[1]) / 2;\n const x1 = mx + (from[0] - mx) * grow;\n const y1 = my + (from[1] - my) * grow;\n const x2 = mx + (to[0] - mx) * grow;\n const y2 = my + (to[1] - my) * grow;\n const t = 4 * ticks;\n const tick = (x: number, y: number) =>\n horizontal ? `M${x} ${y - t}V${y + t}` : `M${x - t} ${y}H${x + t}`;\n return (\n <>\n <Layer>\n <path\n d={`${tick(...from)}${tick(...to)}`}\n stroke={color}\n strokeWidth={1.25}\n fill=\"none\"\n />\n <line\n x1={x1}\n y1={y1}\n x2={x2}\n y2={y2}\n stroke={color}\n strokeWidth={1.25}\n />\n </Layer>\n <Pill\n x={mx}\n y={my}\n text={label}\n color={color}\n delay={delay + 7}\n anchor={labelSide ?? (horizontal ? \"above\" : \"left\")}\n />\n </>\n );\n}\n\n/** Hairline box traced around an element, clockwise from the top left. */\nfunction OutlineBox({\n rect,\n color,\n delay = 0,\n radius = 3,\n inset = -3,\n dashed,\n fill,\n}: {\n rect: Rect;\n color: string;\n delay?: number;\n radius?: number;\n inset?: number;\n dashed?: boolean;\n fill?: string;\n}) {\n const frame = useAuditFrame();\n const draw = progress(frame, delay, 14);\n const x = rect.x + inset;\n const y = rect.y + inset;\n const w = rect.w - inset * 2;\n const h = rect.h - inset * 2;\n return (\n <Layer>\n <rect\n x={x}\n y={y}\n width={w}\n height={h}\n rx={radius}\n fill={fill ?? \"none\"}\n fillOpacity={draw}\n stroke={color}\n strokeWidth={1.25}\n pathLength={1}\n strokeDasharray={dashed ? undefined : `${draw} 1`}\n strokeOpacity={dashed ? draw : 1}\n style={dashed ? { strokeDasharray: \"3 3\" } : undefined}\n />\n </Layer>\n );\n}\n\n/** Quarter arc swept into a corner to call out its radius. */\nfunction CornerArc({\n x,\n y,\n r,\n color,\n label,\n delay = 0,\n}: {\n x: number;\n y: number;\n r: number;\n color: string;\n label: string;\n delay?: number;\n}) {\n const frame = useAuditFrame();\n const draw = progress(frame, delay, 12);\n const size = Math.max(r, 10) + 4;\n return (\n <>\n <Layer>\n <path\n d={`M${x} ${y + size}A${size} ${size} 0 0 1 ${x + size} ${y}`}\n stroke={color}\n strokeWidth={1.5}\n fill=\"none\"\n pathLength={1}\n strokeDasharray={`${draw} 1`}\n strokeLinecap=\"round\"\n />\n </Layer>\n <Pill\n x={x - 2}\n y={y - 2}\n text={label}\n color={color}\n delay={delay + 8}\n anchor=\"aboveStart\"\n />\n </>\n );\n}\n\n/**\n * Design-token tag: a dot lands on the element, a leader line runs out with\n * one elbow, and a dark chip with the token name settles at its end.\n */\nfunction TokenTag({\n anchor,\n at,\n label,\n swatch,\n delay = 0,\n lineColor = \"#0E121B\",\n}: {\n anchor: [number, number];\n at: [number, number];\n label: string;\n swatch: string;\n delay?: number;\n lineColor?: string;\n}) {\n const frame = useAuditFrame();\n const dot = usePop(delay);\n const draw = progress(frame, delay + 3, 14);\n const elbowY = at[1];\n const path = `M${anchor[0]} ${anchor[1]}L${anchor[0] + (at[0] - anchor[0]) * 0.35} ${elbowY}H${at[0]}`;\n return (\n <>\n <Layer>\n <path\n d={path}\n stroke={lineColor}\n strokeOpacity={0.55}\n strokeWidth={1}\n fill=\"none\"\n pathLength={1}\n strokeDasharray={`${draw} 1`}\n />\n <circle\n cx={anchor[0]}\n cy={anchor[1]}\n r={3.5 * dot}\n fill=\"#fff\"\n stroke={lineColor}\n strokeWidth={1.5}\n />\n </Layer>\n <TokenChip\n x={at[0]}\n y={at[1]}\n label={label}\n swatch={swatch}\n delay={delay + 13}\n />\n </>\n );\n}\n\nfunction TokenChip({\n x,\n y,\n label,\n swatch,\n delay = 0,\n}: {\n x: number;\n y: number;\n label: string;\n swatch: string;\n delay?: number;\n}) {\n const pop = usePop(delay);\n return (\n <div\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n transform: `translate(-50%, -50%) translateY(${(1 - pop) * 6}px)`,\n opacity: Math.min(1, pop * 1.4),\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n background: \"#0E121B\",\n color: \"#fff\",\n fontFamily: MONO,\n fontSize: 11,\n lineHeight: \"22px\",\n padding: \"0 8px\",\n borderRadius: 5,\n whiteSpace: \"nowrap\",\n boxShadow: \"0 4px 10px -4px rgba(10,13,20,0.4)\",\n }}\n >\n <span\n style={{\n width: 8,\n height: 8,\n borderRadius: 4,\n background: swatch,\n boxShadow: \"0 0 0 1px rgba(255,255,255,0.35)\",\n }}\n />\n {label}\n </div>\n );\n}\n\n/** Guide line that drops down (vertical) or slides across (horizontal). */\nfunction Guide({\n x,\n y,\n length,\n vertical,\n color,\n delay = 0,\n dashed,\n width = 1,\n}: {\n x: number;\n y: number;\n length: number;\n vertical?: boolean;\n color: string;\n delay?: number;\n dashed?: boolean;\n width?: number;\n}) {\n const frame = useAuditFrame();\n const draw = progress(frame, delay, 16) * length;\n return (\n <Layer>\n <line\n x1={x}\n y1={y}\n x2={vertical ? x : x + draw}\n y2={vertical ? y + draw : y}\n stroke={color}\n strokeWidth={width}\n strokeDasharray={dashed ? \"4 4\" : undefined}\n />\n </Layer>\n );\n}\n\n/**\n * Scan band: a crisp line with a soft wash trailing behind it, the way the\n * fix pass sweeps the screen. `y` is the line's position.\n */\nfunction ScanBand({\n y,\n color,\n x = 0,\n w = 1280,\n trail = 90,\n opacity = 1,\n}: {\n y: number;\n color: string;\n x?: number;\n w?: number;\n trail?: number;\n opacity?: number;\n}) {\n return (\n <div\n style={{ position: \"absolute\", inset: 0, opacity, pointerEvents: \"none\" }}\n >\n <div\n style={{\n position: \"absolute\",\n left: x,\n width: w,\n top: y - trail,\n height: trail,\n background: `linear-gradient(to bottom, transparent, ${color}2E)`,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n left: x,\n width: w,\n top: y - 1,\n height: 2,\n background: color,\n boxShadow: `0 0 12px 1px ${color}`,\n }}\n />\n </div>\n );\n}\n\n/** Stage-colored wash over everything except one rect, to push focus. */\nfunction Spotlight({\n rect,\n opacity,\n color = C.stage,\n}: {\n rect: Rect;\n opacity: number;\n color?: string;\n}) {\n const pad = 10;\n const x = rect.x - pad;\n const y = rect.y - pad;\n const w = rect.w + pad * 2;\n const h = rect.h + pad * 2;\n const r = 12;\n return (\n <svg\n width={1280}\n height={720}\n style={{ position: \"absolute\", inset: 0, opacity }}\n >\n <path\n fillRule=\"evenodd\"\n fill={color}\n fillOpacity={0.72}\n d={`M0 0H1280V720H0Z M${x + r} ${y}H${x + w - r}Q${x + w} ${y} ${x + w} ${y + r}V${y + h - r}Q${x + w} ${y + h} ${x + w - r} ${y + h}H${x + r}Q${x} ${y + h} ${x} ${y + h - r}V${y + r}Q${x} ${y} ${x + r} ${y}Z`}\n />\n </svg>\n );\n}\n\n/** Two full frames split at `y`: `top` shows above the line, `bottom` below. */\nfunction SplitAt({\n y,\n top,\n bottom,\n}: {\n y: number;\n top: ReactNode;\n bottom: ReactNode;\n}) {\n return (\n <>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n clipPath: `inset(${Math.max(0, y)}px 0 0 0)`,\n }}\n >\n {bottom}\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n clipPath: `inset(0 0 ${Math.max(0, 720 - y)}px 0)`,\n }}\n >\n {top}\n </div>\n </>\n );\n}\n\n/** Cubic ease-in-out between keyframes, clamped at both ends. */\nfunction easeInOut(frame: number, input: number[], output: number[]) {\n return interpolate(frame, input, output, {\n ...clamp,\n easing: Easing.inOut(Easing.cubic),\n });\n}\n\n/* Mark data */\n\ntype Point = [number, number];\n\n/** A distance between two points on one axis, with its value. */\ntype Measure = { from: Point; to: Point; label: string; side?: Side };\n/** A corner whose radius gets an arc and a label. `x`, `y` is the corner. */\ntype RadiusMark = { x: number; y: number; r: number; label: string };\n/** An off-spec element and the fix it needs. */\ntype Issue = {\n rect: Rect;\n note: string;\n side?: \"start\" | \"end\" | \"below\";\n};\n/** A token tag: dot on `anchor`, chip centered on `at`. */\ntype TokenSpec = {\n anchor: Point;\n at: Point;\n label: string;\n swatch: string;\n};\n/** Layout guides over a column grid. */\ntype GuideSpec = {\n /** x of every column edge, left to right. */\n columns: number[];\n top: number;\n bottom: number;\n /** One column (or any rect) to fill and label. */\n highlight?: { rect: Rect; label: string };\n /** A measurement drawn with the guides, like a gutter width. */\n ruler?: Measure;\n /** A horizontal marker line across the grid, like a calendar's now line. */\n now?: { y: number; from: number; to: number; label: string };\n};\n\nconst AUDIT_COLORS = {\n audit: C.error,\n fix: C.blue,\n scan: C.primary,\n ink: C.ink,\n stage: C.stage,\n};\n\n/** Spacing and size redlines across the demo header, tabs and first cards. */\nfunction demoMeasures(l: DemoLayout): Measure[] {\n const card = l.cards[0];\n const next = l.cards[1];\n const tabsBottom = l.tabs[0].y + 32;\n const headerBottom = l.header.y + l.header.h;\n const tabGapX = l.tabs[1].x + l.tabs[1].w + 7;\n const right = l.button.x + l.button.w + 8;\n return [\n {\n from: [l.header.x, l.tabs[0].y + 16],\n to: [l.contentX, l.tabs[0].y + 16],\n label: `pad ${l.pad}`,\n side: \"below\",\n },\n {\n from: [tabGapX, headerBottom],\n to: [tabGapX, l.tabs[0].y],\n label: `${l.tabs[0].y - headerBottom}`,\n side: \"right\",\n },\n {\n from: [next.rect.x + 150, tabsBottom],\n to: [next.rect.x + 150, next.rect.y],\n label: `${next.rect.y - tabsBottom}`,\n side: \"right\",\n },\n {\n from: [card.rect.x + card.rect.w, card.rect.y + 46],\n to: [next.rect.x, card.rect.y + 46],\n label: `gap ${l.gap}`,\n },\n {\n from: [card.rect.x, card.title.y + 9],\n to: [card.title.x, card.title.y + 9],\n label: `${l.cardPad}`,\n side: \"left\",\n },\n {\n from: [card.title.x + 96, card.rect.y],\n to: [card.title.x + 96, card.title.y],\n label: `${l.cardPad}`,\n side: \"right\",\n },\n {\n from: [right, l.button.y],\n to: [right, l.button.y + l.button.h],\n label: `h ${l.button.h}`,\n side: \"below\",\n },\n ];\n}\n\nfunction demoRadii(l: DemoLayout): RadiusMark[] {\n const next = l.cards[1].rect;\n return [{ x: next.x, y: next.y, r: l.radius, label: `radius ${l.radius}` }];\n}\n\nfunction demoIssues(l: DemoLayout): Issue[] {\n return [\n { rect: l.cards[0].title, note: \"13.5 → 14\", side: \"start\" },\n { rect: l.cards[0].status, note: \"radius 4 → 6\", side: \"below\" },\n { rect: l.cards[0].chevron, note: \"hit 20 → 24\", side: \"end\" },\n { rect: l.button, note: \"#8B5CF6 ≠ primary\", side: \"end\" },\n { rect: l.sideActive, note: \"radius 5 → 8\", side: \"start\" },\n { rect: l.events[2].rect, note: \"radius 4 → 8\", side: \"start\" },\n { rect: l.events[6].rect, note: \"pad 6 → 8\", side: \"start\" },\n ];\n}\n\nfunction demoTokens(l: DemoLayout): TokenSpec[] {\n const [c0, c1, c2, c3] = l.cards;\n const chipY = l.calendar.y + 70;\n return [\n {\n anchor: [c0.status.x + 12, c0.status.y + 13],\n at: [c0.rect.x + 50, chipY + 50],\n label: \"state/success/lighter\",\n swatch: C.successBg,\n },\n {\n anchor: [c0.title.x + 40, c0.title.y + 9],\n at: [c0.rect.x + 170, chipY],\n label: \"text/strong-950\",\n swatch: C.ink,\n },\n {\n anchor: [c1.status.x + 12, c1.status.y + 13],\n at: [c1.rect.x + 110, chipY + 92],\n label: \"state/warning/base\",\n swatch: C.warning,\n },\n {\n anchor: [c2.status.x + 12, c2.status.y + 13],\n at: [c2.rect.x + 90, chipY + 20],\n label: \"state/error/base\",\n swatch: C.error,\n },\n {\n anchor: [c3.rect.x + c3.rect.w, c3.rect.y + 40],\n at: [c3.rect.x + 90, chipY + 70],\n label: \"stroke/soft-200\",\n swatch: C.stroke,\n },\n ];\n}\n\nfunction demoGuides(l: DemoLayout): GuideSpec {\n const cal = l.calendar;\n const today = l.columns[0];\n return {\n columns: [...l.columns.map((col) => col.x), cal.x + cal.w],\n top: cal.y,\n bottom: cal.y + cal.h,\n highlight: { rect: today, label: \"Mon 2 · today\" },\n ruler: {\n from: [cal.x, cal.y + l.dayHeaderH + 14],\n to: [cal.x + l.gutter, cal.y + l.dayHeaderH + 14],\n label: `w ${l.gutter}`,\n side: \"below\",\n },\n now: {\n y: cal.y + l.dayHeaderH + 1.25 * l.hourH,\n from: cal.x + l.gutter,\n to: cal.x + cal.w,\n label: \"10:15 AM\",\n },\n };\n}\n\n/** Close-up spec of the first card, sized for a zoomed camera. */\nfunction demoFocus(l: DemoLayout) {\n const card = l.cards[0];\n const r = card.rect;\n const below = r.y + r.h + 34;\n return {\n rect: r,\n measures: [\n {\n from: [r.x, card.title.y + 9],\n to: [card.title.x, card.title.y + 9],\n label: `${l.cardPad}`,\n side: \"below\",\n },\n {\n from: [card.title.x + 110, r.y],\n to: [card.title.x + 110, card.title.y],\n label: `${l.cardPad}`,\n side: \"right\",\n },\n {\n from: [r.x + r.w + 8, card.status.y],\n to: [r.x + r.w + 8, card.status.y + card.status.h],\n label: `h ${card.status.h}`,\n side: \"right\",\n },\n {\n from: [card.chevron.x - 2, card.chevron.y - 6],\n to: [card.chevron.x + card.chevron.w + 2, card.chevron.y - 6],\n label: \"24\",\n },\n ] as Measure[],\n radii: [{ x: r.x, y: r.y, r: l.radius, label: `radius ${l.radius}` }],\n tokens: [\n {\n anchor: [card.status.x + 12, card.status.y + 13],\n at: [r.x + 40, below],\n label: \"state/success/base\",\n swatch: C.success,\n },\n {\n anchor: [card.title.x + 60, card.title.y + 9],\n at: [r.x + 205, below - 4],\n label: \"text/strong-950\",\n swatch: C.ink,\n },\n {\n anchor: [card.time.x + 40, card.time.y + 8],\n at: [r.x + 70, below + 30],\n label: \"text/sub-600\",\n swatch: C.sub,\n },\n {\n anchor: [r.x + r.w, r.y + 30],\n at: [r.x + 230, below + 30],\n label: \"stroke/soft-200\",\n swatch: C.stroke,\n },\n ] as TokenSpec[],\n };\n}\n\nfunction demoSet(v: Version) {\n const l = demoLayout(v);\n return {\n layout: l,\n measures: demoMeasures(l),\n radii: demoRadii(l),\n issues: demoIssues(l),\n tokens: demoTokens(l),\n guides: demoGuides(l),\n focus: demoFocus(l),\n /** Rect around the tabs and the card row. */\n cardRow: {\n x: l.contentX,\n y: l.tabs[0].y,\n w: l.calendar.w,\n h: l.cards[0].rect.y + 92 - l.tabs[0].y,\n } satisfies Rect,\n };\n}\n\n/** Mark data measured off the demo dashboard: `before` is v1, `after` v2. */\nconst DEMO = { before: demoSet(1), after: demoSet(2) };\nconst DEMO_WINDOW = WIN;\n\n/* Mark sets */\n\n/** Rulers then radius arcs, each `stagger` frames after the last. */\nfunction MeasureMarks({\n measures,\n radii = [],\n color,\n start = 0,\n stagger = 5,\n}: {\n measures: Measure[];\n radii?: RadiusMark[];\n color: string;\n start?: number;\n stagger?: number;\n}) {\n return (\n <>\n {measures.map((m, i) => (\n <Ruler\n key={`${m.from.join()}-${m.to.join()}`}\n from={m.from}\n to={m.to}\n label={m.label}\n color={color}\n delay={start + i * stagger}\n labelSide={m.side}\n />\n ))}\n {radii.map((r, i) => (\n <CornerArc\n key={`${r.x}-${r.y}`}\n x={r.x}\n y={r.y}\n r={r.r}\n label={r.label}\n color={color}\n delay={start + (measures.length + i) * stagger}\n />\n ))}\n </>\n );\n}\n\nconst NOTE_SPOT = {\n start: (r: Rect) => ({\n x: r.x - 3,\n y: r.y - 3,\n anchor: \"aboveStart\" as const,\n }),\n end: (r: Rect) => ({\n x: r.x + r.w + 3,\n y: r.y - 3,\n anchor: \"aboveEnd\" as const,\n }),\n below: (r: Rect) => ({\n x: r.x - 3,\n y: r.y + r.h + 3,\n anchor: \"belowStart\" as const,\n }),\n};\n\n/** Every issue boxed, with its note popping on once the box closes. */\nfunction IssueMarks({\n issues,\n color,\n start = 0,\n stagger = 4,\n}: {\n issues: Issue[];\n color: string;\n start?: number;\n stagger?: number;\n}) {\n return (\n <>\n {issues.map((issue, i) => (\n <div key={`${issue.rect.x}-${issue.rect.y}-${issue.note}`}>\n <OutlineBox\n rect={issue.rect}\n color={color}\n delay={start + i * stagger}\n />\n <Pill\n {...NOTE_SPOT[issue.side ?? \"start\"](issue.rect)}\n text={issue.note}\n color={color}\n delay={start + i * stagger + 10}\n />\n </div>\n ))}\n </>\n );\n}\n\nfunction TokenMarks({\n tokens,\n start = 0,\n stagger = 6,\n lineColor,\n}: {\n tokens: TokenSpec[];\n start?: number;\n stagger?: number;\n lineColor?: string;\n}) {\n return (\n <>\n {tokens.map((tag, i) => (\n <TokenTag\n key={`${tag.label}-${tag.anchor.join()}`}\n anchor={tag.anchor}\n at={tag.at}\n label={tag.label}\n swatch={tag.swatch}\n lineColor={lineColor}\n delay={start + i * stagger}\n />\n ))}\n </>\n );\n}\n\n/** Column guides drop in, the highlight fills, then the now line slides across. */\nfunction GuideMarks({\n guides,\n color,\n nowColor = C.primary,\n start = 0,\n}: {\n guides: GuideSpec;\n color: string;\n nowColor?: string;\n start?: number;\n}) {\n const { columns, top, bottom, highlight, ruler, now } = guides;\n const h = highlight?.rect;\n return (\n <>\n {columns.map((x, i) => (\n <Guide\n key={x}\n x={x}\n y={top}\n length={bottom - top}\n vertical\n color={color}\n dashed\n delay={start + i * 3}\n />\n ))}\n {h && highlight && (\n <>\n <OutlineBox\n rect={h}\n color={color}\n fill={`${color}14`}\n inset={0}\n radius={0}\n delay={start + 14}\n />\n <OutlineBox\n rect={{ x: h.x + 6, y: h.y + 4, w: h.w - 12, h: 22 }}\n color={color}\n radius={4}\n inset={0}\n delay={start + 20}\n />\n <Pill\n x={h.x + h.w / 2}\n y={h.y + 4}\n text={highlight.label}\n color={color}\n delay={start + 26}\n anchor=\"above\"\n />\n </>\n )}\n {ruler && (\n <Ruler\n from={ruler.from}\n to={ruler.to}\n label={ruler.label}\n color={color}\n delay={start + 24}\n labelSide={ruler.side}\n />\n )}\n {now && (\n <>\n <Guide\n x={now.from}\n y={now.y}\n length={now.to - now.from}\n color={nowColor}\n width={1.5}\n delay={start + 30}\n />\n <Pill\n x={now.from}\n y={now.y}\n text={now.label}\n color={nowColor}\n delay={start + 30}\n anchor=\"left\"\n />\n </>\n )}\n </>\n );\n}\n\n/** Brand name with a version chip that flips once the fix lands. */\nfunction VersionChip({\n brand,\n versions,\n fixed,\n colors,\n}: {\n brand: string;\n versions: [string, string];\n fixed: boolean;\n colors: [string, string];\n}) {\n return (\n <div\n style={{\n position: \"absolute\",\n left: WIN.x,\n top: 26,\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n fontSize: 15,\n fontWeight: 600,\n color: C.ink,\n }}\n >\n {brand}\n <span\n style={{\n fontFamily: MONO,\n fontSize: 11,\n color: \"#fff\",\n background: fixed ? colors[1] : colors[0],\n borderRadius: 999,\n padding: \"1px 8px\",\n }}\n >\n {fixed ? versions[1] : versions[0]}\n </span>\n </div>\n );\n}\n\ntype LayoutGuidesProps = {\n /** UI to lay guides over, in a 1280x720 frame. Defaults to a demo calendar dashboard. */\n children?: ReactNode;\n /** Column edges, highlight, ruler and now line, in frame pixels. */\n guides?: GuideSpec;\n color?: string;\n /** Color of the now line and its label. */\n nowColor?: string;\n background?: string;\n speed?: number;\n};\n\nconst layoutGuidesDefaults = {\n color: AUDIT_COLORS.fix,\n nowColor: AUDIT_COLORS.scan,\n background: AUDIT_COLORS.stage,\n speed: 1,\n};\n\nconst layoutGuidesLength = 54;\n\nfunction LayoutGuidesBase(props: LayoutGuidesProps) {\n const { speed = 1 } = props;\n return (\n <AuditClock speed={speed}>\n <Scene {...props} />\n </AuditClock>\n );\n}\n\nfunction Scene({\n children,\n guides = children ? undefined : DEMO.after.guides,\n color = layoutGuidesDefaults.color,\n nowColor = layoutGuidesDefaults.nowColor,\n background = layoutGuidesDefaults.background,\n}: LayoutGuidesProps) {\n return (\n <AbsoluteFill style={{ background, fontFamily: FONT }}>\n {children ?? <DemoDashboard v={2} />}\n {guides && (\n <GuideMarks\n guides={guides}\n color={color}\n nowColor={nowColor}\n start={8}\n />\n )}\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n color: {\n type: \"color\",\n default: \"#335CFF\",\n description: \"Guides\",\n },\n nowColor: {\n type: \"color\",\n default: \"#7D52F4\",\n description: \"Now line\",\n },\n background: {\n type: \"color\",\n default: \"#EDEDEF\",\n description: \"Background\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"color\",\"nowColor\",\"background\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n color: \"#335CFF\",\n nowColor: \"#7D52F4\",\n background: \"#EDEDEF\",\n speed: 1,\n};\n\ntype LayoutGuidesElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof LayoutGuidesBase>;\n\nconst LayoutGuidesInner = forwardRef<\n HTMLDivElement,\n LayoutGuidesElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<LayoutGuides>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <LayoutGuidesBase\n {...(componentProps as unknown as ComponentProps<typeof LayoutGuidesBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const LayoutGuides = Interactive.withSchema({\n Component: LayoutGuidesInner,\n componentName: \"<LayoutGuides>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 54+}diff --git a/registry-artifacts/elements/redline-measure.json b/registry-artifacts/elements/redline-measure.jsonnew file mode 100644index 00000000..3d235bd1--- /dev/null+++ b/registry-artifacts/elements/redline-measure.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Redline Measure",+ "durationInFrames": 63,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "redline-measure",+ "sourceCode": "import { createContext, forwardRef, useContext, useImperativeHandle, useRef, type CSSProperties, type ComponentProps, type ReactNode } from \"react\";\nimport { AbsoluteFill, Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\n/**\n * Shared kit behind the design-review family (redline-measure, audit-boxes,\n * scan-fix, token-tags, layout-guides, design-audit): the annotation marks a\n * design review paints over a UI, the scan band that sweeps a fix across it,\n * and a demo calendar dashboard the marks are measured against by default.\n *\n * Every coordinate is in composition pixels of a 1280x720 frame.\n */\n\nconst AuditSpeed = createContext(1);\n\n/** Scales the clock every mark below it reads. */\nfunction AuditClock({\n speed,\n children,\n}: {\n speed: number;\n children: ReactNode;\n}) {\n return <AuditSpeed.Provider value={speed}>{children}</AuditSpeed.Provider>;\n}\n\nfunction useAuditFrame() {\n return useCurrentFrame() * useContext(AuditSpeed);\n}\n\n/* Demo dashboard */\n/**\n * A calendar dashboard drawn from one layout function, so every annotation\n * can measure the exact rects the UI paints. Version 1 is the \"before\"\n * build with drifted spacing and radii, version 2 is the fixed one.\n */\n\ntype Rect = { x: number; y: number; w: number; h: number };\ntype Version = 1 | 2;\n\nconst FONT =\n \"Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\";\nconst MONO = \"ui-monospace, 'SF Mono', Menlo, Consolas, monospace\";\n\nconst C = {\n stage: \"#EDEDEF\",\n window: \"#FFFFFF\",\n ink: \"#0E121B\",\n sub: \"#525866\",\n soft: \"#99A0AE\",\n stroke: \"#E1E4EA\",\n weak: \"#F5F7FA\",\n primary: \"#7D52F4\",\n success: \"#1FC16B\",\n successBg: \"#E0FAEC\",\n warning: \"#FA7319\",\n warningBg: \"#FFF1EB\",\n error: \"#FB3748\",\n errorBg: \"#FFEBEC\",\n blue: \"#335CFF\",\n blueBg: \"#EBF1FF\",\n orangeBg: \"#FFF3EB\",\n purpleBg: \"#EFEBFF\",\n};\n\nconst WIN: Rect = { x: 80, y: 64, w: 1120, h: 616 };\nconst SIDE_W = 216;\nconst HEADER_H = 56;\nconst MAIN_X = WIN.x + SIDE_W;\nconst MAIN_R = WIN.x + WIN.w;\n\nconst CARDS = [\n {\n title: \"Weekly team meeting\",\n time: \"3:00 – 4:30 PM\",\n status: \"Today\",\n action: \"Join meeting\",\n dot: C.success,\n bg: C.successBg,\n },\n {\n title: \"Product launch event\",\n time: \"11:00 AM – 12:30 PM\",\n status: \"2 conflicts\",\n action: \"Review\",\n dot: C.warning,\n bg: C.warningBg,\n },\n {\n title: \"Team building workshop\",\n time: \"10:00 AM – 1:00 PM\",\n status: \"Canceled\",\n action: \"Fri, Nov 6\",\n dot: C.error,\n bg: C.errorBg,\n },\n {\n title: \"Marketing campaign\",\n time: \"2:30 – 4:00 PM\",\n status: \"In 3 days\",\n action: \"Thu, Nov 5\",\n dot: C.soft,\n bg: C.weak,\n },\n];\n\nconst TABS = [\n { label: \"All scheduled\", count: \"15\" },\n { label: \"Meetings\", count: \"12\" },\n { label: \"Events\", count: \"3\" },\n { label: \"Conflicted\", count: \"2\" },\n { label: \"Canceled\", count: \"1\" },\n];\n\nconst DAYS = [\"Mon 2\", \"Tue 3\", \"Wed 4\", \"Thu 5\", \"Fri 6\"];\nconst HOURS = [\"9 AM\", \"10 AM\", \"11 AM\", \"12 PM\", \"1 PM\"];\n\nconst EVENTS = [\n { day: 0, from: 0, to: 0.5, title: \"Brainstorming session\", tone: \"gray\" },\n { day: 0, from: 0.55, to: 1.05, title: \"Bi-weekly sync\", tone: \"gray\" },\n { day: 1, from: 0, to: 0.45, title: \"Project review\", tone: \"blue\" },\n { day: 1, from: 1.05, to: 2.6, title: \"Sales team training\", tone: \"blue\" },\n { day: 2, from: 0.5, to: 1.0, title: \"Marketing strategy\", tone: \"blue\" },\n { day: 2, from: 2.6, to: 3.6, title: \"Interview: frontend\", tone: \"purple\" },\n { day: 3, from: 0, to: 1.0, title: \"Customer feedback\", tone: \"blue\" },\n { day: 3, from: 2.2, to: 3.4, title: \"Product launch\", tone: \"orange\" },\n { day: 0, from: 2.5, to: 3.7, title: \"Workshop: design\", tone: \"orange\" },\n { day: 4, from: 1.1, to: 3.7, title: \"Team building\", tone: \"gray\" },\n] as const;\n\nconst TONES = {\n gray: { bg: C.weak, ink: C.sub },\n blue: { bg: C.blueBg, ink: \"#2547D0\" },\n purple: { bg: C.purpleBg, ink: \"#5B3CC4\" },\n orange: { bg: C.orangeBg, ink: \"#C2540A\" },\n};\n\n/** Every rect the dashboard paints, in composition pixels. */\nfunction demoLayout(v: Version) {\n const pad = v === 2 ? 24 : 20;\n const gap = v === 2 ? 16 : 10;\n const cardPad = v === 2 ? 16 : 12;\n const radius = v === 2 ? 12 : 6;\n const contentX = MAIN_X + pad;\n const contentW = MAIN_R - pad - contentX;\n\n const header: Rect = { x: MAIN_X, y: WIN.y, w: MAIN_R - MAIN_X, h: HEADER_H };\n const button: Rect = {\n x: MAIN_R - pad - 128,\n y: WIN.y + 12,\n w: 128,\n h: v === 2 ? 32 : 34,\n };\n const tabsY = WIN.y + HEADER_H + (v === 2 ? 16 : 12);\n let tabX = contentX;\n const tabs = TABS.map((tab, i) => {\n const w = 46 + tab.label.length * 7.4 + (i === 0 ? 26 : 0);\n const rect: Rect = { x: tabX, y: tabsY, w, h: 32 };\n tabX += w + 14;\n return rect;\n });\n\n const cardsY = tabsY + 32 + (v === 2 ? 16 : 12);\n const cardW = (contentW - gap * 3) / 4;\n const cards = CARDS.map((_, i) => {\n const rect: Rect = {\n x: contentX + i * (cardW + gap),\n y: cardsY,\n w: cardW,\n h: 92,\n };\n return {\n rect,\n title: { x: rect.x + cardPad, y: rect.y + cardPad, w: 150, h: 18 },\n time: { x: rect.x + cardPad, y: rect.y + cardPad + 21, w: 110, h: 15 },\n status: {\n x: rect.x + cardPad - 4,\n y: rect.y + rect.h - cardPad - 24,\n w: rect.w - cardPad * 2 + 8,\n h: 26,\n },\n chevron: {\n x: rect.x + rect.w - cardPad - 20,\n y: rect.y + cardPad - 2,\n w: 20,\n h: 20,\n },\n };\n });\n\n const calY = cardsY + 92 + 22;\n const calendar: Rect = {\n x: contentX,\n y: calY,\n w: contentW,\n h: WIN.y + WIN.h - calY - 16,\n };\n const gutter = 56;\n const colW = (contentW - gutter) / DAYS.length;\n const dayHeaderH = 30;\n const hourH = (calendar.h - dayHeaderH) / 4;\n const columns = DAYS.map(\n (_, i): Rect => ({\n x: contentX + gutter + i * colW,\n y: calY,\n w: colW,\n h: calendar.h,\n }),\n );\n const events = EVENTS.map((event) => ({\n ...event,\n rect: {\n x: columns[event.day].x + 4,\n y: calY + dayHeaderH + event.from * hourH + 3,\n w: colW - 8,\n h: (event.to - event.from) * hourH - 6,\n } satisfies Rect,\n }));\n\n return {\n v,\n pad,\n gap,\n cardPad,\n radius,\n contentX,\n header,\n button,\n tabs,\n cards,\n calendar,\n columns,\n gutter,\n dayHeaderH,\n hourH,\n events,\n sidebar: { x: WIN.x, y: WIN.y, w: SIDE_W, h: WIN.h } satisfies Rect,\n sideActive: { x: WIN.x + 10, y: WIN.y + 158, w: SIDE_W - 20, h: 30 },\n };\n}\n\ntype DemoLayout = ReturnType<typeof demoLayout>;\n\nconst abs = (r: Rect): CSSProperties => ({\n position: \"absolute\",\n left: r.x,\n top: r.y,\n width: r.w,\n height: r.h,\n});\n\nfunction Glyph({\n size = 14,\n color = C.soft,\n}: {\n size?: number;\n color?: string;\n}) {\n return (\n <div\n style={{\n width: size,\n height: size,\n borderRadius: 4,\n border: `1.5px solid ${color}`,\n flexShrink: 0,\n }}\n />\n );\n}\n\nconst SIDE_ITEMS: (string | { section: string })[] = [\n \"Inbox\",\n \"Dashboard\",\n { section: \"Workspace\" },\n \"Calendar\",\n \"Time off\",\n \"People\",\n \"Payroll\",\n \"Projects\",\n \"Documents\",\n { section: \"Favorites\" },\n \"Loom Mobile App\",\n \"Monday Re-design\",\n \"Udemy Courses\",\n];\n\nfunction Sidebar({ l }: { l: DemoLayout }) {\n let y = WIN.y + 68;\n return (\n <>\n <div\n style={{\n ...abs({ x: WIN.x, y: WIN.y, w: SIDE_W, h: WIN.h }),\n borderRight: `1px solid ${C.stroke}`,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n left: WIN.x + 18,\n top: WIN.y + 18,\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n fontSize: 14,\n fontWeight: 600,\n color: C.ink,\n }}\n >\n <div\n style={{\n width: 22,\n height: 22,\n borderRadius: 11,\n background: C.primary,\n }}\n />\n Synergy\n </div>\n {SIDE_ITEMS.map((item) => {\n const top = y;\n if (typeof item !== \"string\") {\n y += 30;\n return (\n <div\n key={item.section}\n style={{\n position: \"absolute\",\n left: WIN.x + 20,\n top: top + 10,\n fontSize: 11,\n letterSpacing: \"0.04em\",\n textTransform: \"uppercase\",\n color: C.soft,\n }}\n >\n {item.section}\n </div>\n );\n }\n y += 30;\n const active = item === \"Calendar\";\n return (\n <div\n key={item}\n style={{\n ...abs(\n active\n ? l.sideActive\n : { x: WIN.x + 10, y: top, w: SIDE_W - 20, h: 30 },\n ),\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n paddingLeft: 10,\n borderRadius: l.v === 2 ? 8 : 5,\n background: active ? C.weak : undefined,\n fontSize: 13,\n fontWeight: active ? 500 : 400,\n color: active ? C.ink : C.sub,\n }}\n >\n <Glyph color={active ? C.primary : C.soft} />\n {item}\n </div>\n );\n })}\n <div\n style={{\n position: \"absolute\",\n left: WIN.x + 18,\n top: WIN.y + WIN.h - 44,\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n fontSize: 13,\n color: C.ink,\n }}\n >\n <div\n style={{\n width: 26,\n height: 26,\n borderRadius: 13,\n background: \"linear-gradient(135deg,#FBC5A6,#F17B6A)\",\n }}\n />\n Olivia Hart\n </div>\n </>\n );\n}\n\nfunction Header({ l }: { l: DemoLayout }) {\n return (\n <>\n <div\n style={{\n ...abs(l.header),\n borderBottom: `1px solid ${C.stroke}`,\n display: \"flex\",\n alignItems: \"center\",\n gap: 12,\n paddingLeft: l.pad,\n fontSize: 14,\n }}\n >\n <Glyph size={16} color={C.sub} />\n <span style={{ fontWeight: 600, color: C.ink }}>\n Monday, November 2\n </span>\n <span style={{ color: C.soft }}>\n You have 3 meetings and 1 event today.\n </span>\n </div>\n <div\n style={{\n ...abs({ x: l.button.x - 104, y: l.button.y, w: 92, h: l.button.h }),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: 6,\n borderRadius: l.v === 2 ? 8 : 6,\n border: `1px solid ${C.stroke}`,\n fontSize: 13,\n color: C.sub,\n }}\n >\n Schedule\n </div>\n <div\n style={{\n ...abs(l.button),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: l.v === 2 ? 8 : 6,\n background: l.v === 2 ? C.primary : \"#8B5CF6\",\n color: \"#fff\",\n fontSize: 13,\n fontWeight: 500,\n }}\n >\n + Create event\n </div>\n </>\n );\n}\n\nfunction Tabs({ l }: { l: DemoLayout }) {\n return (\n <>\n {TABS.map((tab, i) => (\n <div\n key={tab.label}\n style={{\n ...abs(l.tabs[i]),\n display: \"flex\",\n alignItems: \"center\",\n gap: 7,\n fontSize: 13,\n fontWeight: i === 0 ? 500 : 400,\n color: i === 0 ? C.ink : C.sub,\n borderBottom: i === 0 ? `2px solid ${C.primary}` : undefined,\n }}\n >\n <Glyph color={i === 0 ? C.primary : C.soft} />\n {tab.label}\n <span\n style={{\n fontSize: 11,\n fontWeight: 500,\n color: i === 0 ? \"#fff\" : C.soft,\n background:\n i === 0 ? (l.v === 2 ? C.primary : \"#8B5CF6\") : undefined,\n borderRadius: 8,\n padding: i === 0 ? \"1px 6px\" : 0,\n }}\n >\n {tab.count}\n </span>\n </div>\n ))}\n <div\n style={{\n position: \"absolute\",\n left: l.contentX,\n top: l.tabs[0].y + 32,\n width: WIN.x + WIN.w - l.pad - l.contentX,\n height: 1,\n background: C.stroke,\n }}\n />\n </>\n );\n}\n\nfunction Cards({ l }: { l: DemoLayout }) {\n return (\n <>\n {CARDS.map((card, i) => {\n const r = l.cards[i];\n return (\n <div key={card.title}>\n <div\n style={{\n ...abs(r.rect),\n borderRadius: l.radius,\n border: `1px solid ${C.stroke}`,\n background: \"#fff\",\n boxShadow: \"0 1px 2px rgba(10,13,20,0.04)\",\n }}\n />\n <div\n style={{\n ...abs(r.title),\n width: r.rect.w - l.cardPad * 2 - 24,\n fontSize: l.v === 2 ? 14 : 13.5,\n fontWeight: 600,\n color: C.ink,\n whiteSpace: \"nowrap\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n }}\n >\n {card.title}\n </div>\n <div\n style={{ ...abs(r.time), width: 160, fontSize: 12, color: C.sub }}\n >\n {card.time}\n </div>\n <div\n style={{\n ...abs(r.chevron),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: C.soft,\n fontSize: 11,\n }}\n >\n ⌄\n </div>\n <div\n style={{\n ...abs(r.status),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n padding: \"0 8px\",\n borderRadius: l.v === 2 ? 6 : 4,\n background: card.bg,\n fontSize: 12,\n }}\n >\n <span\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n color: C.ink,\n }}\n >\n <span\n style={{\n width: 8,\n height: 8,\n borderRadius: 4,\n background: card.dot,\n }}\n />\n {card.status}\n </span>\n <span\n style={{\n color: C.sub,\n textDecoration: i === 0 ? \"underline\" : undefined,\n }}\n >\n {card.action}\n </span>\n </div>\n </div>\n );\n })}\n </>\n );\n}\n\nfunction Calendar({ l }: { l: DemoLayout }) {\n const { calendar: cal, columns, dayHeaderH, hourH } = l;\n return (\n <>\n {DAYS.map((day, i) => (\n <div\n key={day}\n style={{\n ...abs({\n x: columns[i].x,\n y: cal.y,\n w: columns[i].w,\n h: dayHeaderH,\n }),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontSize: 12,\n fontWeight: i === 0 ? 600 : 400,\n color: i === 0 ? C.ink : C.soft,\n borderLeft: `1px solid ${C.stroke}`,\n borderBottom: `1px solid ${C.stroke}`,\n }}\n >\n {day}\n </div>\n ))}\n {HOURS.slice(0, 4).map((hour, i) => (\n <div\n key={hour}\n style={{\n position: \"absolute\",\n left: cal.x,\n top: cal.y + dayHeaderH + i * hourH - 2,\n width: l.gutter - 10,\n textAlign: \"right\",\n fontSize: 11,\n color: C.soft,\n }}\n >\n {hour}\n </div>\n ))}\n {columns.map((col) => (\n <div\n key={col.x}\n style={{\n position: \"absolute\",\n left: col.x,\n top: cal.y + dayHeaderH,\n width: 1,\n height: cal.h - dayHeaderH,\n background: C.stroke,\n }}\n />\n ))}\n {l.events.map((event) => {\n const tone = TONES[event.tone];\n return (\n <div\n key={`${event.day}-${event.from}`}\n style={{\n ...abs(event.rect),\n borderRadius: l.v === 2 ? 8 : 4,\n background: tone.bg,\n padding: \"6px 8px\",\n fontSize: 11.5,\n fontWeight: 500,\n color: tone.ink,\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n textOverflow: \"ellipsis\",\n }}\n >\n {event.title}\n </div>\n );\n })}\n </>\n );\n}\n\n/** The whole dashboard window, positioned in a 1280x720 frame. */\nfunction DemoDashboard({ v }: { v: Version }) {\n const l = demoLayout(v);\n return (\n <div style={{ position: \"absolute\", inset: 0, fontFamily: FONT }}>\n <div\n style={{\n ...abs(WIN),\n background: C.window,\n borderRadius: 16,\n boxShadow:\n \"0 0 0 1px rgba(10,13,20,0.04), 0 16px 40px -12px rgba(10,13,20,0.12)\",\n }}\n />\n <div\n style={{\n ...abs(WIN),\n borderRadius: 16,\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: -WIN.x,\n top: -WIN.y,\n width: 1280,\n height: 720,\n }}\n >\n <Sidebar l={l} />\n <Header l={l} />\n <Tabs l={l} />\n <Cards l={l} />\n <Calendar l={l} />\n </div>\n </div>\n </div>\n );\n}\n\n/* Marks */\n\n/**\n * Annotation primitives: the redline marks a design review paints over a UI.\n * Each takes a `delay` in frames and draws itself in from there.\n */\n\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nfunction progress(frame: number, start: number, duration: number) {\n return interpolate(frame, [start, start + duration], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n}\n\n/** Pop-in for labels and chips: a cubic ease-out, no overshoot. */\nfunction usePop(delay: number) {\n return progress(useAuditFrame(), delay, 12);\n}\n\nfunction Layer({ children }: { children: ReactNode }) {\n return (\n <svg\n width={1280}\n height={720}\n viewBox=\"0 0 1280 720\"\n style={{ position: \"absolute\", inset: 0, overflow: \"visible\" }}\n >\n {children}\n </svg>\n );\n}\n\ntype Side =\n | \"center\"\n | \"above\"\n | \"below\"\n | \"left\"\n | \"right\"\n | \"aboveStart\"\n | \"aboveEnd\"\n | \"belowStart\";\n\n/** Small spec label: mono text on a solid color chip. */\nfunction Pill({\n x,\n y,\n text,\n color,\n delay = 0,\n anchor = \"center\",\n ink = \"#fff\",\n}: {\n x: number;\n y: number;\n text: string;\n color: string;\n delay?: number;\n anchor?: Side;\n ink?: string;\n}) {\n const pop = usePop(delay);\n const shift = {\n center: \"translate(-50%, -50%)\",\n above: \"translate(-50%, calc(-100% - 5px))\",\n below: \"translate(-50%, 5px)\",\n left: \"translate(calc(-100% - 6px), -50%)\",\n right: \"translate(6px, -50%)\",\n aboveStart: \"translate(0, calc(-100% - 5px))\",\n aboveEnd: \"translate(-100%, calc(-100% - 5px))\",\n belowStart: \"translate(0, 5px)\",\n }[anchor];\n return (\n <div\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n transform: `${shift} scale(${0.7 + 0.3 * pop})`,\n opacity: Math.min(1, pop * 1.4),\n background: color,\n color: ink,\n fontFamily: MONO,\n fontSize: 10.5,\n fontWeight: 600,\n lineHeight: \"15px\",\n padding: \"0 5px\",\n borderRadius: 3,\n whiteSpace: \"nowrap\",\n }}\n >\n {text}\n </div>\n );\n}\n\n/**\n * Measurement between two points on one axis: end ticks snap in, the line\n * grows out from its middle, then the value pops on.\n */\nfunction Ruler({\n from,\n to,\n label,\n color,\n delay = 0,\n labelSide,\n}: {\n from: [number, number];\n to: [number, number];\n label: string;\n color: string;\n delay?: number;\n labelSide?: Side;\n}) {\n const frame = useAuditFrame();\n const grow = progress(frame, delay, 12);\n const ticks = progress(frame, delay - 2, 6);\n const horizontal = Math.abs(to[0] - from[0]) >= Math.abs(to[1] - from[1]);\n const mx = (from[0] + to[0]) / 2;\n const my = (from[1] + to[1]) / 2;\n const x1 = mx + (from[0] - mx) * grow;\n const y1 = my + (from[1] - my) * grow;\n const x2 = mx + (to[0] - mx) * grow;\n const y2 = my + (to[1] - my) * grow;\n const t = 4 * ticks;\n const tick = (x: number, y: number) =>\n horizontal ? `M${x} ${y - t}V${y + t}` : `M${x - t} ${y}H${x + t}`;\n return (\n <>\n <Layer>\n <path\n d={`${tick(...from)}${tick(...to)}`}\n stroke={color}\n strokeWidth={1.25}\n fill=\"none\"\n />\n <line\n x1={x1}\n y1={y1}\n x2={x2}\n y2={y2}\n stroke={color}\n strokeWidth={1.25}\n />\n </Layer>\n <Pill\n x={mx}\n y={my}\n text={label}\n color={color}\n delay={delay + 7}\n anchor={labelSide ?? (horizontal ? \"above\" : \"left\")}\n />\n </>\n );\n}\n\n/** Hairline box traced around an element, clockwise from the top left. */\nfunction OutlineBox({\n rect,\n color,\n delay = 0,\n radius = 3,\n inset = -3,\n dashed,\n fill,\n}: {\n rect: Rect;\n color: string;\n delay?: number;\n radius?: number;\n inset?: number;\n dashed?: boolean;\n fill?: string;\n}) {\n const frame = useAuditFrame();\n const draw = progress(frame, delay, 14);\n const x = rect.x + inset;\n const y = rect.y + inset;\n const w = rect.w - inset * 2;\n const h = rect.h - inset * 2;\n return (\n <Layer>\n <rect\n x={x}\n y={y}\n width={w}\n height={h}\n rx={radius}\n fill={fill ?? \"none\"}\n fillOpacity={draw}\n stroke={color}\n strokeWidth={1.25}\n pathLength={1}\n strokeDasharray={dashed ? undefined : `${draw} 1`}\n strokeOpacity={dashed ? draw : 1}\n style={dashed ? { strokeDasharray: \"3 3\" } : undefined}\n />\n </Layer>\n );\n}\n\n/** Quarter arc swept into a corner to call out its radius. */\nfunction CornerArc({\n x,\n y,\n r,\n color,\n label,\n delay = 0,\n}: {\n x: number;\n y: number;\n r: number;\n color: string;\n label: string;\n delay?: number;\n}) {\n const frame = useAuditFrame();\n const draw = progress(frame, delay, 12);\n const size = Math.max(r, 10) + 4;\n return (\n <>\n <Layer>\n <path\n d={`M${x} ${y + size}A${size} ${size} 0 0 1 ${x + size} ${y}`}\n stroke={color}\n strokeWidth={1.5}\n fill=\"none\"\n pathLength={1}\n strokeDasharray={`${draw} 1`}\n strokeLinecap=\"round\"\n />\n </Layer>\n <Pill\n x={x - 2}\n y={y - 2}\n text={label}\n color={color}\n delay={delay + 8}\n anchor=\"aboveStart\"\n />\n </>\n );\n}\n\n/**\n * Design-token tag: a dot lands on the element, a leader line runs out with\n * one elbow, and a dark chip with the token name settles at its end.\n */\nfunction TokenTag({\n anchor,\n at,\n label,\n swatch,\n delay = 0,\n lineColor = \"#0E121B\",\n}: {\n anchor: [number, number];\n at: [number, number];\n label: string;\n swatch: string;\n delay?: number;\n lineColor?: string;\n}) {\n const frame = useAuditFrame();\n const dot = usePop(delay);\n const draw = progress(frame, delay + 3, 14);\n const elbowY = at[1];\n const path = `M${anchor[0]} ${anchor[1]}L${anchor[0] + (at[0] - anchor[0]) * 0.35} ${elbowY}H${at[0]}`;\n return (\n <>\n <Layer>\n <path\n d={path}\n stroke={lineColor}\n strokeOpacity={0.55}\n strokeWidth={1}\n fill=\"none\"\n pathLength={1}\n strokeDasharray={`${draw} 1`}\n />\n <circle\n cx={anchor[0]}\n cy={anchor[1]}\n r={3.5 * dot}\n fill=\"#fff\"\n stroke={lineColor}\n strokeWidth={1.5}\n />\n </Layer>\n <TokenChip\n x={at[0]}\n y={at[1]}\n label={label}\n swatch={swatch}\n delay={delay + 13}\n />\n </>\n );\n}\n\nfunction TokenChip({\n x,\n y,\n label,\n swatch,\n delay = 0,\n}: {\n x: number;\n y: number;\n label: string;\n swatch: string;\n delay?: number;\n}) {\n const pop = usePop(delay);\n return (\n <div\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n transform: `translate(-50%, -50%) translateY(${(1 - pop) * 6}px)`,\n opacity: Math.min(1, pop * 1.4),\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n background: \"#0E121B\",\n color: \"#fff\",\n fontFamily: MONO,\n fontSize: 11,\n lineHeight: \"22px\",\n padding: \"0 8px\",\n borderRadius: 5,\n whiteSpace: \"nowrap\",\n boxShadow: \"0 4px 10px -4px rgba(10,13,20,0.4)\",\n }}\n >\n <span\n style={{\n width: 8,\n height: 8,\n borderRadius: 4,\n background: swatch,\n boxShadow: \"0 0 0 1px rgba(255,255,255,0.35)\",\n }}\n />\n {label}\n </div>\n );\n}\n\n/** Guide line that drops down (vertical) or slides across (horizontal). */\nfunction Guide({\n x,\n y,\n length,\n vertical,\n color,\n delay = 0,\n dashed,\n width = 1,\n}: {\n x: number;\n y: number;\n length: number;\n vertical?: boolean;\n color: string;\n delay?: number;\n dashed?: boolean;\n width?: number;\n}) {\n const frame = useAuditFrame();\n const draw = progress(frame, delay, 16) * length;\n return (\n <Layer>\n <line\n x1={x}\n y1={y}\n x2={vertical ? x : x + draw}\n y2={vertical ? y + draw : y}\n stroke={color}\n strokeWidth={width}\n strokeDasharray={dashed ? \"4 4\" : undefined}\n />\n </Layer>\n );\n}\n\n/**\n * Scan band: a crisp line with a soft wash trailing behind it, the way the\n * fix pass sweeps the screen. `y` is the line's position.\n */\nfunction ScanBand({\n y,\n color,\n x = 0,\n w = 1280,\n trail = 90,\n opacity = 1,\n}: {\n y: number;\n color: string;\n x?: number;\n w?: number;\n trail?: number;\n opacity?: number;\n}) {\n return (\n <div\n style={{ position: \"absolute\", inset: 0, opacity, pointerEvents: \"none\" }}\n >\n <div\n style={{\n position: \"absolute\",\n left: x,\n width: w,\n top: y - trail,\n height: trail,\n background: `linear-gradient(to bottom, transparent, ${color}2E)`,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n left: x,\n width: w,\n top: y - 1,\n height: 2,\n background: color,\n boxShadow: `0 0 12px 1px ${color}`,\n }}\n />\n </div>\n );\n}\n\n/** Stage-colored wash over everything except one rect, to push focus. */\nfunction Spotlight({\n rect,\n opacity,\n color = C.stage,\n}: {\n rect: Rect;\n opacity: number;\n color?: string;\n}) {\n const pad = 10;\n const x = rect.x - pad;\n const y = rect.y - pad;\n const w = rect.w + pad * 2;\n const h = rect.h + pad * 2;\n const r = 12;\n return (\n <svg\n width={1280}\n height={720}\n style={{ position: \"absolute\", inset: 0, opacity }}\n >\n <path\n fillRule=\"evenodd\"\n fill={color}\n fillOpacity={0.72}\n d={`M0 0H1280V720H0Z M${x + r} ${y}H${x + w - r}Q${x + w} ${y} ${x + w} ${y + r}V${y + h - r}Q${x + w} ${y + h} ${x + w - r} ${y + h}H${x + r}Q${x} ${y + h} ${x} ${y + h - r}V${y + r}Q${x} ${y} ${x + r} ${y}Z`}\n />\n </svg>\n );\n}\n\n/** Two full frames split at `y`: `top` shows above the line, `bottom` below. */\nfunction SplitAt({\n y,\n top,\n bottom,\n}: {\n y: number;\n top: ReactNode;\n bottom: ReactNode;\n}) {\n return (\n <>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n clipPath: `inset(${Math.max(0, y)}px 0 0 0)`,\n }}\n >\n {bottom}\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n clipPath: `inset(0 0 ${Math.max(0, 720 - y)}px 0)`,\n }}\n >\n {top}\n </div>\n </>\n );\n}\n\n/** Cubic ease-in-out between keyframes, clamped at both ends. */\nfunction easeInOut(frame: number, input: number[], output: number[]) {\n return interpolate(frame, input, output, {\n ...clamp,\n easing: Easing.inOut(Easing.cubic),\n });\n}\n\n/* Mark data */\n\ntype Point = [number, number];\n\n/** A distance between two points on one axis, with its value. */\ntype Measure = { from: Point; to: Point; label: string; side?: Side };\n/** A corner whose radius gets an arc and a label. `x`, `y` is the corner. */\ntype RadiusMark = { x: number; y: number; r: number; label: string };\n/** An off-spec element and the fix it needs. */\ntype Issue = {\n rect: Rect;\n note: string;\n side?: \"start\" | \"end\" | \"below\";\n};\n/** A token tag: dot on `anchor`, chip centered on `at`. */\ntype TokenSpec = {\n anchor: Point;\n at: Point;\n label: string;\n swatch: string;\n};\n/** Layout guides over a column grid. */\ntype GuideSpec = {\n /** x of every column edge, left to right. */\n columns: number[];\n top: number;\n bottom: number;\n /** One column (or any rect) to fill and label. */\n highlight?: { rect: Rect; label: string };\n /** A measurement drawn with the guides, like a gutter width. */\n ruler?: Measure;\n /** A horizontal marker line across the grid, like a calendar's now line. */\n now?: { y: number; from: number; to: number; label: string };\n};\n\nconst AUDIT_COLORS = {\n audit: C.error,\n fix: C.blue,\n scan: C.primary,\n ink: C.ink,\n stage: C.stage,\n};\n\n/** Spacing and size redlines across the demo header, tabs and first cards. */\nfunction demoMeasures(l: DemoLayout): Measure[] {\n const card = l.cards[0];\n const next = l.cards[1];\n const tabsBottom = l.tabs[0].y + 32;\n const headerBottom = l.header.y + l.header.h;\n const tabGapX = l.tabs[1].x + l.tabs[1].w + 7;\n const right = l.button.x + l.button.w + 8;\n return [\n {\n from: [l.header.x, l.tabs[0].y + 16],\n to: [l.contentX, l.tabs[0].y + 16],\n label: `pad ${l.pad}`,\n side: \"below\",\n },\n {\n from: [tabGapX, headerBottom],\n to: [tabGapX, l.tabs[0].y],\n label: `${l.tabs[0].y - headerBottom}`,\n side: \"right\",\n },\n {\n from: [next.rect.x + 150, tabsBottom],\n to: [next.rect.x + 150, next.rect.y],\n label: `${next.rect.y - tabsBottom}`,\n side: \"right\",\n },\n {\n from: [card.rect.x + card.rect.w, card.rect.y + 46],\n to: [next.rect.x, card.rect.y + 46],\n label: `gap ${l.gap}`,\n },\n {\n from: [card.rect.x, card.title.y + 9],\n to: [card.title.x, card.title.y + 9],\n label: `${l.cardPad}`,\n side: \"left\",\n },\n {\n from: [card.title.x + 96, card.rect.y],\n to: [card.title.x + 96, card.title.y],\n label: `${l.cardPad}`,\n side: \"right\",\n },\n {\n from: [right, l.button.y],\n to: [right, l.button.y + l.button.h],\n label: `h ${l.button.h}`,\n side: \"below\",\n },\n ];\n}\n\nfunction demoRadii(l: DemoLayout): RadiusMark[] {\n const next = l.cards[1].rect;\n return [{ x: next.x, y: next.y, r: l.radius, label: `radius ${l.radius}` }];\n}\n\nfunction demoIssues(l: DemoLayout): Issue[] {\n return [\n { rect: l.cards[0].title, note: \"13.5 → 14\", side: \"start\" },\n { rect: l.cards[0].status, note: \"radius 4 → 6\", side: \"below\" },\n { rect: l.cards[0].chevron, note: \"hit 20 → 24\", side: \"end\" },\n { rect: l.button, note: \"#8B5CF6 ≠ primary\", side: \"end\" },\n { rect: l.sideActive, note: \"radius 5 → 8\", side: \"start\" },\n { rect: l.events[2].rect, note: \"radius 4 → 8\", side: \"start\" },\n { rect: l.events[6].rect, note: \"pad 6 → 8\", side: \"start\" },\n ];\n}\n\nfunction demoTokens(l: DemoLayout): TokenSpec[] {\n const [c0, c1, c2, c3] = l.cards;\n const chipY = l.calendar.y + 70;\n return [\n {\n anchor: [c0.status.x + 12, c0.status.y + 13],\n at: [c0.rect.x + 50, chipY + 50],\n label: \"state/success/lighter\",\n swatch: C.successBg,\n },\n {\n anchor: [c0.title.x + 40, c0.title.y + 9],\n at: [c0.rect.x + 170, chipY],\n label: \"text/strong-950\",\n swatch: C.ink,\n },\n {\n anchor: [c1.status.x + 12, c1.status.y + 13],\n at: [c1.rect.x + 110, chipY + 92],\n label: \"state/warning/base\",\n swatch: C.warning,\n },\n {\n anchor: [c2.status.x + 12, c2.status.y + 13],\n at: [c2.rect.x + 90, chipY + 20],\n label: \"state/error/base\",\n swatch: C.error,\n },\n {\n anchor: [c3.rect.x + c3.rect.w, c3.rect.y + 40],\n at: [c3.rect.x + 90, chipY + 70],\n label: \"stroke/soft-200\",\n swatch: C.stroke,\n },\n ];\n}\n\nfunction demoGuides(l: DemoLayout): GuideSpec {\n const cal = l.calendar;\n const today = l.columns[0];\n return {\n columns: [...l.columns.map((col) => col.x), cal.x + cal.w],\n top: cal.y,\n bottom: cal.y + cal.h,\n highlight: { rect: today, label: \"Mon 2 · today\" },\n ruler: {\n from: [cal.x, cal.y + l.dayHeaderH + 14],\n to: [cal.x + l.gutter, cal.y + l.dayHeaderH + 14],\n label: `w ${l.gutter}`,\n side: \"below\",\n },\n now: {\n y: cal.y + l.dayHeaderH + 1.25 * l.hourH,\n from: cal.x + l.gutter,\n to: cal.x + cal.w,\n label: \"10:15 AM\",\n },\n };\n}\n\n/** Close-up spec of the first card, sized for a zoomed camera. */\nfunction demoFocus(l: DemoLayout) {\n const card = l.cards[0];\n const r = card.rect;\n const below = r.y + r.h + 34;\n return {\n rect: r,\n measures: [\n {\n from: [r.x, card.title.y + 9],\n to: [card.title.x, card.title.y + 9],\n label: `${l.cardPad}`,\n side: \"below\",\n },\n {\n from: [card.title.x + 110, r.y],\n to: [card.title.x + 110, card.title.y],\n label: `${l.cardPad}`,\n side: \"right\",\n },\n {\n from: [r.x + r.w + 8, card.status.y],\n to: [r.x + r.w + 8, card.status.y + card.status.h],\n label: `h ${card.status.h}`,\n side: \"right\",\n },\n {\n from: [card.chevron.x - 2, card.chevron.y - 6],\n to: [card.chevron.x + card.chevron.w + 2, card.chevron.y - 6],\n label: \"24\",\n },\n ] as Measure[],\n radii: [{ x: r.x, y: r.y, r: l.radius, label: `radius ${l.radius}` }],\n tokens: [\n {\n anchor: [card.status.x + 12, card.status.y + 13],\n at: [r.x + 40, below],\n label: \"state/success/base\",\n swatch: C.success,\n },\n {\n anchor: [card.title.x + 60, card.title.y + 9],\n at: [r.x + 205, below - 4],\n label: \"text/strong-950\",\n swatch: C.ink,\n },\n {\n anchor: [card.time.x + 40, card.time.y + 8],\n at: [r.x + 70, below + 30],\n label: \"text/sub-600\",\n swatch: C.sub,\n },\n {\n anchor: [r.x + r.w, r.y + 30],\n at: [r.x + 230, below + 30],\n label: \"stroke/soft-200\",\n swatch: C.stroke,\n },\n ] as TokenSpec[],\n };\n}\n\nfunction demoSet(v: Version) {\n const l = demoLayout(v);\n return {\n layout: l,\n measures: demoMeasures(l),\n radii: demoRadii(l),\n issues: demoIssues(l),\n tokens: demoTokens(l),\n guides: demoGuides(l),\n focus: demoFocus(l),\n /** Rect around the tabs and the card row. */\n cardRow: {\n x: l.contentX,\n y: l.tabs[0].y,\n w: l.calendar.w,\n h: l.cards[0].rect.y + 92 - l.tabs[0].y,\n } satisfies Rect,\n };\n}\n\n/** Mark data measured off the demo dashboard: `before` is v1, `after` v2. */\nconst DEMO = { before: demoSet(1), after: demoSet(2) };\nconst DEMO_WINDOW = WIN;\n\n/* Mark sets */\n\n/** Rulers then radius arcs, each `stagger` frames after the last. */\nfunction MeasureMarks({\n measures,\n radii = [],\n color,\n start = 0,\n stagger = 5,\n}: {\n measures: Measure[];\n radii?: RadiusMark[];\n color: string;\n start?: number;\n stagger?: number;\n}) {\n return (\n <>\n {measures.map((m, i) => (\n <Ruler\n key={`${m.from.join()}-${m.to.join()}`}\n from={m.from}\n to={m.to}\n label={m.label}\n color={color}\n delay={start + i * stagger}\n labelSide={m.side}\n />\n ))}\n {radii.map((r, i) => (\n <CornerArc\n key={`${r.x}-${r.y}`}\n x={r.x}\n y={r.y}\n r={r.r}\n label={r.label}\n color={color}\n delay={start + (measures.length + i) * stagger}\n />\n ))}\n </>\n );\n}\n\nconst NOTE_SPOT = {\n start: (r: Rect) => ({\n x: r.x - 3,\n y: r.y - 3,\n anchor: \"aboveStart\" as const,\n }),\n end: (r: Rect) => ({\n x: r.x + r.w + 3,\n y: r.y - 3,\n anchor: \"aboveEnd\" as const,\n }),\n below: (r: Rect) => ({\n x: r.x - 3,\n y: r.y + r.h + 3,\n anchor: \"belowStart\" as const,\n }),\n};\n\n/** Every issue boxed, with its note popping on once the box closes. */\nfunction IssueMarks({\n issues,\n color,\n start = 0,\n stagger = 4,\n}: {\n issues: Issue[];\n color: string;\n start?: number;\n stagger?: number;\n}) {\n return (\n <>\n {issues.map((issue, i) => (\n <div key={`${issue.rect.x}-${issue.rect.y}-${issue.note}`}>\n <OutlineBox\n rect={issue.rect}\n color={color}\n delay={start + i * stagger}\n />\n <Pill\n {...NOTE_SPOT[issue.side ?? \"start\"](issue.rect)}\n text={issue.note}\n color={color}\n delay={start + i * stagger + 10}\n />\n </div>\n ))}\n </>\n );\n}\n\nfunction TokenMarks({\n tokens,\n start = 0,\n stagger = 6,\n lineColor,\n}: {\n tokens: TokenSpec[];\n start?: number;\n stagger?: number;\n lineColor?: string;\n}) {\n return (\n <>\n {tokens.map((tag, i) => (\n <TokenTag\n key={`${tag.label}-${tag.anchor.join()}`}\n anchor={tag.anchor}\n at={tag.at}\n label={tag.label}\n swatch={tag.swatch}\n lineColor={lineColor}\n delay={start + i * stagger}\n />\n ))}\n </>\n );\n}\n\n/** Column guides drop in, the highlight fills, then the now line slides across. */\nfunction GuideMarks({\n guides,\n color,\n nowColor = C.primary,\n start = 0,\n}: {\n guides: GuideSpec;\n color: string;\n nowColor?: string;\n start?: number;\n}) {\n const { columns, top, bottom, highlight, ruler, now } = guides;\n const h = highlight?.rect;\n return (\n <>\n {columns.map((x, i) => (\n <Guide\n key={x}\n x={x}\n y={top}\n length={bottom - top}\n vertical\n color={color}\n dashed\n delay={start + i * 3}\n />\n ))}\n {h && highlight && (\n <>\n <OutlineBox\n rect={h}\n color={color}\n fill={`${color}14`}\n inset={0}\n radius={0}\n delay={start + 14}\n />\n <OutlineBox\n rect={{ x: h.x + 6, y: h.y + 4, w: h.w - 12, h: 22 }}\n color={color}\n radius={4}\n inset={0}\n delay={start + 20}\n />\n <Pill\n x={h.x + h.w / 2}\n y={h.y + 4}\n text={highlight.label}\n color={color}\n delay={start + 26}\n anchor=\"above\"\n />\n </>\n )}\n {ruler && (\n <Ruler\n from={ruler.from}\n to={ruler.to}\n label={ruler.label}\n color={color}\n delay={start + 24}\n labelSide={ruler.side}\n />\n )}\n {now && (\n <>\n <Guide\n x={now.from}\n y={now.y}\n length={now.to - now.from}\n color={nowColor}\n width={1.5}\n delay={start + 30}\n />\n <Pill\n x={now.from}\n y={now.y}\n text={now.label}\n color={nowColor}\n delay={start + 30}\n anchor=\"left\"\n />\n </>\n )}\n </>\n );\n}\n\n/** Brand name with a version chip that flips once the fix lands. */\nfunction VersionChip({\n brand,\n versions,\n fixed,\n colors,\n}: {\n brand: string;\n versions: [string, string];\n fixed: boolean;\n colors: [string, string];\n}) {\n return (\n <div\n style={{\n position: \"absolute\",\n left: WIN.x,\n top: 26,\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n fontSize: 15,\n fontWeight: 600,\n color: C.ink,\n }}\n >\n {brand}\n <span\n style={{\n fontFamily: MONO,\n fontSize: 11,\n color: \"#fff\",\n background: fixed ? colors[1] : colors[0],\n borderRadius: 999,\n padding: \"1px 8px\",\n }}\n >\n {fixed ? versions[1] : versions[0]}\n </span>\n </div>\n );\n}\n\ntype RedlineMeasureProps = {\n /** UI to measure, laid out in a 1280x720 frame. Defaults to a demo calendar dashboard. */\n children?: ReactNode;\n /** Distances to draw, in frame pixels. Defaults to spacing on the demo dashboard. */\n measures?: Measure[];\n /** Corners whose radius gets an arc and a label. */\n radii?: RadiusMark[];\n color?: string;\n background?: string;\n /** How far the UI fades toward the background so the marks read, 0 to 1. */\n dim?: number;\n /** Frames between one mark and the next. */\n stagger?: number;\n speed?: number;\n};\n\nconst redlineMeasureDefaults = {\n color: AUDIT_COLORS.audit,\n background: AUDIT_COLORS.stage,\n dim: 0.18,\n stagger: 5,\n speed: 1,\n};\n\nconst redlineMeasureLength = 63;\n\nconst START = 8;\n\nfunction RedlineMeasureBase(props: RedlineMeasureProps) {\n const { speed = 1 } = props;\n return (\n <AuditClock speed={speed}>\n <Scene {...props} />\n </AuditClock>\n );\n}\n\nfunction Scene({\n children,\n measures = children ? [] : DEMO.before.measures,\n radii = children ? [] : DEMO.before.radii,\n color = redlineMeasureDefaults.color,\n background = redlineMeasureDefaults.background,\n dim = redlineMeasureDefaults.dim,\n stagger = redlineMeasureDefaults.stagger,\n}: RedlineMeasureProps) {\n const frame = useAuditFrame();\n return (\n <AbsoluteFill style={{ background, fontFamily: FONT }}>\n {children ?? <DemoDashboard v={1} />}\n <AbsoluteFill\n style={{ background, opacity: easeInOut(frame, [0, 10], [0, dim]) }}\n />\n <MeasureMarks\n measures={measures}\n radii={radii}\n color={color}\n start={START}\n stagger={stagger}\n />\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n color: {\n type: \"color\",\n default: \"#FB3748\",\n description: \"Marks\",\n },\n background: {\n type: \"color\",\n default: \"#EDEDEF\",\n description: \"Background\",\n },\n dim: {\n type: \"number\",\n min: 0,\n max: 0.6,\n step: 0.02,\n default: 0.18,\n description: \"Dim UI\",\n hiddenFromList: false,\n },\n stagger: {\n type: \"number\",\n min: 1,\n max: 12,\n step: 1,\n default: 5,\n description: \"Stagger\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"color\",\"background\",\"dim\",\"stagger\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n color: \"#FB3748\",\n background: \"#EDEDEF\",\n dim: 0.18,\n stagger: 5,\n speed: 1,\n};\n\ntype RedlineMeasureElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof RedlineMeasureBase>;\n\nconst RedlineMeasureInner = forwardRef<\n HTMLDivElement,\n RedlineMeasureElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<RedlineMeasure>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <RedlineMeasureBase\n {...(componentProps as unknown as ComponentProps<typeof RedlineMeasureBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const RedlineMeasure = Interactive.withSchema({\n Component: RedlineMeasureInner,\n componentName: \"<RedlineMeasure>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 63+}diff --git a/registry-artifacts/elements/scan-fix.json b/registry-artifacts/elements/scan-fix.jsonnew file mode 100644index 00000000..a8e40351--- /dev/null+++ b/registry-artifacts/elements/scan-fix.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Scan Fix",+ "durationInFrames": 100,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "scan-fix",+ "sourceCode": "import { createContext, forwardRef, useContext, useImperativeHandle, useRef, type CSSProperties, type ComponentProps, type ReactNode } from \"react\";\nimport { AbsoluteFill, Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\n/**\n * Shared kit behind the design-review family (redline-measure, audit-boxes,\n * scan-fix, token-tags, layout-guides, design-audit): the annotation marks a\n * design review paints over a UI, the scan band that sweeps a fix across it,\n * and a demo calendar dashboard the marks are measured against by default.\n *\n * Every coordinate is in composition pixels of a 1280x720 frame.\n */\n\nconst AuditSpeed = createContext(1);\n\n/** Scales the clock every mark below it reads. */\nfunction AuditClock({\n speed,\n children,\n}: {\n speed: number;\n children: ReactNode;\n}) {\n return <AuditSpeed.Provider value={speed}>{children}</AuditSpeed.Provider>;\n}\n\nfunction useAuditFrame() {\n return useCurrentFrame() * useContext(AuditSpeed);\n}\n\n/* Demo dashboard */\n/**\n * A calendar dashboard drawn from one layout function, so every annotation\n * can measure the exact rects the UI paints. Version 1 is the \"before\"\n * build with drifted spacing and radii, version 2 is the fixed one.\n */\n\ntype Rect = { x: number; y: number; w: number; h: number };\ntype Version = 1 | 2;\n\nconst FONT =\n \"Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\";\nconst MONO = \"ui-monospace, 'SF Mono', Menlo, Consolas, monospace\";\n\nconst C = {\n stage: \"#EDEDEF\",\n window: \"#FFFFFF\",\n ink: \"#0E121B\",\n sub: \"#525866\",\n soft: \"#99A0AE\",\n stroke: \"#E1E4EA\",\n weak: \"#F5F7FA\",\n primary: \"#7D52F4\",\n success: \"#1FC16B\",\n successBg: \"#E0FAEC\",\n warning: \"#FA7319\",\n warningBg: \"#FFF1EB\",\n error: \"#FB3748\",\n errorBg: \"#FFEBEC\",\n blue: \"#335CFF\",\n blueBg: \"#EBF1FF\",\n orangeBg: \"#FFF3EB\",\n purpleBg: \"#EFEBFF\",\n};\n\nconst WIN: Rect = { x: 80, y: 64, w: 1120, h: 616 };\nconst SIDE_W = 216;\nconst HEADER_H = 56;\nconst MAIN_X = WIN.x + SIDE_W;\nconst MAIN_R = WIN.x + WIN.w;\n\nconst CARDS = [\n {\n title: \"Weekly team meeting\",\n time: \"3:00 – 4:30 PM\",\n status: \"Today\",\n action: \"Join meeting\",\n dot: C.success,\n bg: C.successBg,\n },\n {\n title: \"Product launch event\",\n time: \"11:00 AM – 12:30 PM\",\n status: \"2 conflicts\",\n action: \"Review\",\n dot: C.warning,\n bg: C.warningBg,\n },\n {\n title: \"Team building workshop\",\n time: \"10:00 AM – 1:00 PM\",\n status: \"Canceled\",\n action: \"Fri, Nov 6\",\n dot: C.error,\n bg: C.errorBg,\n },\n {\n title: \"Marketing campaign\",\n time: \"2:30 – 4:00 PM\",\n status: \"In 3 days\",\n action: \"Thu, Nov 5\",\n dot: C.soft,\n bg: C.weak,\n },\n];\n\nconst TABS = [\n { label: \"All scheduled\", count: \"15\" },\n { label: \"Meetings\", count: \"12\" },\n { label: \"Events\", count: \"3\" },\n { label: \"Conflicted\", count: \"2\" },\n { label: \"Canceled\", count: \"1\" },\n];\n\nconst DAYS = [\"Mon 2\", \"Tue 3\", \"Wed 4\", \"Thu 5\", \"Fri 6\"];\nconst HOURS = [\"9 AM\", \"10 AM\", \"11 AM\", \"12 PM\", \"1 PM\"];\n\nconst EVENTS = [\n { day: 0, from: 0, to: 0.5, title: \"Brainstorming session\", tone: \"gray\" },\n { day: 0, from: 0.55, to: 1.05, title: \"Bi-weekly sync\", tone: \"gray\" },\n { day: 1, from: 0, to: 0.45, title: \"Project review\", tone: \"blue\" },\n { day: 1, from: 1.05, to: 2.6, title: \"Sales team training\", tone: \"blue\" },\n { day: 2, from: 0.5, to: 1.0, title: \"Marketing strategy\", tone: \"blue\" },\n { day: 2, from: 2.6, to: 3.6, title: \"Interview: frontend\", tone: \"purple\" },\n { day: 3, from: 0, to: 1.0, title: \"Customer feedback\", tone: \"blue\" },\n { day: 3, from: 2.2, to: 3.4, title: \"Product launch\", tone: \"orange\" },\n { day: 0, from: 2.5, to: 3.7, title: \"Workshop: design\", tone: \"orange\" },\n { day: 4, from: 1.1, to: 3.7, title: \"Team building\", tone: \"gray\" },\n] as const;\n\nconst TONES = {\n gray: { bg: C.weak, ink: C.sub },\n blue: { bg: C.blueBg, ink: \"#2547D0\" },\n purple: { bg: C.purpleBg, ink: \"#5B3CC4\" },\n orange: { bg: C.orangeBg, ink: \"#C2540A\" },\n};\n\n/** Every rect the dashboard paints, in composition pixels. */\nfunction demoLayout(v: Version) {\n const pad = v === 2 ? 24 : 20;\n const gap = v === 2 ? 16 : 10;\n const cardPad = v === 2 ? 16 : 12;\n const radius = v === 2 ? 12 : 6;\n const contentX = MAIN_X + pad;\n const contentW = MAIN_R - pad - contentX;\n\n const header: Rect = { x: MAIN_X, y: WIN.y, w: MAIN_R - MAIN_X, h: HEADER_H };\n const button: Rect = {\n x: MAIN_R - pad - 128,\n y: WIN.y + 12,\n w: 128,\n h: v === 2 ? 32 : 34,\n };\n const tabsY = WIN.y + HEADER_H + (v === 2 ? 16 : 12);\n let tabX = contentX;\n const tabs = TABS.map((tab, i) => {\n const w = 46 + tab.label.length * 7.4 + (i === 0 ? 26 : 0);\n const rect: Rect = { x: tabX, y: tabsY, w, h: 32 };\n tabX += w + 14;\n return rect;\n });\n\n const cardsY = tabsY + 32 + (v === 2 ? 16 : 12);\n const cardW = (contentW - gap * 3) / 4;\n const cards = CARDS.map((_, i) => {\n const rect: Rect = {\n x: contentX + i * (cardW + gap),\n y: cardsY,\n w: cardW,\n h: 92,\n };\n return {\n rect,\n title: { x: rect.x + cardPad, y: rect.y + cardPad, w: 150, h: 18 },\n time: { x: rect.x + cardPad, y: rect.y + cardPad + 21, w: 110, h: 15 },\n status: {\n x: rect.x + cardPad - 4,\n y: rect.y + rect.h - cardPad - 24,\n w: rect.w - cardPad * 2 + 8,\n h: 26,\n },\n chevron: {\n x: rect.x + rect.w - cardPad - 20,\n y: rect.y + cardPad - 2,\n w: 20,\n h: 20,\n },\n };\n });\n\n const calY = cardsY + 92 + 22;\n const calendar: Rect = {\n x: contentX,\n y: calY,\n w: contentW,\n h: WIN.y + WIN.h - calY - 16,\n };\n const gutter = 56;\n const colW = (contentW - gutter) / DAYS.length;\n const dayHeaderH = 30;\n const hourH = (calendar.h - dayHeaderH) / 4;\n const columns = DAYS.map(\n (_, i): Rect => ({\n x: contentX + gutter + i * colW,\n y: calY,\n w: colW,\n h: calendar.h,\n }),\n );\n const events = EVENTS.map((event) => ({\n ...event,\n rect: {\n x: columns[event.day].x + 4,\n y: calY + dayHeaderH + event.from * hourH + 3,\n w: colW - 8,\n h: (event.to - event.from) * hourH - 6,\n } satisfies Rect,\n }));\n\n return {\n v,\n pad,\n gap,\n cardPad,\n radius,\n contentX,\n header,\n button,\n tabs,\n cards,\n calendar,\n columns,\n gutter,\n dayHeaderH,\n hourH,\n events,\n sidebar: { x: WIN.x, y: WIN.y, w: SIDE_W, h: WIN.h } satisfies Rect,\n sideActive: { x: WIN.x + 10, y: WIN.y + 158, w: SIDE_W - 20, h: 30 },\n };\n}\n\ntype DemoLayout = ReturnType<typeof demoLayout>;\n\nconst abs = (r: Rect): CSSProperties => ({\n position: \"absolute\",\n left: r.x,\n top: r.y,\n width: r.w,\n height: r.h,\n});\n\nfunction Glyph({\n size = 14,\n color = C.soft,\n}: {\n size?: number;\n color?: string;\n}) {\n return (\n <div\n style={{\n width: size,\n height: size,\n borderRadius: 4,\n border: `1.5px solid ${color}`,\n flexShrink: 0,\n }}\n />\n );\n}\n\nconst SIDE_ITEMS: (string | { section: string })[] = [\n \"Inbox\",\n \"Dashboard\",\n { section: \"Workspace\" },\n \"Calendar\",\n \"Time off\",\n \"People\",\n \"Payroll\",\n \"Projects\",\n \"Documents\",\n { section: \"Favorites\" },\n \"Loom Mobile App\",\n \"Monday Re-design\",\n \"Udemy Courses\",\n];\n\nfunction Sidebar({ l }: { l: DemoLayout }) {\n let y = WIN.y + 68;\n return (\n <>\n <div\n style={{\n ...abs({ x: WIN.x, y: WIN.y, w: SIDE_W, h: WIN.h }),\n borderRight: `1px solid ${C.stroke}`,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n left: WIN.x + 18,\n top: WIN.y + 18,\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n fontSize: 14,\n fontWeight: 600,\n color: C.ink,\n }}\n >\n <div\n style={{\n width: 22,\n height: 22,\n borderRadius: 11,\n background: C.primary,\n }}\n />\n Synergy\n </div>\n {SIDE_ITEMS.map((item) => {\n const top = y;\n if (typeof item !== \"string\") {\n y += 30;\n return (\n <div\n key={item.section}\n style={{\n position: \"absolute\",\n left: WIN.x + 20,\n top: top + 10,\n fontSize: 11,\n letterSpacing: \"0.04em\",\n textTransform: \"uppercase\",\n color: C.soft,\n }}\n >\n {item.section}\n </div>\n );\n }\n y += 30;\n const active = item === \"Calendar\";\n return (\n <div\n key={item}\n style={{\n ...abs(\n active\n ? l.sideActive\n : { x: WIN.x + 10, y: top, w: SIDE_W - 20, h: 30 },\n ),\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n paddingLeft: 10,\n borderRadius: l.v === 2 ? 8 : 5,\n background: active ? C.weak : undefined,\n fontSize: 13,\n fontWeight: active ? 500 : 400,\n color: active ? C.ink : C.sub,\n }}\n >\n <Glyph color={active ? C.primary : C.soft} />\n {item}\n </div>\n );\n })}\n <div\n style={{\n position: \"absolute\",\n left: WIN.x + 18,\n top: WIN.y + WIN.h - 44,\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n fontSize: 13,\n color: C.ink,\n }}\n >\n <div\n style={{\n width: 26,\n height: 26,\n borderRadius: 13,\n background: \"linear-gradient(135deg,#FBC5A6,#F17B6A)\",\n }}\n />\n Olivia Hart\n </div>\n </>\n );\n}\n\nfunction Header({ l }: { l: DemoLayout }) {\n return (\n <>\n <div\n style={{\n ...abs(l.header),\n borderBottom: `1px solid ${C.stroke}`,\n display: \"flex\",\n alignItems: \"center\",\n gap: 12,\n paddingLeft: l.pad,\n fontSize: 14,\n }}\n >\n <Glyph size={16} color={C.sub} />\n <span style={{ fontWeight: 600, color: C.ink }}>\n Monday, November 2\n </span>\n <span style={{ color: C.soft }}>\n You have 3 meetings and 1 event today.\n </span>\n </div>\n <div\n style={{\n ...abs({ x: l.button.x - 104, y: l.button.y, w: 92, h: l.button.h }),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: 6,\n borderRadius: l.v === 2 ? 8 : 6,\n border: `1px solid ${C.stroke}`,\n fontSize: 13,\n color: C.sub,\n }}\n >\n Schedule\n </div>\n <div\n style={{\n ...abs(l.button),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: l.v === 2 ? 8 : 6,\n background: l.v === 2 ? C.primary : \"#8B5CF6\",\n color: \"#fff\",\n fontSize: 13,\n fontWeight: 500,\n }}\n >\n + Create event\n </div>\n </>\n );\n}\n\nfunction Tabs({ l }: { l: DemoLayout }) {\n return (\n <>\n {TABS.map((tab, i) => (\n <div\n key={tab.label}\n style={{\n ...abs(l.tabs[i]),\n display: \"flex\",\n alignItems: \"center\",\n gap: 7,\n fontSize: 13,\n fontWeight: i === 0 ? 500 : 400,\n color: i === 0 ? C.ink : C.sub,\n borderBottom: i === 0 ? `2px solid ${C.primary}` : undefined,\n }}\n >\n <Glyph color={i === 0 ? C.primary : C.soft} />\n {tab.label}\n <span\n style={{\n fontSize: 11,\n fontWeight: 500,\n color: i === 0 ? \"#fff\" : C.soft,\n background:\n i === 0 ? (l.v === 2 ? C.primary : \"#8B5CF6\") : undefined,\n borderRadius: 8,\n padding: i === 0 ? \"1px 6px\" : 0,\n }}\n >\n {tab.count}\n </span>\n </div>\n ))}\n <div\n style={{\n position: \"absolute\",\n left: l.contentX,\n top: l.tabs[0].y + 32,\n width: WIN.x + WIN.w - l.pad - l.contentX,\n height: 1,\n background: C.stroke,\n }}\n />\n </>\n );\n}\n\nfunction Cards({ l }: { l: DemoLayout }) {\n return (\n <>\n {CARDS.map((card, i) => {\n const r = l.cards[i];\n return (\n <div key={card.title}>\n <div\n style={{\n ...abs(r.rect),\n borderRadius: l.radius,\n border: `1px solid ${C.stroke}`,\n background: \"#fff\",\n boxShadow: \"0 1px 2px rgba(10,13,20,0.04)\",\n }}\n />\n <div\n style={{\n ...abs(r.title),\n width: r.rect.w - l.cardPad * 2 - 24,\n fontSize: l.v === 2 ? 14 : 13.5,\n fontWeight: 600,\n color: C.ink,\n whiteSpace: \"nowrap\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n }}\n >\n {card.title}\n </div>\n <div\n style={{ ...abs(r.time), width: 160, fontSize: 12, color: C.sub }}\n >\n {card.time}\n </div>\n <div\n style={{\n ...abs(r.chevron),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: C.soft,\n fontSize: 11,\n }}\n >\n ⌄\n </div>\n <div\n style={{\n ...abs(r.status),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n padding: \"0 8px\",\n borderRadius: l.v === 2 ? 6 : 4,\n background: card.bg,\n fontSize: 12,\n }}\n >\n <span\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n color: C.ink,\n }}\n >\n <span\n style={{\n width: 8,\n height: 8,\n borderRadius: 4,\n background: card.dot,\n }}\n />\n {card.status}\n </span>\n <span\n style={{\n color: C.sub,\n textDecoration: i === 0 ? \"underline\" : undefined,\n }}\n >\n {card.action}\n </span>\n </div>\n </div>\n );\n })}\n </>\n );\n}\n\nfunction Calendar({ l }: { l: DemoLayout }) {\n const { calendar: cal, columns, dayHeaderH, hourH } = l;\n return (\n <>\n {DAYS.map((day, i) => (\n <div\n key={day}\n style={{\n ...abs({\n x: columns[i].x,\n y: cal.y,\n w: columns[i].w,\n h: dayHeaderH,\n }),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontSize: 12,\n fontWeight: i === 0 ? 600 : 400,\n color: i === 0 ? C.ink : C.soft,\n borderLeft: `1px solid ${C.stroke}`,\n borderBottom: `1px solid ${C.stroke}`,\n }}\n >\n {day}\n </div>\n ))}\n {HOURS.slice(0, 4).map((hour, i) => (\n <div\n key={hour}\n style={{\n position: \"absolute\",\n left: cal.x,\n top: cal.y + dayHeaderH + i * hourH - 2,\n width: l.gutter - 10,\n textAlign: \"right\",\n fontSize: 11,\n color: C.soft,\n }}\n >\n {hour}\n </div>\n ))}\n {columns.map((col) => (\n <div\n key={col.x}\n style={{\n position: \"absolute\",\n left: col.x,\n top: cal.y + dayHeaderH,\n width: 1,\n height: cal.h - dayHeaderH,\n background: C.stroke,\n }}\n />\n ))}\n {l.events.map((event) => {\n const tone = TONES[event.tone];\n return (\n <div\n key={`${event.day}-${event.from}`}\n style={{\n ...abs(event.rect),\n borderRadius: l.v === 2 ? 8 : 4,\n background: tone.bg,\n padding: \"6px 8px\",\n fontSize: 11.5,\n fontWeight: 500,\n color: tone.ink,\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n textOverflow: \"ellipsis\",\n }}\n >\n {event.title}\n </div>\n );\n })}\n </>\n );\n}\n\n/** The whole dashboard window, positioned in a 1280x720 frame. */\nfunction DemoDashboard({ v }: { v: Version }) {\n const l = demoLayout(v);\n return (\n <div style={{ position: \"absolute\", inset: 0, fontFamily: FONT }}>\n <div\n style={{\n ...abs(WIN),\n background: C.window,\n borderRadius: 16,\n boxShadow:\n \"0 0 0 1px rgba(10,13,20,0.04), 0 16px 40px -12px rgba(10,13,20,0.12)\",\n }}\n />\n <div\n style={{\n ...abs(WIN),\n borderRadius: 16,\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: -WIN.x,\n top: -WIN.y,\n width: 1280,\n height: 720,\n }}\n >\n <Sidebar l={l} />\n <Header l={l} />\n <Tabs l={l} />\n <Cards l={l} />\n <Calendar l={l} />\n </div>\n </div>\n </div>\n );\n}\n\n/* Marks */\n\n/**\n * Annotation primitives: the redline marks a design review paints over a UI.\n * Each takes a `delay` in frames and draws itself in from there.\n */\n\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nfunction progress(frame: number, start: number, duration: number) {\n return interpolate(frame, [start, start + duration], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n}\n\n/** Pop-in for labels and chips: a cubic ease-out, no overshoot. */\nfunction usePop(delay: number) {\n return progress(useAuditFrame(), delay, 12);\n}\n\nfunction Layer({ children }: { children: ReactNode }) {\n return (\n <svg\n width={1280}\n height={720}\n viewBox=\"0 0 1280 720\"\n style={{ position: \"absolute\", inset: 0, overflow: \"visible\" }}\n >\n {children}\n </svg>\n );\n}\n\ntype Side =\n | \"center\"\n | \"above\"\n | \"below\"\n | \"left\"\n | \"right\"\n | \"aboveStart\"\n | \"aboveEnd\"\n | \"belowStart\";\n\n/** Small spec label: mono text on a solid color chip. */\nfunction Pill({\n x,\n y,\n text,\n color,\n delay = 0,\n anchor = \"center\",\n ink = \"#fff\",\n}: {\n x: number;\n y: number;\n text: string;\n color: string;\n delay?: number;\n anchor?: Side;\n ink?: string;\n}) {\n const pop = usePop(delay);\n const shift = {\n center: \"translate(-50%, -50%)\",\n above: \"translate(-50%, calc(-100% - 5px))\",\n below: \"translate(-50%, 5px)\",\n left: \"translate(calc(-100% - 6px), -50%)\",\n right: \"translate(6px, -50%)\",\n aboveStart: \"translate(0, calc(-100% - 5px))\",\n aboveEnd: \"translate(-100%, calc(-100% - 5px))\",\n belowStart: \"translate(0, 5px)\",\n }[anchor];\n return (\n <div\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n transform: `${shift} scale(${0.7 + 0.3 * pop})`,\n opacity: Math.min(1, pop * 1.4),\n background: color,\n color: ink,\n fontFamily: MONO,\n fontSize: 10.5,\n fontWeight: 600,\n lineHeight: \"15px\",\n padding: \"0 5px\",\n borderRadius: 3,\n whiteSpace: \"nowrap\",\n }}\n >\n {text}\n </div>\n );\n}\n\n/**\n * Measurement between two points on one axis: end ticks snap in, the line\n * grows out from its middle, then the value pops on.\n */\nfunction Ruler({\n from,\n to,\n label,\n color,\n delay = 0,\n labelSide,\n}: {\n from: [number, number];\n to: [number, number];\n label: string;\n color: string;\n delay?: number;\n labelSide?: Side;\n}) {\n const frame = useAuditFrame();\n const grow = progress(frame, delay, 12);\n const ticks = progress(frame, delay - 2, 6);\n const horizontal = Math.abs(to[0] - from[0]) >= Math.abs(to[1] - from[1]);\n const mx = (from[0] + to[0]) / 2;\n const my = (from[1] + to[1]) / 2;\n const x1 = mx + (from[0] - mx) * grow;\n const y1 = my + (from[1] - my) * grow;\n const x2 = mx + (to[0] - mx) * grow;\n const y2 = my + (to[1] - my) * grow;\n const t = 4 * ticks;\n const tick = (x: number, y: number) =>\n horizontal ? `M${x} ${y - t}V${y + t}` : `M${x - t} ${y}H${x + t}`;\n return (\n <>\n <Layer>\n <path\n d={`${tick(...from)}${tick(...to)}`}\n stroke={color}\n strokeWidth={1.25}\n fill=\"none\"\n />\n <line\n x1={x1}\n y1={y1}\n x2={x2}\n y2={y2}\n stroke={color}\n strokeWidth={1.25}\n />\n </Layer>\n <Pill\n x={mx}\n y={my}\n text={label}\n color={color}\n delay={delay + 7}\n anchor={labelSide ?? (horizontal ? \"above\" : \"left\")}\n />\n </>\n );\n}\n\n/** Hairline box traced around an element, clockwise from the top left. */\nfunction OutlineBox({\n rect,\n color,\n delay = 0,\n radius = 3,\n inset = -3,\n dashed,\n fill,\n}: {\n rect: Rect;\n color: string;\n delay?: number;\n radius?: number;\n inset?: number;\n dashed?: boolean;\n fill?: string;\n}) {\n const frame = useAuditFrame();\n const draw = progress(frame, delay, 14);\n const x = rect.x + inset;\n const y = rect.y + inset;\n const w = rect.w - inset * 2;\n const h = rect.h - inset * 2;\n return (\n <Layer>\n <rect\n x={x}\n y={y}\n width={w}\n height={h}\n rx={radius}\n fill={fill ?? \"none\"}\n fillOpacity={draw}\n stroke={color}\n strokeWidth={1.25}\n pathLength={1}\n strokeDasharray={dashed ? undefined : `${draw} 1`}\n strokeOpacity={dashed ? draw : 1}\n style={dashed ? { strokeDasharray: \"3 3\" } : undefined}\n />\n </Layer>\n );\n}\n\n/** Quarter arc swept into a corner to call out its radius. */\nfunction CornerArc({\n x,\n y,\n r,\n color,\n label,\n delay = 0,\n}: {\n x: number;\n y: number;\n r: number;\n color: string;\n label: string;\n delay?: number;\n}) {\n const frame = useAuditFrame();\n const draw = progress(frame, delay, 12);\n const size = Math.max(r, 10) + 4;\n return (\n <>\n <Layer>\n <path\n d={`M${x} ${y + size}A${size} ${size} 0 0 1 ${x + size} ${y}`}\n stroke={color}\n strokeWidth={1.5}\n fill=\"none\"\n pathLength={1}\n strokeDasharray={`${draw} 1`}\n strokeLinecap=\"round\"\n />\n </Layer>\n <Pill\n x={x - 2}\n y={y - 2}\n text={label}\n color={color}\n delay={delay + 8}\n anchor=\"aboveStart\"\n />\n </>\n );\n}\n\n/**\n * Design-token tag: a dot lands on the element, a leader line runs out with\n * one elbow, and a dark chip with the token name settles at its end.\n */\nfunction TokenTag({\n anchor,\n at,\n label,\n swatch,\n delay = 0,\n lineColor = \"#0E121B\",\n}: {\n anchor: [number, number];\n at: [number, number];\n label: string;\n swatch: string;\n delay?: number;\n lineColor?: string;\n}) {\n const frame = useAuditFrame();\n const dot = usePop(delay);\n const draw = progress(frame, delay + 3, 14);\n const elbowY = at[1];\n const path = `M${anchor[0]} ${anchor[1]}L${anchor[0] + (at[0] - anchor[0]) * 0.35} ${elbowY}H${at[0]}`;\n return (\n <>\n <Layer>\n <path\n d={path}\n stroke={lineColor}\n strokeOpacity={0.55}\n strokeWidth={1}\n fill=\"none\"\n pathLength={1}\n strokeDasharray={`${draw} 1`}\n />\n <circle\n cx={anchor[0]}\n cy={anchor[1]}\n r={3.5 * dot}\n fill=\"#fff\"\n stroke={lineColor}\n strokeWidth={1.5}\n />\n </Layer>\n <TokenChip\n x={at[0]}\n y={at[1]}\n label={label}\n swatch={swatch}\n delay={delay + 13}\n />\n </>\n );\n}\n\nfunction TokenChip({\n x,\n y,\n label,\n swatch,\n delay = 0,\n}: {\n x: number;\n y: number;\n label: string;\n swatch: string;\n delay?: number;\n}) {\n const pop = usePop(delay);\n return (\n <div\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n transform: `translate(-50%, -50%) translateY(${(1 - pop) * 6}px)`,\n opacity: Math.min(1, pop * 1.4),\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n background: \"#0E121B\",\n color: \"#fff\",\n fontFamily: MONO,\n fontSize: 11,\n lineHeight: \"22px\",\n padding: \"0 8px\",\n borderRadius: 5,\n whiteSpace: \"nowrap\",\n boxShadow: \"0 4px 10px -4px rgba(10,13,20,0.4)\",\n }}\n >\n <span\n style={{\n width: 8,\n height: 8,\n borderRadius: 4,\n background: swatch,\n boxShadow: \"0 0 0 1px rgba(255,255,255,0.35)\",\n }}\n />\n {label}\n </div>\n );\n}\n\n/** Guide line that drops down (vertical) or slides across (horizontal). */\nfunction Guide({\n x,\n y,\n length,\n vertical,\n color,\n delay = 0,\n dashed,\n width = 1,\n}: {\n x: number;\n y: number;\n length: number;\n vertical?: boolean;\n color: string;\n delay?: number;\n dashed?: boolean;\n width?: number;\n}) {\n const frame = useAuditFrame();\n const draw = progress(frame, delay, 16) * length;\n return (\n <Layer>\n <line\n x1={x}\n y1={y}\n x2={vertical ? x : x + draw}\n y2={vertical ? y + draw : y}\n stroke={color}\n strokeWidth={width}\n strokeDasharray={dashed ? \"4 4\" : undefined}\n />\n </Layer>\n );\n}\n\n/**\n * Scan band: a crisp line with a soft wash trailing behind it, the way the\n * fix pass sweeps the screen. `y` is the line's position.\n */\nfunction ScanBand({\n y,\n color,\n x = 0,\n w = 1280,\n trail = 90,\n opacity = 1,\n}: {\n y: number;\n color: string;\n x?: number;\n w?: number;\n trail?: number;\n opacity?: number;\n}) {\n return (\n <div\n style={{ position: \"absolute\", inset: 0, opacity, pointerEvents: \"none\" }}\n >\n <div\n style={{\n position: \"absolute\",\n left: x,\n width: w,\n top: y - trail,\n height: trail,\n background: `linear-gradient(to bottom, transparent, ${color}2E)`,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n left: x,\n width: w,\n top: y - 1,\n height: 2,\n background: color,\n boxShadow: `0 0 12px 1px ${color}`,\n }}\n />\n </div>\n );\n}\n\n/** Stage-colored wash over everything except one rect, to push focus. */\nfunction Spotlight({\n rect,\n opacity,\n color = C.stage,\n}: {\n rect: Rect;\n opacity: number;\n color?: string;\n}) {\n const pad = 10;\n const x = rect.x - pad;\n const y = rect.y - pad;\n const w = rect.w + pad * 2;\n const h = rect.h + pad * 2;\n const r = 12;\n return (\n <svg\n width={1280}\n height={720}\n style={{ position: \"absolute\", inset: 0, opacity }}\n >\n <path\n fillRule=\"evenodd\"\n fill={color}\n fillOpacity={0.72}\n d={`M0 0H1280V720H0Z M${x + r} ${y}H${x + w - r}Q${x + w} ${y} ${x + w} ${y + r}V${y + h - r}Q${x + w} ${y + h} ${x + w - r} ${y + h}H${x + r}Q${x} ${y + h} ${x} ${y + h - r}V${y + r}Q${x} ${y} ${x + r} ${y}Z`}\n />\n </svg>\n );\n}\n\n/** Two full frames split at `y`: `top` shows above the line, `bottom` below. */\nfunction SplitAt({\n y,\n top,\n bottom,\n}: {\n y: number;\n top: ReactNode;\n bottom: ReactNode;\n}) {\n return (\n <>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n clipPath: `inset(${Math.max(0, y)}px 0 0 0)`,\n }}\n >\n {bottom}\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n clipPath: `inset(0 0 ${Math.max(0, 720 - y)}px 0)`,\n }}\n >\n {top}\n </div>\n </>\n );\n}\n\n/** Cubic ease-in-out between keyframes, clamped at both ends. */\nfunction easeInOut(frame: number, input: number[], output: number[]) {\n return interpolate(frame, input, output, {\n ...clamp,\n easing: Easing.inOut(Easing.cubic),\n });\n}\n\n/* Mark data */\n\ntype Point = [number, number];\n\n/** A distance between two points on one axis, with its value. */\ntype Measure = { from: Point; to: Point; label: string; side?: Side };\n/** A corner whose radius gets an arc and a label. `x`, `y` is the corner. */\ntype RadiusMark = { x: number; y: number; r: number; label: string };\n/** An off-spec element and the fix it needs. */\ntype Issue = {\n rect: Rect;\n note: string;\n side?: \"start\" | \"end\" | \"below\";\n};\n/** A token tag: dot on `anchor`, chip centered on `at`. */\ntype TokenSpec = {\n anchor: Point;\n at: Point;\n label: string;\n swatch: string;\n};\n/** Layout guides over a column grid. */\ntype GuideSpec = {\n /** x of every column edge, left to right. */\n columns: number[];\n top: number;\n bottom: number;\n /** One column (or any rect) to fill and label. */\n highlight?: { rect: Rect; label: string };\n /** A measurement drawn with the guides, like a gutter width. */\n ruler?: Measure;\n /** A horizontal marker line across the grid, like a calendar's now line. */\n now?: { y: number; from: number; to: number; label: string };\n};\n\nconst AUDIT_COLORS = {\n audit: C.error,\n fix: C.blue,\n scan: C.primary,\n ink: C.ink,\n stage: C.stage,\n};\n\n/** Spacing and size redlines across the demo header, tabs and first cards. */\nfunction demoMeasures(l: DemoLayout): Measure[] {\n const card = l.cards[0];\n const next = l.cards[1];\n const tabsBottom = l.tabs[0].y + 32;\n const headerBottom = l.header.y + l.header.h;\n const tabGapX = l.tabs[1].x + l.tabs[1].w + 7;\n const right = l.button.x + l.button.w + 8;\n return [\n {\n from: [l.header.x, l.tabs[0].y + 16],\n to: [l.contentX, l.tabs[0].y + 16],\n label: `pad ${l.pad}`,\n side: \"below\",\n },\n {\n from: [tabGapX, headerBottom],\n to: [tabGapX, l.tabs[0].y],\n label: `${l.tabs[0].y - headerBottom}`,\n side: \"right\",\n },\n {\n from: [next.rect.x + 150, tabsBottom],\n to: [next.rect.x + 150, next.rect.y],\n label: `${next.rect.y - tabsBottom}`,\n side: \"right\",\n },\n {\n from: [card.rect.x + card.rect.w, card.rect.y + 46],\n to: [next.rect.x, card.rect.y + 46],\n label: `gap ${l.gap}`,\n },\n {\n from: [card.rect.x, card.title.y + 9],\n to: [card.title.x, card.title.y + 9],\n label: `${l.cardPad}`,\n side: \"left\",\n },\n {\n from: [card.title.x + 96, card.rect.y],\n to: [card.title.x + 96, card.title.y],\n label: `${l.cardPad}`,\n side: \"right\",\n },\n {\n from: [right, l.button.y],\n to: [right, l.button.y + l.button.h],\n label: `h ${l.button.h}`,\n side: \"below\",\n },\n ];\n}\n\nfunction demoRadii(l: DemoLayout): RadiusMark[] {\n const next = l.cards[1].rect;\n return [{ x: next.x, y: next.y, r: l.radius, label: `radius ${l.radius}` }];\n}\n\nfunction demoIssues(l: DemoLayout): Issue[] {\n return [\n { rect: l.cards[0].title, note: \"13.5 → 14\", side: \"start\" },\n { rect: l.cards[0].status, note: \"radius 4 → 6\", side: \"below\" },\n { rect: l.cards[0].chevron, note: \"hit 20 → 24\", side: \"end\" },\n { rect: l.button, note: \"#8B5CF6 ≠ primary\", side: \"end\" },\n { rect: l.sideActive, note: \"radius 5 → 8\", side: \"start\" },\n { rect: l.events[2].rect, note: \"radius 4 → 8\", side: \"start\" },\n { rect: l.events[6].rect, note: \"pad 6 → 8\", side: \"start\" },\n ];\n}\n\nfunction demoTokens(l: DemoLayout): TokenSpec[] {\n const [c0, c1, c2, c3] = l.cards;\n const chipY = l.calendar.y + 70;\n return [\n {\n anchor: [c0.status.x + 12, c0.status.y + 13],\n at: [c0.rect.x + 50, chipY + 50],\n label: \"state/success/lighter\",\n swatch: C.successBg,\n },\n {\n anchor: [c0.title.x + 40, c0.title.y + 9],\n at: [c0.rect.x + 170, chipY],\n label: \"text/strong-950\",\n swatch: C.ink,\n },\n {\n anchor: [c1.status.x + 12, c1.status.y + 13],\n at: [c1.rect.x + 110, chipY + 92],\n label: \"state/warning/base\",\n swatch: C.warning,\n },\n {\n anchor: [c2.status.x + 12, c2.status.y + 13],\n at: [c2.rect.x + 90, chipY + 20],\n label: \"state/error/base\",\n swatch: C.error,\n },\n {\n anchor: [c3.rect.x + c3.rect.w, c3.rect.y + 40],\n at: [c3.rect.x + 90, chipY + 70],\n label: \"stroke/soft-200\",\n swatch: C.stroke,\n },\n ];\n}\n\nfunction demoGuides(l: DemoLayout): GuideSpec {\n const cal = l.calendar;\n const today = l.columns[0];\n return {\n columns: [...l.columns.map((col) => col.x), cal.x + cal.w],\n top: cal.y,\n bottom: cal.y + cal.h,\n highlight: { rect: today, label: \"Mon 2 · today\" },\n ruler: {\n from: [cal.x, cal.y + l.dayHeaderH + 14],\n to: [cal.x + l.gutter, cal.y + l.dayHeaderH + 14],\n label: `w ${l.gutter}`,\n side: \"below\",\n },\n now: {\n y: cal.y + l.dayHeaderH + 1.25 * l.hourH,\n from: cal.x + l.gutter,\n to: cal.x + cal.w,\n label: \"10:15 AM\",\n },\n };\n}\n\n/** Close-up spec of the first card, sized for a zoomed camera. */\nfunction demoFocus(l: DemoLayout) {\n const card = l.cards[0];\n const r = card.rect;\n const below = r.y + r.h + 34;\n return {\n rect: r,\n measures: [\n {\n from: [r.x, card.title.y + 9],\n to: [card.title.x, card.title.y + 9],\n label: `${l.cardPad}`,\n side: \"below\",\n },\n {\n from: [card.title.x + 110, r.y],\n to: [card.title.x + 110, card.title.y],\n label: `${l.cardPad}`,\n side: \"right\",\n },\n {\n from: [r.x + r.w + 8, card.status.y],\n to: [r.x + r.w + 8, card.status.y + card.status.h],\n label: `h ${card.status.h}`,\n side: \"right\",\n },\n {\n from: [card.chevron.x - 2, card.chevron.y - 6],\n to: [card.chevron.x + card.chevron.w + 2, card.chevron.y - 6],\n label: \"24\",\n },\n ] as Measure[],\n radii: [{ x: r.x, y: r.y, r: l.radius, label: `radius ${l.radius}` }],\n tokens: [\n {\n anchor: [card.status.x + 12, card.status.y + 13],\n at: [r.x + 40, below],\n label: \"state/success/base\",\n swatch: C.success,\n },\n {\n anchor: [card.title.x + 60, card.title.y + 9],\n at: [r.x + 205, below - 4],\n label: \"text/strong-950\",\n swatch: C.ink,\n },\n {\n anchor: [card.time.x + 40, card.time.y + 8],\n at: [r.x + 70, below + 30],\n label: \"text/sub-600\",\n swatch: C.sub,\n },\n {\n anchor: [r.x + r.w, r.y + 30],\n at: [r.x + 230, below + 30],\n label: \"stroke/soft-200\",\n swatch: C.stroke,\n },\n ] as TokenSpec[],\n };\n}\n\nfunction demoSet(v: Version) {\n const l = demoLayout(v);\n return {\n layout: l,\n measures: demoMeasures(l),\n radii: demoRadii(l),\n issues: demoIssues(l),\n tokens: demoTokens(l),\n guides: demoGuides(l),\n focus: demoFocus(l),\n /** Rect around the tabs and the card row. */\n cardRow: {\n x: l.contentX,\n y: l.tabs[0].y,\n w: l.calendar.w,\n h: l.cards[0].rect.y + 92 - l.tabs[0].y,\n } satisfies Rect,\n };\n}\n\n/** Mark data measured off the demo dashboard: `before` is v1, `after` v2. */\nconst DEMO = { before: demoSet(1), after: demoSet(2) };\nconst DEMO_WINDOW = WIN;\n\n/* Mark sets */\n\n/** Rulers then radius arcs, each `stagger` frames after the last. */\nfunction MeasureMarks({\n measures,\n radii = [],\n color,\n start = 0,\n stagger = 5,\n}: {\n measures: Measure[];\n radii?: RadiusMark[];\n color: string;\n start?: number;\n stagger?: number;\n}) {\n return (\n <>\n {measures.map((m, i) => (\n <Ruler\n key={`${m.from.join()}-${m.to.join()}`}\n from={m.from}\n to={m.to}\n label={m.label}\n color={color}\n delay={start + i * stagger}\n labelSide={m.side}\n />\n ))}\n {radii.map((r, i) => (\n <CornerArc\n key={`${r.x}-${r.y}`}\n x={r.x}\n y={r.y}\n r={r.r}\n label={r.label}\n color={color}\n delay={start + (measures.length + i) * stagger}\n />\n ))}\n </>\n );\n}\n\nconst NOTE_SPOT = {\n start: (r: Rect) => ({\n x: r.x - 3,\n y: r.y - 3,\n anchor: \"aboveStart\" as const,\n }),\n end: (r: Rect) => ({\n x: r.x + r.w + 3,\n y: r.y - 3,\n anchor: \"aboveEnd\" as const,\n }),\n below: (r: Rect) => ({\n x: r.x - 3,\n y: r.y + r.h + 3,\n anchor: \"belowStart\" as const,\n }),\n};\n\n/** Every issue boxed, with its note popping on once the box closes. */\nfunction IssueMarks({\n issues,\n color,\n start = 0,\n stagger = 4,\n}: {\n issues: Issue[];\n color: string;\n start?: number;\n stagger?: number;\n}) {\n return (\n <>\n {issues.map((issue, i) => (\n <div key={`${issue.rect.x}-${issue.rect.y}-${issue.note}`}>\n <OutlineBox\n rect={issue.rect}\n color={color}\n delay={start + i * stagger}\n />\n <Pill\n {...NOTE_SPOT[issue.side ?? \"start\"](issue.rect)}\n text={issue.note}\n color={color}\n delay={start + i * stagger + 10}\n />\n </div>\n ))}\n </>\n );\n}\n\nfunction TokenMarks({\n tokens,\n start = 0,\n stagger = 6,\n lineColor,\n}: {\n tokens: TokenSpec[];\n start?: number;\n stagger?: number;\n lineColor?: string;\n}) {\n return (\n <>\n {tokens.map((tag, i) => (\n <TokenTag\n key={`${tag.label}-${tag.anchor.join()}`}\n anchor={tag.anchor}\n at={tag.at}\n label={tag.label}\n swatch={tag.swatch}\n lineColor={lineColor}\n delay={start + i * stagger}\n />\n ))}\n </>\n );\n}\n\n/** Column guides drop in, the highlight fills, then the now line slides across. */\nfunction GuideMarks({\n guides,\n color,\n nowColor = C.primary,\n start = 0,\n}: {\n guides: GuideSpec;\n color: string;\n nowColor?: string;\n start?: number;\n}) {\n const { columns, top, bottom, highlight, ruler, now } = guides;\n const h = highlight?.rect;\n return (\n <>\n {columns.map((x, i) => (\n <Guide\n key={x}\n x={x}\n y={top}\n length={bottom - top}\n vertical\n color={color}\n dashed\n delay={start + i * 3}\n />\n ))}\n {h && highlight && (\n <>\n <OutlineBox\n rect={h}\n color={color}\n fill={`${color}14`}\n inset={0}\n radius={0}\n delay={start + 14}\n />\n <OutlineBox\n rect={{ x: h.x + 6, y: h.y + 4, w: h.w - 12, h: 22 }}\n color={color}\n radius={4}\n inset={0}\n delay={start + 20}\n />\n <Pill\n x={h.x + h.w / 2}\n y={h.y + 4}\n text={highlight.label}\n color={color}\n delay={start + 26}\n anchor=\"above\"\n />\n </>\n )}\n {ruler && (\n <Ruler\n from={ruler.from}\n to={ruler.to}\n label={ruler.label}\n color={color}\n delay={start + 24}\n labelSide={ruler.side}\n />\n )}\n {now && (\n <>\n <Guide\n x={now.from}\n y={now.y}\n length={now.to - now.from}\n color={nowColor}\n width={1.5}\n delay={start + 30}\n />\n <Pill\n x={now.from}\n y={now.y}\n text={now.label}\n color={nowColor}\n delay={start + 30}\n anchor=\"left\"\n />\n </>\n )}\n </>\n );\n}\n\n/** Brand name with a version chip that flips once the fix lands. */\nfunction VersionChip({\n brand,\n versions,\n fixed,\n colors,\n}: {\n brand: string;\n versions: [string, string];\n fixed: boolean;\n colors: [string, string];\n}) {\n return (\n <div\n style={{\n position: \"absolute\",\n left: WIN.x,\n top: 26,\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n fontSize: 15,\n fontWeight: 600,\n color: C.ink,\n }}\n >\n {brand}\n <span\n style={{\n fontFamily: MONO,\n fontSize: 11,\n color: \"#fff\",\n background: fixed ? colors[1] : colors[0],\n borderRadius: 999,\n padding: \"1px 8px\",\n }}\n >\n {fixed ? versions[1] : versions[0]}\n </span>\n </div>\n );\n}\n\ntype ScanFixProps = {\n /** Frame before the fix, 1280x720. Defaults to the demo dashboard with red redlines. */\n before?: ReactNode;\n /** Frame after the fix, same size. Defaults to the fixed dashboard with blue redlines. */\n after?: ReactNode;\n /** Name next to the version chip. Empty hides the chip. */\n brand?: string;\n /** Version chip text before and after the band passes it. */\n versions?: [string, string];\n scanColor?: string;\n beforeColor?: string;\n afterColor?: string;\n background?: string;\n speed?: number;\n};\n\nconst scanFixDefaults = {\n brand: \"Synergy\",\n versions: [\"v1.0\", \"v2.0\"] as [string, string],\n scanColor: AUDIT_COLORS.scan,\n beforeColor: AUDIT_COLORS.audit,\n afterColor: AUDIT_COLORS.fix,\n background: AUDIT_COLORS.stage,\n speed: 1,\n};\n\nconst scanFixLength = 100;\n\nconst SCAN_START = 18;\nconst SCAN_LENGTH = 80;\n\nfunction ScanFixBase(props: ScanFixProps) {\n const { speed = 1 } = props;\n return (\n <AuditClock speed={speed}>\n <Scene {...props} />\n </AuditClock>\n );\n}\n\nfunction DemoBefore({ color }: { color: string }) {\n return (\n <>\n <DemoDashboard v={1} />\n <MeasureMarks\n measures={DEMO.before.measures}\n radii={DEMO.before.radii}\n color={color}\n start={-200}\n />\n <IssueMarks issues={DEMO.before.issues} color={color} start={-200} />\n </>\n );\n}\n\nfunction DemoAfter({ color }: { color: string }) {\n return (\n <>\n <DemoDashboard v={2} />\n <MeasureMarks\n measures={DEMO.after.measures}\n radii={DEMO.after.radii}\n color={color}\n start={-200}\n />\n </>\n );\n}\n\nfunction Scene({\n before,\n after,\n brand = scanFixDefaults.brand,\n versions = scanFixDefaults.versions,\n scanColor = scanFixDefaults.scanColor,\n beforeColor = scanFixDefaults.beforeColor,\n afterColor = scanFixDefaults.afterColor,\n background = scanFixDefaults.background,\n}: ScanFixProps) {\n const frame = useAuditFrame();\n const y = easeInOut(\n frame,\n [SCAN_START, SCAN_START + SCAN_LENGTH],\n [-20, 760],\n );\n const band = easeInOut(\n frame,\n [\n SCAN_START - 4,\n SCAN_START + 2,\n SCAN_START + SCAN_LENGTH - 6,\n SCAN_START + SCAN_LENGTH + 2,\n ],\n [0, 1, 1, 0],\n );\n return (\n <AbsoluteFill style={{ background, fontFamily: FONT }}>\n <SplitAt\n y={y}\n bottom={before ?? <DemoBefore color={beforeColor} />}\n top={after ?? <DemoAfter color={afterColor} />}\n />\n {brand && (\n <VersionChip\n brand={brand}\n versions={versions}\n fixed={y > 36}\n colors={[beforeColor, afterColor]}\n />\n )}\n <ScanBand y={y} color={scanColor} opacity={band} />\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n brand: {\n type: \"text-content\",\n default: \"Synergy\",\n description: \"Brand\",\n },\n scanColor: {\n type: \"color\",\n default: \"#7D52F4\",\n description: \"Scan\",\n },\n beforeColor: {\n type: \"color\",\n default: \"#FB3748\",\n description: \"Before\",\n },\n afterColor: {\n type: \"color\",\n default: \"#335CFF\",\n description: \"After\",\n },\n background: {\n type: \"color\",\n default: \"#EDEDEF\",\n description: \"Background\",\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"brand\",\"scanColor\",\"beforeColor\",\"afterColor\",\"background\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n brand: \"Synergy\",\n scanColor: \"#7D52F4\",\n beforeColor: \"#FB3748\",\n afterColor: \"#335CFF\",\n background: \"#EDEDEF\",\n speed: 1,\n};\n\ntype ScanFixElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof ScanFixBase>;\n\nconst ScanFixInner = forwardRef<\n HTMLDivElement,\n ScanFixElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<ScanFix>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <ScanFixBase\n {...(componentProps as unknown as ComponentProps<typeof ScanFixBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const ScanFix = Interactive.withSchema({\n Component: ScanFixInner,\n componentName: \"<ScanFix>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 100+}diff --git a/registry-artifacts/elements/token-tags.json b/registry-artifacts/elements/token-tags.jsonnew file mode 100644index 00000000..8ea36e5d--- /dev/null+++ b/registry-artifacts/elements/token-tags.json@@ -0,0 +1,16 @@+{+ "type": "remotion-element",+ "version": 1,+ "element": {+ "assets": [],+ "dependencies": [],+ "dimensions": null,+ "displayName": "Token Tags",+ "durationInFrames": 61,+ "initialProps": null,+ "installationMode": "component-owned-sequence",+ "slug": "token-tags",+ "sourceCode": "import { createContext, forwardRef, useContext, useImperativeHandle, useRef, type CSSProperties, type ComponentProps, type ReactNode } from \"react\";\nimport { AbsoluteFill, Easing, Interactive, Sequence, interpolate, useCurrentFrame, type InteractiveBaseProps, type InteractiveTransformProps, type InteractivitySchema, type SequenceControls } from \"remotion\";\n\n/**\n * Shared kit behind the design-review family (redline-measure, audit-boxes,\n * scan-fix, token-tags, layout-guides, design-audit): the annotation marks a\n * design review paints over a UI, the scan band that sweeps a fix across it,\n * and a demo calendar dashboard the marks are measured against by default.\n *\n * Every coordinate is in composition pixels of a 1280x720 frame.\n */\n\nconst AuditSpeed = createContext(1);\n\n/** Scales the clock every mark below it reads. */\nfunction AuditClock({\n speed,\n children,\n}: {\n speed: number;\n children: ReactNode;\n}) {\n return <AuditSpeed.Provider value={speed}>{children}</AuditSpeed.Provider>;\n}\n\nfunction useAuditFrame() {\n return useCurrentFrame() * useContext(AuditSpeed);\n}\n\n/* Demo dashboard */\n/**\n * A calendar dashboard drawn from one layout function, so every annotation\n * can measure the exact rects the UI paints. Version 1 is the \"before\"\n * build with drifted spacing and radii, version 2 is the fixed one.\n */\n\ntype Rect = { x: number; y: number; w: number; h: number };\ntype Version = 1 | 2;\n\nconst FONT =\n \"Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif\";\nconst MONO = \"ui-monospace, 'SF Mono', Menlo, Consolas, monospace\";\n\nconst C = {\n stage: \"#EDEDEF\",\n window: \"#FFFFFF\",\n ink: \"#0E121B\",\n sub: \"#525866\",\n soft: \"#99A0AE\",\n stroke: \"#E1E4EA\",\n weak: \"#F5F7FA\",\n primary: \"#7D52F4\",\n success: \"#1FC16B\",\n successBg: \"#E0FAEC\",\n warning: \"#FA7319\",\n warningBg: \"#FFF1EB\",\n error: \"#FB3748\",\n errorBg: \"#FFEBEC\",\n blue: \"#335CFF\",\n blueBg: \"#EBF1FF\",\n orangeBg: \"#FFF3EB\",\n purpleBg: \"#EFEBFF\",\n};\n\nconst WIN: Rect = { x: 80, y: 64, w: 1120, h: 616 };\nconst SIDE_W = 216;\nconst HEADER_H = 56;\nconst MAIN_X = WIN.x + SIDE_W;\nconst MAIN_R = WIN.x + WIN.w;\n\nconst CARDS = [\n {\n title: \"Weekly team meeting\",\n time: \"3:00 – 4:30 PM\",\n status: \"Today\",\n action: \"Join meeting\",\n dot: C.success,\n bg: C.successBg,\n },\n {\n title: \"Product launch event\",\n time: \"11:00 AM – 12:30 PM\",\n status: \"2 conflicts\",\n action: \"Review\",\n dot: C.warning,\n bg: C.warningBg,\n },\n {\n title: \"Team building workshop\",\n time: \"10:00 AM – 1:00 PM\",\n status: \"Canceled\",\n action: \"Fri, Nov 6\",\n dot: C.error,\n bg: C.errorBg,\n },\n {\n title: \"Marketing campaign\",\n time: \"2:30 – 4:00 PM\",\n status: \"In 3 days\",\n action: \"Thu, Nov 5\",\n dot: C.soft,\n bg: C.weak,\n },\n];\n\nconst TABS = [\n { label: \"All scheduled\", count: \"15\" },\n { label: \"Meetings\", count: \"12\" },\n { label: \"Events\", count: \"3\" },\n { label: \"Conflicted\", count: \"2\" },\n { label: \"Canceled\", count: \"1\" },\n];\n\nconst DAYS = [\"Mon 2\", \"Tue 3\", \"Wed 4\", \"Thu 5\", \"Fri 6\"];\nconst HOURS = [\"9 AM\", \"10 AM\", \"11 AM\", \"12 PM\", \"1 PM\"];\n\nconst EVENTS = [\n { day: 0, from: 0, to: 0.5, title: \"Brainstorming session\", tone: \"gray\" },\n { day: 0, from: 0.55, to: 1.05, title: \"Bi-weekly sync\", tone: \"gray\" },\n { day: 1, from: 0, to: 0.45, title: \"Project review\", tone: \"blue\" },\n { day: 1, from: 1.05, to: 2.6, title: \"Sales team training\", tone: \"blue\" },\n { day: 2, from: 0.5, to: 1.0, title: \"Marketing strategy\", tone: \"blue\" },\n { day: 2, from: 2.6, to: 3.6, title: \"Interview: frontend\", tone: \"purple\" },\n { day: 3, from: 0, to: 1.0, title: \"Customer feedback\", tone: \"blue\" },\n { day: 3, from: 2.2, to: 3.4, title: \"Product launch\", tone: \"orange\" },\n { day: 0, from: 2.5, to: 3.7, title: \"Workshop: design\", tone: \"orange\" },\n { day: 4, from: 1.1, to: 3.7, title: \"Team building\", tone: \"gray\" },\n] as const;\n\nconst TONES = {\n gray: { bg: C.weak, ink: C.sub },\n blue: { bg: C.blueBg, ink: \"#2547D0\" },\n purple: { bg: C.purpleBg, ink: \"#5B3CC4\" },\n orange: { bg: C.orangeBg, ink: \"#C2540A\" },\n};\n\n/** Every rect the dashboard paints, in composition pixels. */\nfunction demoLayout(v: Version) {\n const pad = v === 2 ? 24 : 20;\n const gap = v === 2 ? 16 : 10;\n const cardPad = v === 2 ? 16 : 12;\n const radius = v === 2 ? 12 : 6;\n const contentX = MAIN_X + pad;\n const contentW = MAIN_R - pad - contentX;\n\n const header: Rect = { x: MAIN_X, y: WIN.y, w: MAIN_R - MAIN_X, h: HEADER_H };\n const button: Rect = {\n x: MAIN_R - pad - 128,\n y: WIN.y + 12,\n w: 128,\n h: v === 2 ? 32 : 34,\n };\n const tabsY = WIN.y + HEADER_H + (v === 2 ? 16 : 12);\n let tabX = contentX;\n const tabs = TABS.map((tab, i) => {\n const w = 46 + tab.label.length * 7.4 + (i === 0 ? 26 : 0);\n const rect: Rect = { x: tabX, y: tabsY, w, h: 32 };\n tabX += w + 14;\n return rect;\n });\n\n const cardsY = tabsY + 32 + (v === 2 ? 16 : 12);\n const cardW = (contentW - gap * 3) / 4;\n const cards = CARDS.map((_, i) => {\n const rect: Rect = {\n x: contentX + i * (cardW + gap),\n y: cardsY,\n w: cardW,\n h: 92,\n };\n return {\n rect,\n title: { x: rect.x + cardPad, y: rect.y + cardPad, w: 150, h: 18 },\n time: { x: rect.x + cardPad, y: rect.y + cardPad + 21, w: 110, h: 15 },\n status: {\n x: rect.x + cardPad - 4,\n y: rect.y + rect.h - cardPad - 24,\n w: rect.w - cardPad * 2 + 8,\n h: 26,\n },\n chevron: {\n x: rect.x + rect.w - cardPad - 20,\n y: rect.y + cardPad - 2,\n w: 20,\n h: 20,\n },\n };\n });\n\n const calY = cardsY + 92 + 22;\n const calendar: Rect = {\n x: contentX,\n y: calY,\n w: contentW,\n h: WIN.y + WIN.h - calY - 16,\n };\n const gutter = 56;\n const colW = (contentW - gutter) / DAYS.length;\n const dayHeaderH = 30;\n const hourH = (calendar.h - dayHeaderH) / 4;\n const columns = DAYS.map(\n (_, i): Rect => ({\n x: contentX + gutter + i * colW,\n y: calY,\n w: colW,\n h: calendar.h,\n }),\n );\n const events = EVENTS.map((event) => ({\n ...event,\n rect: {\n x: columns[event.day].x + 4,\n y: calY + dayHeaderH + event.from * hourH + 3,\n w: colW - 8,\n h: (event.to - event.from) * hourH - 6,\n } satisfies Rect,\n }));\n\n return {\n v,\n pad,\n gap,\n cardPad,\n radius,\n contentX,\n header,\n button,\n tabs,\n cards,\n calendar,\n columns,\n gutter,\n dayHeaderH,\n hourH,\n events,\n sidebar: { x: WIN.x, y: WIN.y, w: SIDE_W, h: WIN.h } satisfies Rect,\n sideActive: { x: WIN.x + 10, y: WIN.y + 158, w: SIDE_W - 20, h: 30 },\n };\n}\n\ntype DemoLayout = ReturnType<typeof demoLayout>;\n\nconst abs = (r: Rect): CSSProperties => ({\n position: \"absolute\",\n left: r.x,\n top: r.y,\n width: r.w,\n height: r.h,\n});\n\nfunction Glyph({\n size = 14,\n color = C.soft,\n}: {\n size?: number;\n color?: string;\n}) {\n return (\n <div\n style={{\n width: size,\n height: size,\n borderRadius: 4,\n border: `1.5px solid ${color}`,\n flexShrink: 0,\n }}\n />\n );\n}\n\nconst SIDE_ITEMS: (string | { section: string })[] = [\n \"Inbox\",\n \"Dashboard\",\n { section: \"Workspace\" },\n \"Calendar\",\n \"Time off\",\n \"People\",\n \"Payroll\",\n \"Projects\",\n \"Documents\",\n { section: \"Favorites\" },\n \"Loom Mobile App\",\n \"Monday Re-design\",\n \"Udemy Courses\",\n];\n\nfunction Sidebar({ l }: { l: DemoLayout }) {\n let y = WIN.y + 68;\n return (\n <>\n <div\n style={{\n ...abs({ x: WIN.x, y: WIN.y, w: SIDE_W, h: WIN.h }),\n borderRight: `1px solid ${C.stroke}`,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n left: WIN.x + 18,\n top: WIN.y + 18,\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n fontSize: 14,\n fontWeight: 600,\n color: C.ink,\n }}\n >\n <div\n style={{\n width: 22,\n height: 22,\n borderRadius: 11,\n background: C.primary,\n }}\n />\n Synergy\n </div>\n {SIDE_ITEMS.map((item) => {\n const top = y;\n if (typeof item !== \"string\") {\n y += 30;\n return (\n <div\n key={item.section}\n style={{\n position: \"absolute\",\n left: WIN.x + 20,\n top: top + 10,\n fontSize: 11,\n letterSpacing: \"0.04em\",\n textTransform: \"uppercase\",\n color: C.soft,\n }}\n >\n {item.section}\n </div>\n );\n }\n y += 30;\n const active = item === \"Calendar\";\n return (\n <div\n key={item}\n style={{\n ...abs(\n active\n ? l.sideActive\n : { x: WIN.x + 10, y: top, w: SIDE_W - 20, h: 30 },\n ),\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n paddingLeft: 10,\n borderRadius: l.v === 2 ? 8 : 5,\n background: active ? C.weak : undefined,\n fontSize: 13,\n fontWeight: active ? 500 : 400,\n color: active ? C.ink : C.sub,\n }}\n >\n <Glyph color={active ? C.primary : C.soft} />\n {item}\n </div>\n );\n })}\n <div\n style={{\n position: \"absolute\",\n left: WIN.x + 18,\n top: WIN.y + WIN.h - 44,\n display: \"flex\",\n alignItems: \"center\",\n gap: 10,\n fontSize: 13,\n color: C.ink,\n }}\n >\n <div\n style={{\n width: 26,\n height: 26,\n borderRadius: 13,\n background: \"linear-gradient(135deg,#FBC5A6,#F17B6A)\",\n }}\n />\n Olivia Hart\n </div>\n </>\n );\n}\n\nfunction Header({ l }: { l: DemoLayout }) {\n return (\n <>\n <div\n style={{\n ...abs(l.header),\n borderBottom: `1px solid ${C.stroke}`,\n display: \"flex\",\n alignItems: \"center\",\n gap: 12,\n paddingLeft: l.pad,\n fontSize: 14,\n }}\n >\n <Glyph size={16} color={C.sub} />\n <span style={{ fontWeight: 600, color: C.ink }}>\n Monday, November 2\n </span>\n <span style={{ color: C.soft }}>\n You have 3 meetings and 1 event today.\n </span>\n </div>\n <div\n style={{\n ...abs({ x: l.button.x - 104, y: l.button.y, w: 92, h: l.button.h }),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: 6,\n borderRadius: l.v === 2 ? 8 : 6,\n border: `1px solid ${C.stroke}`,\n fontSize: 13,\n color: C.sub,\n }}\n >\n Schedule\n </div>\n <div\n style={{\n ...abs(l.button),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n borderRadius: l.v === 2 ? 8 : 6,\n background: l.v === 2 ? C.primary : \"#8B5CF6\",\n color: \"#fff\",\n fontSize: 13,\n fontWeight: 500,\n }}\n >\n + Create event\n </div>\n </>\n );\n}\n\nfunction Tabs({ l }: { l: DemoLayout }) {\n return (\n <>\n {TABS.map((tab, i) => (\n <div\n key={tab.label}\n style={{\n ...abs(l.tabs[i]),\n display: \"flex\",\n alignItems: \"center\",\n gap: 7,\n fontSize: 13,\n fontWeight: i === 0 ? 500 : 400,\n color: i === 0 ? C.ink : C.sub,\n borderBottom: i === 0 ? `2px solid ${C.primary}` : undefined,\n }}\n >\n <Glyph color={i === 0 ? C.primary : C.soft} />\n {tab.label}\n <span\n style={{\n fontSize: 11,\n fontWeight: 500,\n color: i === 0 ? \"#fff\" : C.soft,\n background:\n i === 0 ? (l.v === 2 ? C.primary : \"#8B5CF6\") : undefined,\n borderRadius: 8,\n padding: i === 0 ? \"1px 6px\" : 0,\n }}\n >\n {tab.count}\n </span>\n </div>\n ))}\n <div\n style={{\n position: \"absolute\",\n left: l.contentX,\n top: l.tabs[0].y + 32,\n width: WIN.x + WIN.w - l.pad - l.contentX,\n height: 1,\n background: C.stroke,\n }}\n />\n </>\n );\n}\n\nfunction Cards({ l }: { l: DemoLayout }) {\n return (\n <>\n {CARDS.map((card, i) => {\n const r = l.cards[i];\n return (\n <div key={card.title}>\n <div\n style={{\n ...abs(r.rect),\n borderRadius: l.radius,\n border: `1px solid ${C.stroke}`,\n background: \"#fff\",\n boxShadow: \"0 1px 2px rgba(10,13,20,0.04)\",\n }}\n />\n <div\n style={{\n ...abs(r.title),\n width: r.rect.w - l.cardPad * 2 - 24,\n fontSize: l.v === 2 ? 14 : 13.5,\n fontWeight: 600,\n color: C.ink,\n whiteSpace: \"nowrap\",\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n }}\n >\n {card.title}\n </div>\n <div\n style={{ ...abs(r.time), width: 160, fontSize: 12, color: C.sub }}\n >\n {card.time}\n </div>\n <div\n style={{\n ...abs(r.chevron),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n color: C.soft,\n fontSize: 11,\n }}\n >\n ⌄\n </div>\n <div\n style={{\n ...abs(r.status),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n padding: \"0 8px\",\n borderRadius: l.v === 2 ? 6 : 4,\n background: card.bg,\n fontSize: 12,\n }}\n >\n <span\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n color: C.ink,\n }}\n >\n <span\n style={{\n width: 8,\n height: 8,\n borderRadius: 4,\n background: card.dot,\n }}\n />\n {card.status}\n </span>\n <span\n style={{\n color: C.sub,\n textDecoration: i === 0 ? \"underline\" : undefined,\n }}\n >\n {card.action}\n </span>\n </div>\n </div>\n );\n })}\n </>\n );\n}\n\nfunction Calendar({ l }: { l: DemoLayout }) {\n const { calendar: cal, columns, dayHeaderH, hourH } = l;\n return (\n <>\n {DAYS.map((day, i) => (\n <div\n key={day}\n style={{\n ...abs({\n x: columns[i].x,\n y: cal.y,\n w: columns[i].w,\n h: dayHeaderH,\n }),\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontSize: 12,\n fontWeight: i === 0 ? 600 : 400,\n color: i === 0 ? C.ink : C.soft,\n borderLeft: `1px solid ${C.stroke}`,\n borderBottom: `1px solid ${C.stroke}`,\n }}\n >\n {day}\n </div>\n ))}\n {HOURS.slice(0, 4).map((hour, i) => (\n <div\n key={hour}\n style={{\n position: \"absolute\",\n left: cal.x,\n top: cal.y + dayHeaderH + i * hourH - 2,\n width: l.gutter - 10,\n textAlign: \"right\",\n fontSize: 11,\n color: C.soft,\n }}\n >\n {hour}\n </div>\n ))}\n {columns.map((col) => (\n <div\n key={col.x}\n style={{\n position: \"absolute\",\n left: col.x,\n top: cal.y + dayHeaderH,\n width: 1,\n height: cal.h - dayHeaderH,\n background: C.stroke,\n }}\n />\n ))}\n {l.events.map((event) => {\n const tone = TONES[event.tone];\n return (\n <div\n key={`${event.day}-${event.from}`}\n style={{\n ...abs(event.rect),\n borderRadius: l.v === 2 ? 8 : 4,\n background: tone.bg,\n padding: \"6px 8px\",\n fontSize: 11.5,\n fontWeight: 500,\n color: tone.ink,\n overflow: \"hidden\",\n whiteSpace: \"nowrap\",\n textOverflow: \"ellipsis\",\n }}\n >\n {event.title}\n </div>\n );\n })}\n </>\n );\n}\n\n/** The whole dashboard window, positioned in a 1280x720 frame. */\nfunction DemoDashboard({ v }: { v: Version }) {\n const l = demoLayout(v);\n return (\n <div style={{ position: \"absolute\", inset: 0, fontFamily: FONT }}>\n <div\n style={{\n ...abs(WIN),\n background: C.window,\n borderRadius: 16,\n boxShadow:\n \"0 0 0 1px rgba(10,13,20,0.04), 0 16px 40px -12px rgba(10,13,20,0.12)\",\n }}\n />\n <div\n style={{\n ...abs(WIN),\n borderRadius: 16,\n overflow: \"hidden\",\n }}\n >\n <div\n style={{\n position: \"absolute\",\n left: -WIN.x,\n top: -WIN.y,\n width: 1280,\n height: 720,\n }}\n >\n <Sidebar l={l} />\n <Header l={l} />\n <Tabs l={l} />\n <Cards l={l} />\n <Calendar l={l} />\n </div>\n </div>\n </div>\n );\n}\n\n/* Marks */\n\n/**\n * Annotation primitives: the redline marks a design review paints over a UI.\n * Each takes a `delay` in frames and draws itself in from there.\n */\n\nconst clamp = {\n extrapolateLeft: \"clamp\" as const,\n extrapolateRight: \"clamp\" as const,\n};\n\nfunction progress(frame: number, start: number, duration: number) {\n return interpolate(frame, [start, start + duration], [0, 1], {\n ...clamp,\n easing: Easing.out(Easing.cubic),\n });\n}\n\n/** Pop-in for labels and chips: a cubic ease-out, no overshoot. */\nfunction usePop(delay: number) {\n return progress(useAuditFrame(), delay, 12);\n}\n\nfunction Layer({ children }: { children: ReactNode }) {\n return (\n <svg\n width={1280}\n height={720}\n viewBox=\"0 0 1280 720\"\n style={{ position: \"absolute\", inset: 0, overflow: \"visible\" }}\n >\n {children}\n </svg>\n );\n}\n\ntype Side =\n | \"center\"\n | \"above\"\n | \"below\"\n | \"left\"\n | \"right\"\n | \"aboveStart\"\n | \"aboveEnd\"\n | \"belowStart\";\n\n/** Small spec label: mono text on a solid color chip. */\nfunction Pill({\n x,\n y,\n text,\n color,\n delay = 0,\n anchor = \"center\",\n ink = \"#fff\",\n}: {\n x: number;\n y: number;\n text: string;\n color: string;\n delay?: number;\n anchor?: Side;\n ink?: string;\n}) {\n const pop = usePop(delay);\n const shift = {\n center: \"translate(-50%, -50%)\",\n above: \"translate(-50%, calc(-100% - 5px))\",\n below: \"translate(-50%, 5px)\",\n left: \"translate(calc(-100% - 6px), -50%)\",\n right: \"translate(6px, -50%)\",\n aboveStart: \"translate(0, calc(-100% - 5px))\",\n aboveEnd: \"translate(-100%, calc(-100% - 5px))\",\n belowStart: \"translate(0, 5px)\",\n }[anchor];\n return (\n <div\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n transform: `${shift} scale(${0.7 + 0.3 * pop})`,\n opacity: Math.min(1, pop * 1.4),\n background: color,\n color: ink,\n fontFamily: MONO,\n fontSize: 10.5,\n fontWeight: 600,\n lineHeight: \"15px\",\n padding: \"0 5px\",\n borderRadius: 3,\n whiteSpace: \"nowrap\",\n }}\n >\n {text}\n </div>\n );\n}\n\n/**\n * Measurement between two points on one axis: end ticks snap in, the line\n * grows out from its middle, then the value pops on.\n */\nfunction Ruler({\n from,\n to,\n label,\n color,\n delay = 0,\n labelSide,\n}: {\n from: [number, number];\n to: [number, number];\n label: string;\n color: string;\n delay?: number;\n labelSide?: Side;\n}) {\n const frame = useAuditFrame();\n const grow = progress(frame, delay, 12);\n const ticks = progress(frame, delay - 2, 6);\n const horizontal = Math.abs(to[0] - from[0]) >= Math.abs(to[1] - from[1]);\n const mx = (from[0] + to[0]) / 2;\n const my = (from[1] + to[1]) / 2;\n const x1 = mx + (from[0] - mx) * grow;\n const y1 = my + (from[1] - my) * grow;\n const x2 = mx + (to[0] - mx) * grow;\n const y2 = my + (to[1] - my) * grow;\n const t = 4 * ticks;\n const tick = (x: number, y: number) =>\n horizontal ? `M${x} ${y - t}V${y + t}` : `M${x - t} ${y}H${x + t}`;\n return (\n <>\n <Layer>\n <path\n d={`${tick(...from)}${tick(...to)}`}\n stroke={color}\n strokeWidth={1.25}\n fill=\"none\"\n />\n <line\n x1={x1}\n y1={y1}\n x2={x2}\n y2={y2}\n stroke={color}\n strokeWidth={1.25}\n />\n </Layer>\n <Pill\n x={mx}\n y={my}\n text={label}\n color={color}\n delay={delay + 7}\n anchor={labelSide ?? (horizontal ? \"above\" : \"left\")}\n />\n </>\n );\n}\n\n/** Hairline box traced around an element, clockwise from the top left. */\nfunction OutlineBox({\n rect,\n color,\n delay = 0,\n radius = 3,\n inset = -3,\n dashed,\n fill,\n}: {\n rect: Rect;\n color: string;\n delay?: number;\n radius?: number;\n inset?: number;\n dashed?: boolean;\n fill?: string;\n}) {\n const frame = useAuditFrame();\n const draw = progress(frame, delay, 14);\n const x = rect.x + inset;\n const y = rect.y + inset;\n const w = rect.w - inset * 2;\n const h = rect.h - inset * 2;\n return (\n <Layer>\n <rect\n x={x}\n y={y}\n width={w}\n height={h}\n rx={radius}\n fill={fill ?? \"none\"}\n fillOpacity={draw}\n stroke={color}\n strokeWidth={1.25}\n pathLength={1}\n strokeDasharray={dashed ? undefined : `${draw} 1`}\n strokeOpacity={dashed ? draw : 1}\n style={dashed ? { strokeDasharray: \"3 3\" } : undefined}\n />\n </Layer>\n );\n}\n\n/** Quarter arc swept into a corner to call out its radius. */\nfunction CornerArc({\n x,\n y,\n r,\n color,\n label,\n delay = 0,\n}: {\n x: number;\n y: number;\n r: number;\n color: string;\n label: string;\n delay?: number;\n}) {\n const frame = useAuditFrame();\n const draw = progress(frame, delay, 12);\n const size = Math.max(r, 10) + 4;\n return (\n <>\n <Layer>\n <path\n d={`M${x} ${y + size}A${size} ${size} 0 0 1 ${x + size} ${y}`}\n stroke={color}\n strokeWidth={1.5}\n fill=\"none\"\n pathLength={1}\n strokeDasharray={`${draw} 1`}\n strokeLinecap=\"round\"\n />\n </Layer>\n <Pill\n x={x - 2}\n y={y - 2}\n text={label}\n color={color}\n delay={delay + 8}\n anchor=\"aboveStart\"\n />\n </>\n );\n}\n\n/**\n * Design-token tag: a dot lands on the element, a leader line runs out with\n * one elbow, and a dark chip with the token name settles at its end.\n */\nfunction TokenTag({\n anchor,\n at,\n label,\n swatch,\n delay = 0,\n lineColor = \"#0E121B\",\n}: {\n anchor: [number, number];\n at: [number, number];\n label: string;\n swatch: string;\n delay?: number;\n lineColor?: string;\n}) {\n const frame = useAuditFrame();\n const dot = usePop(delay);\n const draw = progress(frame, delay + 3, 14);\n const elbowY = at[1];\n const path = `M${anchor[0]} ${anchor[1]}L${anchor[0] + (at[0] - anchor[0]) * 0.35} ${elbowY}H${at[0]}`;\n return (\n <>\n <Layer>\n <path\n d={path}\n stroke={lineColor}\n strokeOpacity={0.55}\n strokeWidth={1}\n fill=\"none\"\n pathLength={1}\n strokeDasharray={`${draw} 1`}\n />\n <circle\n cx={anchor[0]}\n cy={anchor[1]}\n r={3.5 * dot}\n fill=\"#fff\"\n stroke={lineColor}\n strokeWidth={1.5}\n />\n </Layer>\n <TokenChip\n x={at[0]}\n y={at[1]}\n label={label}\n swatch={swatch}\n delay={delay + 13}\n />\n </>\n );\n}\n\nfunction TokenChip({\n x,\n y,\n label,\n swatch,\n delay = 0,\n}: {\n x: number;\n y: number;\n label: string;\n swatch: string;\n delay?: number;\n}) {\n const pop = usePop(delay);\n return (\n <div\n style={{\n position: \"absolute\",\n left: x,\n top: y,\n transform: `translate(-50%, -50%) translateY(${(1 - pop) * 6}px)`,\n opacity: Math.min(1, pop * 1.4),\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n background: \"#0E121B\",\n color: \"#fff\",\n fontFamily: MONO,\n fontSize: 11,\n lineHeight: \"22px\",\n padding: \"0 8px\",\n borderRadius: 5,\n whiteSpace: \"nowrap\",\n boxShadow: \"0 4px 10px -4px rgba(10,13,20,0.4)\",\n }}\n >\n <span\n style={{\n width: 8,\n height: 8,\n borderRadius: 4,\n background: swatch,\n boxShadow: \"0 0 0 1px rgba(255,255,255,0.35)\",\n }}\n />\n {label}\n </div>\n );\n}\n\n/** Guide line that drops down (vertical) or slides across (horizontal). */\nfunction Guide({\n x,\n y,\n length,\n vertical,\n color,\n delay = 0,\n dashed,\n width = 1,\n}: {\n x: number;\n y: number;\n length: number;\n vertical?: boolean;\n color: string;\n delay?: number;\n dashed?: boolean;\n width?: number;\n}) {\n const frame = useAuditFrame();\n const draw = progress(frame, delay, 16) * length;\n return (\n <Layer>\n <line\n x1={x}\n y1={y}\n x2={vertical ? x : x + draw}\n y2={vertical ? y + draw : y}\n stroke={color}\n strokeWidth={width}\n strokeDasharray={dashed ? \"4 4\" : undefined}\n />\n </Layer>\n );\n}\n\n/**\n * Scan band: a crisp line with a soft wash trailing behind it, the way the\n * fix pass sweeps the screen. `y` is the line's position.\n */\nfunction ScanBand({\n y,\n color,\n x = 0,\n w = 1280,\n trail = 90,\n opacity = 1,\n}: {\n y: number;\n color: string;\n x?: number;\n w?: number;\n trail?: number;\n opacity?: number;\n}) {\n return (\n <div\n style={{ position: \"absolute\", inset: 0, opacity, pointerEvents: \"none\" }}\n >\n <div\n style={{\n position: \"absolute\",\n left: x,\n width: w,\n top: y - trail,\n height: trail,\n background: `linear-gradient(to bottom, transparent, ${color}2E)`,\n }}\n />\n <div\n style={{\n position: \"absolute\",\n left: x,\n width: w,\n top: y - 1,\n height: 2,\n background: color,\n boxShadow: `0 0 12px 1px ${color}`,\n }}\n />\n </div>\n );\n}\n\n/** Stage-colored wash over everything except one rect, to push focus. */\nfunction Spotlight({\n rect,\n opacity,\n color = C.stage,\n}: {\n rect: Rect;\n opacity: number;\n color?: string;\n}) {\n const pad = 10;\n const x = rect.x - pad;\n const y = rect.y - pad;\n const w = rect.w + pad * 2;\n const h = rect.h + pad * 2;\n const r = 12;\n return (\n <svg\n width={1280}\n height={720}\n style={{ position: \"absolute\", inset: 0, opacity }}\n >\n <path\n fillRule=\"evenodd\"\n fill={color}\n fillOpacity={0.72}\n d={`M0 0H1280V720H0Z M${x + r} ${y}H${x + w - r}Q${x + w} ${y} ${x + w} ${y + r}V${y + h - r}Q${x + w} ${y + h} ${x + w - r} ${y + h}H${x + r}Q${x} ${y + h} ${x} ${y + h - r}V${y + r}Q${x} ${y} ${x + r} ${y}Z`}\n />\n </svg>\n );\n}\n\n/** Two full frames split at `y`: `top` shows above the line, `bottom` below. */\nfunction SplitAt({\n y,\n top,\n bottom,\n}: {\n y: number;\n top: ReactNode;\n bottom: ReactNode;\n}) {\n return (\n <>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n clipPath: `inset(${Math.max(0, y)}px 0 0 0)`,\n }}\n >\n {bottom}\n </div>\n <div\n style={{\n position: \"absolute\",\n inset: 0,\n clipPath: `inset(0 0 ${Math.max(0, 720 - y)}px 0)`,\n }}\n >\n {top}\n </div>\n </>\n );\n}\n\n/** Cubic ease-in-out between keyframes, clamped at both ends. */\nfunction easeInOut(frame: number, input: number[], output: number[]) {\n return interpolate(frame, input, output, {\n ...clamp,\n easing: Easing.inOut(Easing.cubic),\n });\n}\n\n/* Mark data */\n\ntype Point = [number, number];\n\n/** A distance between two points on one axis, with its value. */\ntype Measure = { from: Point; to: Point; label: string; side?: Side };\n/** A corner whose radius gets an arc and a label. `x`, `y` is the corner. */\ntype RadiusMark = { x: number; y: number; r: number; label: string };\n/** An off-spec element and the fix it needs. */\ntype Issue = {\n rect: Rect;\n note: string;\n side?: \"start\" | \"end\" | \"below\";\n};\n/** A token tag: dot on `anchor`, chip centered on `at`. */\ntype TokenSpec = {\n anchor: Point;\n at: Point;\n label: string;\n swatch: string;\n};\n/** Layout guides over a column grid. */\ntype GuideSpec = {\n /** x of every column edge, left to right. */\n columns: number[];\n top: number;\n bottom: number;\n /** One column (or any rect) to fill and label. */\n highlight?: { rect: Rect; label: string };\n /** A measurement drawn with the guides, like a gutter width. */\n ruler?: Measure;\n /** A horizontal marker line across the grid, like a calendar's now line. */\n now?: { y: number; from: number; to: number; label: string };\n};\n\nconst AUDIT_COLORS = {\n audit: C.error,\n fix: C.blue,\n scan: C.primary,\n ink: C.ink,\n stage: C.stage,\n};\n\n/** Spacing and size redlines across the demo header, tabs and first cards. */\nfunction demoMeasures(l: DemoLayout): Measure[] {\n const card = l.cards[0];\n const next = l.cards[1];\n const tabsBottom = l.tabs[0].y + 32;\n const headerBottom = l.header.y + l.header.h;\n const tabGapX = l.tabs[1].x + l.tabs[1].w + 7;\n const right = l.button.x + l.button.w + 8;\n return [\n {\n from: [l.header.x, l.tabs[0].y + 16],\n to: [l.contentX, l.tabs[0].y + 16],\n label: `pad ${l.pad}`,\n side: \"below\",\n },\n {\n from: [tabGapX, headerBottom],\n to: [tabGapX, l.tabs[0].y],\n label: `${l.tabs[0].y - headerBottom}`,\n side: \"right\",\n },\n {\n from: [next.rect.x + 150, tabsBottom],\n to: [next.rect.x + 150, next.rect.y],\n label: `${next.rect.y - tabsBottom}`,\n side: \"right\",\n },\n {\n from: [card.rect.x + card.rect.w, card.rect.y + 46],\n to: [next.rect.x, card.rect.y + 46],\n label: `gap ${l.gap}`,\n },\n {\n from: [card.rect.x, card.title.y + 9],\n to: [card.title.x, card.title.y + 9],\n label: `${l.cardPad}`,\n side: \"left\",\n },\n {\n from: [card.title.x + 96, card.rect.y],\n to: [card.title.x + 96, card.title.y],\n label: `${l.cardPad}`,\n side: \"right\",\n },\n {\n from: [right, l.button.y],\n to: [right, l.button.y + l.button.h],\n label: `h ${l.button.h}`,\n side: \"below\",\n },\n ];\n}\n\nfunction demoRadii(l: DemoLayout): RadiusMark[] {\n const next = l.cards[1].rect;\n return [{ x: next.x, y: next.y, r: l.radius, label: `radius ${l.radius}` }];\n}\n\nfunction demoIssues(l: DemoLayout): Issue[] {\n return [\n { rect: l.cards[0].title, note: \"13.5 → 14\", side: \"start\" },\n { rect: l.cards[0].status, note: \"radius 4 → 6\", side: \"below\" },\n { rect: l.cards[0].chevron, note: \"hit 20 → 24\", side: \"end\" },\n { rect: l.button, note: \"#8B5CF6 ≠ primary\", side: \"end\" },\n { rect: l.sideActive, note: \"radius 5 → 8\", side: \"start\" },\n { rect: l.events[2].rect, note: \"radius 4 → 8\", side: \"start\" },\n { rect: l.events[6].rect, note: \"pad 6 → 8\", side: \"start\" },\n ];\n}\n\nfunction demoTokens(l: DemoLayout): TokenSpec[] {\n const [c0, c1, c2, c3] = l.cards;\n const chipY = l.calendar.y + 70;\n return [\n {\n anchor: [c0.status.x + 12, c0.status.y + 13],\n at: [c0.rect.x + 50, chipY + 50],\n label: \"state/success/lighter\",\n swatch: C.successBg,\n },\n {\n anchor: [c0.title.x + 40, c0.title.y + 9],\n at: [c0.rect.x + 170, chipY],\n label: \"text/strong-950\",\n swatch: C.ink,\n },\n {\n anchor: [c1.status.x + 12, c1.status.y + 13],\n at: [c1.rect.x + 110, chipY + 92],\n label: \"state/warning/base\",\n swatch: C.warning,\n },\n {\n anchor: [c2.status.x + 12, c2.status.y + 13],\n at: [c2.rect.x + 90, chipY + 20],\n label: \"state/error/base\",\n swatch: C.error,\n },\n {\n anchor: [c3.rect.x + c3.rect.w, c3.rect.y + 40],\n at: [c3.rect.x + 90, chipY + 70],\n label: \"stroke/soft-200\",\n swatch: C.stroke,\n },\n ];\n}\n\nfunction demoGuides(l: DemoLayout): GuideSpec {\n const cal = l.calendar;\n const today = l.columns[0];\n return {\n columns: [...l.columns.map((col) => col.x), cal.x + cal.w],\n top: cal.y,\n bottom: cal.y + cal.h,\n highlight: { rect: today, label: \"Mon 2 · today\" },\n ruler: {\n from: [cal.x, cal.y + l.dayHeaderH + 14],\n to: [cal.x + l.gutter, cal.y + l.dayHeaderH + 14],\n label: `w ${l.gutter}`,\n side: \"below\",\n },\n now: {\n y: cal.y + l.dayHeaderH + 1.25 * l.hourH,\n from: cal.x + l.gutter,\n to: cal.x + cal.w,\n label: \"10:15 AM\",\n },\n };\n}\n\n/** Close-up spec of the first card, sized for a zoomed camera. */\nfunction demoFocus(l: DemoLayout) {\n const card = l.cards[0];\n const r = card.rect;\n const below = r.y + r.h + 34;\n return {\n rect: r,\n measures: [\n {\n from: [r.x, card.title.y + 9],\n to: [card.title.x, card.title.y + 9],\n label: `${l.cardPad}`,\n side: \"below\",\n },\n {\n from: [card.title.x + 110, r.y],\n to: [card.title.x + 110, card.title.y],\n label: `${l.cardPad}`,\n side: \"right\",\n },\n {\n from: [r.x + r.w + 8, card.status.y],\n to: [r.x + r.w + 8, card.status.y + card.status.h],\n label: `h ${card.status.h}`,\n side: \"right\",\n },\n {\n from: [card.chevron.x - 2, card.chevron.y - 6],\n to: [card.chevron.x + card.chevron.w + 2, card.chevron.y - 6],\n label: \"24\",\n },\n ] as Measure[],\n radii: [{ x: r.x, y: r.y, r: l.radius, label: `radius ${l.radius}` }],\n tokens: [\n {\n anchor: [card.status.x + 12, card.status.y + 13],\n at: [r.x + 40, below],\n label: \"state/success/base\",\n swatch: C.success,\n },\n {\n anchor: [card.title.x + 60, card.title.y + 9],\n at: [r.x + 205, below - 4],\n label: \"text/strong-950\",\n swatch: C.ink,\n },\n {\n anchor: [card.time.x + 40, card.time.y + 8],\n at: [r.x + 70, below + 30],\n label: \"text/sub-600\",\n swatch: C.sub,\n },\n {\n anchor: [r.x + r.w, r.y + 30],\n at: [r.x + 230, below + 30],\n label: \"stroke/soft-200\",\n swatch: C.stroke,\n },\n ] as TokenSpec[],\n };\n}\n\nfunction demoSet(v: Version) {\n const l = demoLayout(v);\n return {\n layout: l,\n measures: demoMeasures(l),\n radii: demoRadii(l),\n issues: demoIssues(l),\n tokens: demoTokens(l),\n guides: demoGuides(l),\n focus: demoFocus(l),\n /** Rect around the tabs and the card row. */\n cardRow: {\n x: l.contentX,\n y: l.tabs[0].y,\n w: l.calendar.w,\n h: l.cards[0].rect.y + 92 - l.tabs[0].y,\n } satisfies Rect,\n };\n}\n\n/** Mark data measured off the demo dashboard: `before` is v1, `after` v2. */\nconst DEMO = { before: demoSet(1), after: demoSet(2) };\nconst DEMO_WINDOW = WIN;\n\n/* Mark sets */\n\n/** Rulers then radius arcs, each `stagger` frames after the last. */\nfunction MeasureMarks({\n measures,\n radii = [],\n color,\n start = 0,\n stagger = 5,\n}: {\n measures: Measure[];\n radii?: RadiusMark[];\n color: string;\n start?: number;\n stagger?: number;\n}) {\n return (\n <>\n {measures.map((m, i) => (\n <Ruler\n key={`${m.from.join()}-${m.to.join()}`}\n from={m.from}\n to={m.to}\n label={m.label}\n color={color}\n delay={start + i * stagger}\n labelSide={m.side}\n />\n ))}\n {radii.map((r, i) => (\n <CornerArc\n key={`${r.x}-${r.y}`}\n x={r.x}\n y={r.y}\n r={r.r}\n label={r.label}\n color={color}\n delay={start + (measures.length + i) * stagger}\n />\n ))}\n </>\n );\n}\n\nconst NOTE_SPOT = {\n start: (r: Rect) => ({\n x: r.x - 3,\n y: r.y - 3,\n anchor: \"aboveStart\" as const,\n }),\n end: (r: Rect) => ({\n x: r.x + r.w + 3,\n y: r.y - 3,\n anchor: \"aboveEnd\" as const,\n }),\n below: (r: Rect) => ({\n x: r.x - 3,\n y: r.y + r.h + 3,\n anchor: \"belowStart\" as const,\n }),\n};\n\n/** Every issue boxed, with its note popping on once the box closes. */\nfunction IssueMarks({\n issues,\n color,\n start = 0,\n stagger = 4,\n}: {\n issues: Issue[];\n color: string;\n start?: number;\n stagger?: number;\n}) {\n return (\n <>\n {issues.map((issue, i) => (\n <div key={`${issue.rect.x}-${issue.rect.y}-${issue.note}`}>\n <OutlineBox\n rect={issue.rect}\n color={color}\n delay={start + i * stagger}\n />\n <Pill\n {...NOTE_SPOT[issue.side ?? \"start\"](issue.rect)}\n text={issue.note}\n color={color}\n delay={start + i * stagger + 10}\n />\n </div>\n ))}\n </>\n );\n}\n\nfunction TokenMarks({\n tokens,\n start = 0,\n stagger = 6,\n lineColor,\n}: {\n tokens: TokenSpec[];\n start?: number;\n stagger?: number;\n lineColor?: string;\n}) {\n return (\n <>\n {tokens.map((tag, i) => (\n <TokenTag\n key={`${tag.label}-${tag.anchor.join()}`}\n anchor={tag.anchor}\n at={tag.at}\n label={tag.label}\n swatch={tag.swatch}\n lineColor={lineColor}\n delay={start + i * stagger}\n />\n ))}\n </>\n );\n}\n\n/** Column guides drop in, the highlight fills, then the now line slides across. */\nfunction GuideMarks({\n guides,\n color,\n nowColor = C.primary,\n start = 0,\n}: {\n guides: GuideSpec;\n color: string;\n nowColor?: string;\n start?: number;\n}) {\n const { columns, top, bottom, highlight, ruler, now } = guides;\n const h = highlight?.rect;\n return (\n <>\n {columns.map((x, i) => (\n <Guide\n key={x}\n x={x}\n y={top}\n length={bottom - top}\n vertical\n color={color}\n dashed\n delay={start + i * 3}\n />\n ))}\n {h && highlight && (\n <>\n <OutlineBox\n rect={h}\n color={color}\n fill={`${color}14`}\n inset={0}\n radius={0}\n delay={start + 14}\n />\n <OutlineBox\n rect={{ x: h.x + 6, y: h.y + 4, w: h.w - 12, h: 22 }}\n color={color}\n radius={4}\n inset={0}\n delay={start + 20}\n />\n <Pill\n x={h.x + h.w / 2}\n y={h.y + 4}\n text={highlight.label}\n color={color}\n delay={start + 26}\n anchor=\"above\"\n />\n </>\n )}\n {ruler && (\n <Ruler\n from={ruler.from}\n to={ruler.to}\n label={ruler.label}\n color={color}\n delay={start + 24}\n labelSide={ruler.side}\n />\n )}\n {now && (\n <>\n <Guide\n x={now.from}\n y={now.y}\n length={now.to - now.from}\n color={nowColor}\n width={1.5}\n delay={start + 30}\n />\n <Pill\n x={now.from}\n y={now.y}\n text={now.label}\n color={nowColor}\n delay={start + 30}\n anchor=\"left\"\n />\n </>\n )}\n </>\n );\n}\n\n/** Brand name with a version chip that flips once the fix lands. */\nfunction VersionChip({\n brand,\n versions,\n fixed,\n colors,\n}: {\n brand: string;\n versions: [string, string];\n fixed: boolean;\n colors: [string, string];\n}) {\n return (\n <div\n style={{\n position: \"absolute\",\n left: WIN.x,\n top: 26,\n display: \"flex\",\n alignItems: \"center\",\n gap: 8,\n fontSize: 15,\n fontWeight: 600,\n color: C.ink,\n }}\n >\n {brand}\n <span\n style={{\n fontFamily: MONO,\n fontSize: 11,\n color: \"#fff\",\n background: fixed ? colors[1] : colors[0],\n borderRadius: 999,\n padding: \"1px 8px\",\n }}\n >\n {fixed ? versions[1] : versions[0]}\n </span>\n </div>\n );\n}\n\ntype TokenTagsProps = {\n /** UI to tag, laid out in a 1280x720 frame. Defaults to a demo calendar dashboard. */\n children?: ReactNode;\n /** Token tags: a dot on `anchor`, the chip centered on `at`, in frame pixels. */\n tokens?: TokenSpec[];\n /** Area kept bright while the rest washes out. `null` skips the wash. */\n focus?: Rect | null;\n lineColor?: string;\n background?: string;\n /** Frames between one tag and the next. */\n stagger?: number;\n speed?: number;\n};\n\nconst tokenTagsDefaults = {\n lineColor: AUDIT_COLORS.ink,\n background: AUDIT_COLORS.stage,\n stagger: 6,\n speed: 1,\n};\n\nconst tokenTagsLength = 61;\n\nconst START = 12;\n\nfunction TokenTagsBase(props: TokenTagsProps) {\n const { speed = 1 } = props;\n return (\n <AuditClock speed={speed}>\n <Scene {...props} />\n </AuditClock>\n );\n}\n\nfunction Scene({\n children,\n tokens = children ? [] : DEMO.after.tokens,\n focus = children ? null : DEMO.after.cardRow,\n lineColor = tokenTagsDefaults.lineColor,\n background = tokenTagsDefaults.background,\n stagger = tokenTagsDefaults.stagger,\n}: TokenTagsProps) {\n const frame = useAuditFrame();\n return (\n <AbsoluteFill style={{ background, fontFamily: FONT }}>\n {children ?? <DemoDashboard v={2} />}\n {focus && (\n <Spotlight\n rect={focus}\n color={background}\n opacity={easeInOut(frame, [0, 12], [0, 1])}\n />\n )}\n <TokenMarks\n tokens={tokens}\n start={START}\n stagger={stagger}\n lineColor={lineColor}\n />\n </AbsoluteFill>\n );\n}\n\nconst elementSchema = {\n ...Interactive.baseSchema,\n lineColor: {\n type: \"color\",\n default: \"#0E121B\",\n description: \"Leaders\",\n },\n background: {\n type: \"color\",\n default: \"#EDEDEF\",\n description: \"Background\",\n },\n stagger: {\n type: \"number\",\n min: 1,\n max: 12,\n step: 1,\n default: 6,\n description: \"Stagger\",\n hiddenFromList: false,\n },\n speed: {\n type: \"number\",\n default: 1,\n min: 0.25,\n max: 4,\n step: 0.25,\n description: \"Speed\",\n hiddenFromList: false,\n },\n ...Interactive.transformSchema,\n} as const satisfies InteractivitySchema;\n\nconst ELEMENT_PROP_KEYS = new Set([\"lineColor\",\"background\",\"stagger\",\"speed\"]);\n\nconst ELEMENT_PROP_DEFAULTS: Record<string, unknown> = {\n lineColor: \"#0E121B\",\n background: \"#EDEDEF\",\n stagger: 6,\n speed: 1,\n};\n\ntype TokenTagsElementProps = InteractiveBaseProps &\n InteractiveTransformProps &\n ComponentProps<typeof TokenTagsBase>;\n\nconst TokenTagsInner = forwardRef<\n HTMLDivElement,\n TokenTagsElementProps & { readonly controls: SequenceControls | undefined }\n>(({ controls, name, style, ...rest }, ref) => {\n const outlineRef = useRef<HTMLDivElement>(null);\n useImperativeHandle(ref, () => outlineRef.current as HTMLDivElement, []);\n const componentProps: Record<string, unknown> = { ...ELEMENT_PROP_DEFAULTS };\n const sequenceProps: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(rest)) {\n if (ELEMENT_PROP_KEYS.has(key)) {\n if (value !== undefined) componentProps[key] = value;\n } else {\n sequenceProps[key] = value;\n }\n }\n return (\n <Sequence\n layout=\"none\"\n {...sequenceProps}\n controls={controls}\n name={name ?? \"<TokenTags>\"}\n outlineRef={outlineRef}\n >\n <div\n ref={outlineRef}\n style={{\n position: \"relative\",\n width: \"100%\",\n height: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n ...style,\n }}\n >\n <TokenTagsBase\n {...(componentProps as unknown as ComponentProps<typeof TokenTagsBase>)}\n />\n </div>\n </Sequence>\n );\n});\n\nexport const TokenTags = Interactive.withSchema({\n Component: TokenTagsInner,\n componentName: \"<TokenTags>\",\n componentIdentity: null,\n schema: elementSchema,\n supportsEffects: false,\n});\n"+ },+ "durationInFrames": 61+}diff --git a/registry-artifacts/layout-guides.json b/registry-artifacts/layout-guides.jsonnew file mode 100644index 00000000..7de94cd5--- /dev/null+++ b/registry-artifacts/layout-guides.json@@ -0,0 +1,17 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "layout-guides",+ "title": "Layout Guides",+ "description": "Dashed column guides drop over a grid, one column fills and gets a label, a gutter is measured and a now line slides across.",+ "dependencies": ["remotion"],+ "registryDependencies": ["@remocn/audit-core"],+ "files": [+ {+ "path": "registry/remocn/layout-guides/index.tsx",+ "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { AbsoluteFill } from \"remotion\";\nimport {\n AUDIT_COLORS,\n AuditClock,\n DEMO,\n DemoDashboard,\n FONT,\n GuideMarks,\n type GuideSpec,\n} from \"@/lib/remocn/audit-core\";\n\nexport type LayoutGuidesProps = {\n /** UI to lay guides over, in a 1280x720 frame. Defaults to a demo calendar dashboard. */\n children?: ReactNode;\n /** Column edges, highlight, ruler and now line, in frame pixels. */\n guides?: GuideSpec;\n color?: string;\n /** Color of the now line and its label. */\n nowColor?: string;\n background?: string;\n speed?: number;\n};\n\nexport const layoutGuidesDefaults = {\n color: AUDIT_COLORS.fix,\n nowColor: AUDIT_COLORS.scan,\n background: AUDIT_COLORS.stage,\n speed: 1,\n};\n\nexport const layoutGuidesLength = 54;\n\nexport function LayoutGuides(props: LayoutGuidesProps) {\n const { speed = 1 } = props;\n return (\n <AuditClock speed={speed}>\n <Scene {...props} />\n </AuditClock>\n );\n}\n\nfunction Scene({\n children,\n guides = children ? undefined : DEMO.after.guides,\n color = layoutGuidesDefaults.color,\n nowColor = layoutGuidesDefaults.nowColor,\n background = layoutGuidesDefaults.background,\n}: LayoutGuidesProps) {\n return (\n <AbsoluteFill style={{ background, fontFamily: FONT }}>\n {children ?? <DemoDashboard v={2} />}\n {guides && (\n <GuideMarks\n guides={guides}\n color={color}\n nowColor={nowColor}\n start={8}\n />\n )}\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/layout-guides.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/redline-measure.json b/registry-artifacts/redline-measure.jsonnew file mode 100644index 00000000..92627d63--- /dev/null+++ b/registry-artifacts/redline-measure.json@@ -0,0 +1,17 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "redline-measure",+ "title": "Redline Measure",+ "description": "Spacing and size redlines draw over a UI one by one: ticks snap in, the line grows from its middle and the value pops on.",+ "dependencies": ["remotion"],+ "registryDependencies": ["@remocn/audit-core"],+ "files": [+ {+ "path": "registry/remocn/redline-measure/index.tsx",+ "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { AbsoluteFill } from \"remotion\";\nimport {\n AUDIT_COLORS,\n AuditClock,\n DEMO,\n DemoDashboard,\n easeInOut,\n FONT,\n type Measure,\n MeasureMarks,\n type RadiusMark,\n useAuditFrame,\n} from \"@/lib/remocn/audit-core\";\n\nexport type RedlineMeasureProps = {\n /** UI to measure, laid out in a 1280x720 frame. Defaults to a demo calendar dashboard. */\n children?: ReactNode;\n /** Distances to draw, in frame pixels. Defaults to spacing on the demo dashboard. */\n measures?: Measure[];\n /** Corners whose radius gets an arc and a label. */\n radii?: RadiusMark[];\n color?: string;\n background?: string;\n /** How far the UI fades toward the background so the marks read, 0 to 1. */\n dim?: number;\n /** Frames between one mark and the next. */\n stagger?: number;\n speed?: number;\n};\n\nexport const redlineMeasureDefaults = {\n color: AUDIT_COLORS.audit,\n background: AUDIT_COLORS.stage,\n dim: 0.18,\n stagger: 5,\n speed: 1,\n};\n\nexport const redlineMeasureLength = 63;\n\nconst START = 8;\n\nexport function RedlineMeasure(props: RedlineMeasureProps) {\n const { speed = 1 } = props;\n return (\n <AuditClock speed={speed}>\n <Scene {...props} />\n </AuditClock>\n );\n}\n\nfunction Scene({\n children,\n measures = children ? [] : DEMO.before.measures,\n radii = children ? [] : DEMO.before.radii,\n color = redlineMeasureDefaults.color,\n background = redlineMeasureDefaults.background,\n dim = redlineMeasureDefaults.dim,\n stagger = redlineMeasureDefaults.stagger,\n}: RedlineMeasureProps) {\n const frame = useAuditFrame();\n return (\n <AbsoluteFill style={{ background, fontFamily: FONT }}>\n {children ?? <DemoDashboard v={1} />}\n <AbsoluteFill\n style={{ background, opacity: easeInOut(frame, [0, 10], [0, dim]) }}\n />\n <MeasureMarks\n measures={measures}\n radii={radii}\n color={color}\n start={START}\n stagger={stagger}\n />\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/redline-measure.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/registry.json b/registry-artifacts/registry.jsonindex 49ebc1ab..b24f3cab 100644--- a/registry-artifacts/registry.json+++ b/registry-artifacts/registry.json@@ -11592,6 +11592,110 @@],"type": "registry:component"},+ {+ "name": "audit-core",+ "title": "Audit Core",+ "description": "Shared kit behind the design-review components: redline rulers, issue boxes, radius arcs, token tags, layout guides, the scan band and a demo dashboard to measure.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "registry/remocn/audit-core/index.tsx",+ "type": "registry:lib",+ "target": "lib/remocn/audit-core.tsx"+ }+ ],+ "type": "registry:lib"+ },+ {+ "name": "redline-measure",+ "title": "Redline Measure",+ "description": "Spacing and size redlines draw over a UI one by one: ticks snap in, the line grows from its middle and the value pops on.",+ "dependencies": ["remotion"],+ "registryDependencies": ["@remocn/audit-core"],+ "files": [+ {+ "path": "registry/remocn/redline-measure/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/redline-measure.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "audit-boxes",+ "title": "Audit Boxes",+ "description": "Off-spec elements of a UI get traced with red boxes, each with the fix it needs, while an issue counter ticks up.",+ "dependencies": ["remotion"],+ "registryDependencies": ["@remocn/audit-core"],+ "files": [+ {+ "path": "registry/remocn/audit-boxes/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/audit-boxes.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "scan-fix",+ "title": "Scan Fix",+ "description": "A scan band sweeps down a screen: below it the old build with red redlines, above it the fixed build with blue ones, and the version chip flips.",+ "dependencies": ["remotion"],+ "registryDependencies": ["@remocn/audit-core"],+ "files": [+ {+ "path": "registry/remocn/scan-fix/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/scan-fix.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "token-tags",+ "title": "Token Tags",+ "description": "The rest of the UI washes out and leader lines run from elements to dark chips naming the design tokens they use.",+ "dependencies": ["remotion"],+ "registryDependencies": ["@remocn/audit-core"],+ "files": [+ {+ "path": "registry/remocn/token-tags/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/token-tags.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "layout-guides",+ "title": "Layout Guides",+ "description": "Dashed column guides drop over a grid, one column fills and gets a label, a gutter is measured and a now line slides across.",+ "dependencies": ["remotion"],+ "registryDependencies": ["@remocn/audit-core"],+ "files": [+ {+ "path": "registry/remocn/layout-guides/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/layout-guides.tsx"+ }+ ],+ "type": "registry:component"+ },+ {+ "name": "design-audit",+ "title": "Design Audit",+ "description": "A full design review in one scene: redlines and issue boxes, a scan that ships the fix, a camera push into one card with specs and tokens, then layout guides.",+ "dependencies": ["remotion"],+ "registryDependencies": ["@remocn/audit-core"],+ "files": [+ {+ "path": "registry/remocn/design-audit/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/design-audit.tsx"+ }+ ],+ "type": "registry:component"+ },{"name": "remocn-ui","title": "remocn UI Core",diff --git a/registry-artifacts/scan-fix.json b/registry-artifacts/scan-fix.jsonnew file mode 100644index 00000000..476ce6c8--- /dev/null+++ b/registry-artifacts/scan-fix.json@@ -0,0 +1,17 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "scan-fix",+ "title": "Scan Fix",+ "description": "A scan band sweeps down a screen: below it the old build with red redlines, above it the fixed build with blue ones, and the version chip flips.",+ "dependencies": ["remotion"],+ "registryDependencies": ["@remocn/audit-core"],+ "files": [+ {+ "path": "registry/remocn/scan-fix/index.tsx",+ "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { AbsoluteFill } from \"remotion\";\nimport {\n AUDIT_COLORS,\n AuditClock,\n DEMO,\n DemoDashboard,\n easeInOut,\n FONT,\n IssueMarks,\n MeasureMarks,\n ScanBand,\n SplitAt,\n useAuditFrame,\n VersionChip,\n} from \"@/lib/remocn/audit-core\";\n\nexport type ScanFixProps = {\n /** Frame before the fix, 1280x720. Defaults to the demo dashboard with red redlines. */\n before?: ReactNode;\n /** Frame after the fix, same size. Defaults to the fixed dashboard with blue redlines. */\n after?: ReactNode;\n /** Name next to the version chip. Empty hides the chip. */\n brand?: string;\n /** Version chip text before and after the band passes it. */\n versions?: [string, string];\n scanColor?: string;\n beforeColor?: string;\n afterColor?: string;\n background?: string;\n speed?: number;\n};\n\nexport const scanFixDefaults = {\n brand: \"Synergy\",\n versions: [\"v1.0\", \"v2.0\"] as [string, string],\n scanColor: AUDIT_COLORS.scan,\n beforeColor: AUDIT_COLORS.audit,\n afterColor: AUDIT_COLORS.fix,\n background: AUDIT_COLORS.stage,\n speed: 1,\n};\n\nexport const scanFixLength = 100;\n\nconst SCAN_START = 18;\nconst SCAN_LENGTH = 80;\n\nexport function ScanFix(props: ScanFixProps) {\n const { speed = 1 } = props;\n return (\n <AuditClock speed={speed}>\n <Scene {...props} />\n </AuditClock>\n );\n}\n\nfunction DemoBefore({ color }: { color: string }) {\n return (\n <>\n <DemoDashboard v={1} />\n <MeasureMarks\n measures={DEMO.before.measures}\n radii={DEMO.before.radii}\n color={color}\n start={-200}\n />\n <IssueMarks issues={DEMO.before.issues} color={color} start={-200} />\n </>\n );\n}\n\nfunction DemoAfter({ color }: { color: string }) {\n return (\n <>\n <DemoDashboard v={2} />\n <MeasureMarks\n measures={DEMO.after.measures}\n radii={DEMO.after.radii}\n color={color}\n start={-200}\n />\n </>\n );\n}\n\nfunction Scene({\n before,\n after,\n brand = scanFixDefaults.brand,\n versions = scanFixDefaults.versions,\n scanColor = scanFixDefaults.scanColor,\n beforeColor = scanFixDefaults.beforeColor,\n afterColor = scanFixDefaults.afterColor,\n background = scanFixDefaults.background,\n}: ScanFixProps) {\n const frame = useAuditFrame();\n const y = easeInOut(\n frame,\n [SCAN_START, SCAN_START + SCAN_LENGTH],\n [-20, 760],\n );\n const band = easeInOut(\n frame,\n [\n SCAN_START - 4,\n SCAN_START + 2,\n SCAN_START + SCAN_LENGTH - 6,\n SCAN_START + SCAN_LENGTH + 2,\n ],\n [0, 1, 1, 0],\n );\n return (\n <AbsoluteFill style={{ background, fontFamily: FONT }}>\n <SplitAt\n y={y}\n bottom={before ?? <DemoBefore color={beforeColor} />}\n top={after ?? <DemoAfter color={afterColor} />}\n />\n {brand && (\n <VersionChip\n brand={brand}\n versions={versions}\n fixed={y > 36}\n colors={[beforeColor, afterColor]}\n />\n )}\n <ScanBand y={y} color={scanColor} opacity={band} />\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/scan-fix.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry-artifacts/token-tags.json b/registry-artifacts/token-tags.jsonnew file mode 100644index 00000000..aa59ad0d--- /dev/null+++ b/registry-artifacts/token-tags.json@@ -0,0 +1,17 @@+{+ "$schema": "https://ui.shadcn.com/schema/registry-item.json",+ "name": "token-tags",+ "title": "Token Tags",+ "description": "The rest of the UI washes out and leader lines run from elements to dark chips naming the design tokens they use.",+ "dependencies": ["remotion"],+ "registryDependencies": ["@remocn/audit-core"],+ "files": [+ {+ "path": "registry/remocn/token-tags/index.tsx",+ "content": "\"use client\";\n\nimport type { ReactNode } from \"react\";\nimport { AbsoluteFill } from \"remotion\";\nimport {\n AUDIT_COLORS,\n AuditClock,\n DEMO,\n DemoDashboard,\n easeInOut,\n FONT,\n type Rect,\n Spotlight,\n TokenMarks,\n type TokenSpec,\n useAuditFrame,\n} from \"@/lib/remocn/audit-core\";\n\nexport type TokenTagsProps = {\n /** UI to tag, laid out in a 1280x720 frame. Defaults to a demo calendar dashboard. */\n children?: ReactNode;\n /** Token tags: a dot on `anchor`, the chip centered on `at`, in frame pixels. */\n tokens?: TokenSpec[];\n /** Area kept bright while the rest washes out. `null` skips the wash. */\n focus?: Rect | null;\n lineColor?: string;\n background?: string;\n /** Frames between one tag and the next. */\n stagger?: number;\n speed?: number;\n};\n\nexport const tokenTagsDefaults = {\n lineColor: AUDIT_COLORS.ink,\n background: AUDIT_COLORS.stage,\n stagger: 6,\n speed: 1,\n};\n\nexport const tokenTagsLength = 61;\n\nconst START = 12;\n\nexport function TokenTags(props: TokenTagsProps) {\n const { speed = 1 } = props;\n return (\n <AuditClock speed={speed}>\n <Scene {...props} />\n </AuditClock>\n );\n}\n\nfunction Scene({\n children,\n tokens = children ? [] : DEMO.after.tokens,\n focus = children ? null : DEMO.after.cardRow,\n lineColor = tokenTagsDefaults.lineColor,\n background = tokenTagsDefaults.background,\n stagger = tokenTagsDefaults.stagger,\n}: TokenTagsProps) {\n const frame = useAuditFrame();\n return (\n <AbsoluteFill style={{ background, fontFamily: FONT }}>\n {children ?? <DemoDashboard v={2} />}\n {focus && (\n <Spotlight\n rect={focus}\n color={background}\n opacity={easeInOut(frame, [0, 12], [0, 1])}\n />\n )}\n <TokenMarks\n tokens={tokens}\n start={START}\n stagger={stagger}\n lineColor={lineColor}\n />\n </AbsoluteFill>\n );\n}\n",+ "type": "registry:component",+ "target": "components/remocn/token-tags.tsx"+ }+ ],+ "type": "registry:component"+}diff --git a/registry/__index__.tsx b/registry/__index__.tsxindex cbce1b71..29d9e5ae 100644--- a/registry/__index__.tsx+++ b/registry/__index__.tsx@@ -9067,6 +9067,64 @@ const registry: Record<string, RegistryEntry> = {(m) => m.featureFlagRolloutConfig,),},+ "redline-measure": {+ load: () =>+ import("@/registry/remocn/redline-measure").then((m) => ({+ default: m.RedlineMeasure,+ })),+ loadConfig: () =>+ import("@/registry/remocn/redline-measure/config").then(+ (m) => m.redlineMeasureConfig,+ ),+ },+ "audit-boxes": {+ load: () =>+ import("@/registry/remocn/audit-boxes").then((m) => ({+ default: m.AuditBoxes,+ })),+ loadConfig: () =>+ import("@/registry/remocn/audit-boxes/config").then(+ (m) => m.auditBoxesConfig,+ ),+ },+ "scan-fix": {+ load: () =>+ import("@/registry/remocn/scan-fix").then((m) => ({+ default: m.ScanFix,+ })),+ loadConfig: () =>+ import("@/registry/remocn/scan-fix/config").then((m) => m.scanFixConfig),+ },+ "token-tags": {+ load: () =>+ import("@/registry/remocn/token-tags").then((m) => ({+ default: m.TokenTags,+ })),+ loadConfig: () =>+ import("@/registry/remocn/token-tags/config").then(+ (m) => m.tokenTagsConfig,+ ),+ },+ "layout-guides": {+ load: () =>+ import("@/registry/remocn/layout-guides").then((m) => ({+ default: m.LayoutGuides,+ })),+ loadConfig: () =>+ import("@/registry/remocn/layout-guides/config").then(+ (m) => m.layoutGuidesConfig,+ ),+ },+ "design-audit": {+ load: () =>+ import("@/registry/remocn/design-audit").then((m) => ({+ default: m.DesignAudit,+ })),+ loadConfig: () =>+ import("@/registry/remocn/design-audit/config").then(+ (m) => m.designAuditConfig,+ ),+ },};const configCache = new Map<string, Promise<ResolvedComponentConfig>>();diff --git a/registry/__manifest__.ts b/registry/__manifest__.tsindex 4963691c..aeb84a33 100644--- a/registry/__manifest__.ts+++ b/registry/__manifest__.ts@@ -401,6 +401,26 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "audit-boxes": {+ durationInFrames: 83,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#EDEDEF",+ },+ defaults: {+ color: "#FB3748",+ background: "#EDEDEF",+ counterLabel: "issues",+ stagger: 4,+ speed: 1,+ },+ card: {+ fit: false,+ },+ },"axis-flex": {durationInFrames: 150,fps: 30,@@ -3016,6 +3036,27 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "design-audit": {+ durationInFrames: 340,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#EDEDEF",+ },+ defaults: {+ brand: "Synergy",+ auditColor: "#FB3748",+ fixColor: "#335CFF",+ scanColor: "#7D52F4",+ background: "#EDEDEF",+ speed: 1,+ },+ card: {+ fit: false,+ },+ },"device-grows-around": {durationInFrames: 186,fps: 30,@@ -7029,6 +7070,25 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "layout-guides": {+ durationInFrames: 81,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#EDEDEF",+ },+ defaults: {+ color: "#335CFF",+ nowColor: "#7D52F4",+ background: "#EDEDEF",+ speed: 1,+ },+ card: {+ fit: false,+ },+ },"layout-swap": {durationInFrames: 170,fps: 30,@@ -9497,6 +9557,26 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "redline-measure": {+ durationInFrames: 90,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#EDEDEF",+ },+ defaults: {+ color: "#FB3748",+ background: "#EDEDEF",+ dim: 0.18,+ stagger: 5,+ speed: 1,+ },+ card: {+ fit: false,+ },+ },reel: {durationInFrames: 160,fps: 30,@@ -10059,6 +10139,27 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "scan-fix": {+ durationInFrames: 127,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#EDEDEF",+ },+ defaults: {+ brand: "Synergy",+ scanColor: "#7D52F4",+ beforeColor: "#FB3748",+ afterColor: "#335CFF",+ background: "#EDEDEF",+ speed: 1,+ },+ card: {+ fit: false,+ },+ },"scan-reveal": {durationInFrames: 142,fps: 30,@@ -12978,6 +13079,25 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {speed: 1,},},+ "token-tags": {+ durationInFrames: 88,+ fps: 30,+ compositionWidth: 1280,+ compositionHeight: 720,+ previewBackdrop: {+ type: "color",+ value: "#EDEDEF",+ },+ defaults: {+ lineColor: "#0E121B",+ background: "#EDEDEF",+ stagger: 6,+ speed: 1,+ },+ card: {+ fit: false,+ },+ },"toolbar-unfurl": {durationInFrames: 150,fps: 30,diff --git a/registry/remocn/audit-boxes/config.ts b/registry/remocn/audit-boxes/config.tsnew file mode 100644index 00000000..5e1abf30--- /dev/null+++ b/registry/remocn/audit-boxes/config.ts@@ -0,0 +1,34 @@+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const auditBoxesConfig: ComponentConfig = {+ componentName: "AuditBoxes",+ importPath: "@/components/remocn/audit-boxes",+ controls: {+ color: { type: "color", default: "#FB3748", description: "Marks" },+ background: {+ type: "color",+ default: "#EDEDEF",+ description: "Background",+ },+ counterLabel: {+ type: "text-content",+ default: "issues",+ description: "Counter label",+ },+ stagger: {+ type: "number",+ min: 1,+ max: 12,+ step: 1,+ default: 4,+ description: "Stagger",+ hiddenFromList: false,+ },+ },+ durationInFrames: 83,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#EDEDEF" },+ card: { fit: false },+};diff --git a/registry/remocn/audit-boxes/index.tsx b/registry/remocn/audit-boxes/index.tsxnew file mode 100644index 00000000..1396d4bc--- /dev/null+++ b/registry/remocn/audit-boxes/index.tsx@@ -0,0 +1,132 @@+"use client";++import type { ReactNode } from "react";+import { AbsoluteFill } from "remotion";+import {+ AUDIT_COLORS,+ AuditClock,+ DEMO,+ DEMO_WINDOW,+ DemoDashboard,+ FONT,+ type Issue,+ IssueMarks,+ MONO,+ progress,+ useAuditFrame,+} from "@/lib/remocn/audit-core";++export type AuditBoxesProps = {+ /** UI to audit, laid out in a 1280x720 frame. Defaults to a demo calendar dashboard. */+ children?: ReactNode;+ /** Off-spec elements, in frame pixels, with the fix each one needs. */+ issues?: Issue[];+ color?: string;+ background?: string;+ /** Word after the running count. Empty hides the counter. */+ counterLabel?: string;+ /** Frames between one box and the next. */+ stagger?: number;+ speed?: number;+};++export const auditBoxesDefaults = {+ color: AUDIT_COLORS.audit,+ background: AUDIT_COLORS.stage,+ counterLabel: "issues",+ stagger: 4,+ speed: 1,+};++export const auditBoxesLength = 56;++const START = 10;++export function AuditBoxes(props: AuditBoxesProps) {+ const { speed = 1 } = props;+ return (+ <AuditClock speed={speed}>+ <Scene {...props} />+ </AuditClock>+ );+}++function Scene({+ children,+ issues = children ? [] : DEMO.before.issues,+ color = auditBoxesDefaults.color,+ background = auditBoxesDefaults.background,+ counterLabel = auditBoxesDefaults.counterLabel,+ stagger = auditBoxesDefaults.stagger,+}: AuditBoxesProps) {+ return (+ <AbsoluteFill style={{ background, fontFamily: FONT }}>+ {children ?? <DemoDashboard v={1} />}+ <IssueMarks+ issues={issues}+ color={color}+ start={START}+ stagger={stagger}+ />+ {counterLabel && (+ <Counter+ total={issues.length}+ stagger={stagger}+ color={color}+ label={counterLabel}+ />+ )}+ </AbsoluteFill>+ );+}++/** Count chip above the frame's top right that ticks up with every box. */+function Counter({+ total,+ stagger,+ color,+ label,+}: {+ total: number;+ stagger: number;+ color: string;+ label: string;+}) {+ const frame = useAuditFrame();+ const count = Math.min(+ total,+ Math.max(0, Math.floor((frame - START) / stagger) + 1),+ );+ const show = progress(frame, START - 6, 10);+ return (+ <div+ style={{+ position: "absolute",+ right: 1280 - DEMO_WINDOW.x - DEMO_WINDOW.w,+ top: 24,+ opacity: show,+ transform: `translateY(${(1 - show) * -6}px)`,+ display: "flex",+ alignItems: "center",+ gap: 8,+ fontFamily: MONO,+ fontSize: 12,+ color: AUDIT_COLORS.ink,+ }}+ >+ <span+ style={{+ background: color,+ color: "#fff",+ borderRadius: 4,+ padding: "2px 7px",+ fontWeight: 600,+ fontVariantNumeric: "tabular-nums",+ }}+ >+ {count}+ </span>+ {label}+ </div>+ );+}diff --git a/registry/remocn/audit-core/index.tsx b/registry/remocn/audit-core/index.tsxnew file mode 100644index 00000000..63d14b65--- /dev/null+++ b/registry/remocn/audit-core/index.tsx@@ -0,0 +1,1749 @@+"use client";++import {+ type CSSProperties,+ createContext,+ type ReactNode,+ useContext,+} from "react";+import { Easing, interpolate, useCurrentFrame } from "remotion";++/**+ * Shared kit behind the design-review family (redline-measure, audit-boxes,+ * scan-fix, token-tags, layout-guides, design-audit): the annotation marks a+ * design review paints over a UI, the scan band that sweeps a fix across it,+ * and a demo calendar dashboard the marks are measured against by default.+ *+ * Every coordinate is in composition pixels of a 1280x720 frame.+ */++const AuditSpeed = createContext(1);++/** Scales the clock every mark below it reads. */+export function AuditClock({+ speed,+ children,+}: {+ speed: number;+ children: ReactNode;+}) {+ return <AuditSpeed.Provider value={speed}>{children}</AuditSpeed.Provider>;+}++export function useAuditFrame() {+ return useCurrentFrame() * useContext(AuditSpeed);+}++/* Demo dashboard */+/**+ * A calendar dashboard drawn from one layout function, so every annotation+ * can measure the exact rects the UI paints. Version 1 is the "before"+ * build with drifted spacing and radii, version 2 is the fixed one.+ */++export type Rect = { x: number; y: number; w: number; h: number };+export type Version = 1 | 2;++export const FONT =+ "Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif";+export const MONO = "ui-monospace, 'SF Mono', Menlo, Consolas, monospace";++const C = {+ stage: "#EDEDEF",+ window: "#FFFFFF",+ ink: "#0E121B",+ sub: "#525866",+ soft: "#99A0AE",+ stroke: "#E1E4EA",+ weak: "#F5F7FA",+ primary: "#7D52F4",+ success: "#1FC16B",+ successBg: "#E0FAEC",+ warning: "#FA7319",+ warningBg: "#FFF1EB",+ error: "#FB3748",+ errorBg: "#FFEBEC",+ blue: "#335CFF",+ blueBg: "#EBF1FF",+ orangeBg: "#FFF3EB",+ purpleBg: "#EFEBFF",+};++export const WIN: Rect = { x: 80, y: 64, w: 1120, h: 616 };+const SIDE_W = 216;+const HEADER_H = 56;+const MAIN_X = WIN.x + SIDE_W;+const MAIN_R = WIN.x + WIN.w;++const CARDS = [+ {+ title: "Weekly team meeting",+ time: "3:00 – 4:30 PM",+ status: "Today",+ action: "Join meeting",+ dot: C.success,+ bg: C.successBg,+ },+ {+ title: "Product launch event",+ time: "11:00 AM – 12:30 PM",+ status: "2 conflicts",+ action: "Review",+ dot: C.warning,+ bg: C.warningBg,+ },+ {+ title: "Team building workshop",+ time: "10:00 AM – 1:00 PM",+ status: "Canceled",+ action: "Fri, Nov 6",+ dot: C.error,+ bg: C.errorBg,+ },+ {+ title: "Marketing campaign",+ time: "2:30 – 4:00 PM",+ status: "In 3 days",+ action: "Thu, Nov 5",+ dot: C.soft,+ bg: C.weak,+ },+];++const TABS = [+ { label: "All scheduled", count: "15" },+ { label: "Meetings", count: "12" },+ { label: "Events", count: "3" },+ { label: "Conflicted", count: "2" },+ { label: "Canceled", count: "1" },+];++const DAYS = ["Mon 2", "Tue 3", "Wed 4", "Thu 5", "Fri 6"];+const HOURS = ["9 AM", "10 AM", "11 AM", "12 PM", "1 PM"];++const EVENTS = [+ { day: 0, from: 0, to: 0.5, title: "Brainstorming session", tone: "gray" },+ { day: 0, from: 0.55, to: 1.05, title: "Bi-weekly sync", tone: "gray" },+ { day: 1, from: 0, to: 0.45, title: "Project review", tone: "blue" },+ { day: 1, from: 1.05, to: 2.6, title: "Sales team training", tone: "blue" },+ { day: 2, from: 0.5, to: 1.0, title: "Marketing strategy", tone: "blue" },+ { day: 2, from: 2.6, to: 3.6, title: "Interview: frontend", tone: "purple" },+ { day: 3, from: 0, to: 1.0, title: "Customer feedback", tone: "blue" },+ { day: 3, from: 2.2, to: 3.4, title: "Product launch", tone: "orange" },+ { day: 0, from: 2.5, to: 3.7, title: "Workshop: design", tone: "orange" },+ { day: 4, from: 1.1, to: 3.7, title: "Team building", tone: "gray" },+] as const;++const TONES = {+ gray: { bg: C.weak, ink: C.sub },+ blue: { bg: C.blueBg, ink: "#2547D0" },+ purple: { bg: C.purpleBg, ink: "#5B3CC4" },+ orange: { bg: C.orangeBg, ink: "#C2540A" },+};++/** Every rect the dashboard paints, in composition pixels. */+export function demoLayout(v: Version) {+ const pad = v === 2 ? 24 : 20;+ const gap = v === 2 ? 16 : 10;+ const cardPad = v === 2 ? 16 : 12;+ const radius = v === 2 ? 12 : 6;+ const contentX = MAIN_X + pad;+ const contentW = MAIN_R - pad - contentX;++ const header: Rect = { x: MAIN_X, y: WIN.y, w: MAIN_R - MAIN_X, h: HEADER_H };+ const button: Rect = {+ x: MAIN_R - pad - 128,+ y: WIN.y + 12,+ w: 128,+ h: v === 2 ? 32 : 34,+ };+ const tabsY = WIN.y + HEADER_H + (v === 2 ? 16 : 12);+ let tabX = contentX;+ const tabs = TABS.map((tab, i) => {+ const w = 46 + tab.label.length * 7.4 + (i === 0 ? 26 : 0);+ const rect: Rect = { x: tabX, y: tabsY, w, h: 32 };+ tabX += w + 14;+ return rect;+ });++ const cardsY = tabsY + 32 + (v === 2 ? 16 : 12);+ const cardW = (contentW - gap * 3) / 4;+ const cards = CARDS.map((_, i) => {+ const rect: Rect = {+ x: contentX + i * (cardW + gap),+ y: cardsY,+ w: cardW,+ h: 92,+ };+ return {+ rect,+ title: { x: rect.x + cardPad, y: rect.y + cardPad, w: 150, h: 18 },+ time: { x: rect.x + cardPad, y: rect.y + cardPad + 21, w: 110, h: 15 },+ status: {+ x: rect.x + cardPad - 4,+ y: rect.y + rect.h - cardPad - 24,+ w: rect.w - cardPad * 2 + 8,+ h: 26,+ },+ chevron: {+ x: rect.x + rect.w - cardPad - 20,+ y: rect.y + cardPad - 2,+ w: 20,+ h: 20,+ },+ };+ });++ const calY = cardsY + 92 + 22;+ const calendar: Rect = {+ x: contentX,+ y: calY,+ w: contentW,+ h: WIN.y + WIN.h - calY - 16,+ };+ const gutter = 56;+ const colW = (contentW - gutter) / DAYS.length;+ const dayHeaderH = 30;+ const hourH = (calendar.h - dayHeaderH) / 4;+ const columns = DAYS.map(+ (_, i): Rect => ({+ x: contentX + gutter + i * colW,+ y: calY,+ w: colW,+ h: calendar.h,+ }),+ );+ const events = EVENTS.map((event) => ({+ ...event,+ rect: {+ x: columns[event.day].x + 4,+ y: calY + dayHeaderH + event.from * hourH + 3,+ w: colW - 8,+ h: (event.to - event.from) * hourH - 6,+ } satisfies Rect,+ }));++ return {+ v,+ pad,+ gap,+ cardPad,+ radius,+ contentX,+ header,+ button,+ tabs,+ cards,+ calendar,+ columns,+ gutter,+ dayHeaderH,+ hourH,+ events,+ sidebar: { x: WIN.x, y: WIN.y, w: SIDE_W, h: WIN.h } satisfies Rect,+ sideActive: { x: WIN.x + 10, y: WIN.y + 158, w: SIDE_W - 20, h: 30 },+ };+}++export type DemoLayout = ReturnType<typeof demoLayout>;++const abs = (r: Rect): CSSProperties => ({+ position: "absolute",+ left: r.x,+ top: r.y,+ width: r.w,+ height: r.h,+});++function Glyph({+ size = 14,+ color = C.soft,+}: {+ size?: number;+ color?: string;+}) {+ return (+ <div+ style={{+ width: size,+ height: size,+ borderRadius: 4,+ border: `1.5px solid ${color}`,+ flexShrink: 0,+ }}+ />+ );+}++const SIDE_ITEMS: (string | { section: string })[] = [+ "Inbox",+ "Dashboard",+ { section: "Workspace" },+ "Calendar",+ "Time off",+ "People",+ "Payroll",+ "Projects",+ "Documents",+ { section: "Favorites" },+ "Loom Mobile App",+ "Monday Re-design",+ "Udemy Courses",+];++function Sidebar({ l }: { l: DemoLayout }) {+ let y = WIN.y + 68;+ return (+ <>+ <div+ style={{+ ...abs({ x: WIN.x, y: WIN.y, w: SIDE_W, h: WIN.h }),+ borderRight: `1px solid ${C.stroke}`,+ }}+ />+ <div+ style={{+ position: "absolute",+ left: WIN.x + 18,+ top: WIN.y + 18,+ display: "flex",+ alignItems: "center",+ gap: 10,+ fontSize: 14,+ fontWeight: 600,+ color: C.ink,+ }}+ >+ <div+ style={{+ width: 22,+ height: 22,+ borderRadius: 11,+ background: C.primary,+ }}+ />+ Synergy+ </div>+ {SIDE_ITEMS.map((item) => {+ const top = y;+ if (typeof item !== "string") {+ y += 30;+ return (+ <div+ key={item.section}+ style={{+ position: "absolute",+ left: WIN.x + 20,+ top: top + 10,+ fontSize: 11,+ letterSpacing: "0.04em",+ textTransform: "uppercase",+ color: C.soft,+ }}+ >+ {item.section}+ </div>+ );+ }+ y += 30;+ const active = item === "Calendar";+ return (+ <div+ key={item}+ style={{+ ...abs(+ active+ ? l.sideActive+ : { x: WIN.x + 10, y: top, w: SIDE_W - 20, h: 30 },+ ),+ display: "flex",+ alignItems: "center",+ gap: 10,+ paddingLeft: 10,+ borderRadius: l.v === 2 ? 8 : 5,+ background: active ? C.weak : undefined,+ fontSize: 13,+ fontWeight: active ? 500 : 400,+ color: active ? C.ink : C.sub,+ }}+ >+ <Glyph color={active ? C.primary : C.soft} />+ {item}+ </div>+ );+ })}+ <div+ style={{+ position: "absolute",+ left: WIN.x + 18,+ top: WIN.y + WIN.h - 44,+ display: "flex",+ alignItems: "center",+ gap: 10,+ fontSize: 13,+ color: C.ink,+ }}+ >+ <div+ style={{+ width: 26,+ height: 26,+ borderRadius: 13,+ background: "linear-gradient(135deg,#FBC5A6,#F17B6A)",+ }}+ />+ Olivia Hart+ </div>+ </>+ );+}++function Header({ l }: { l: DemoLayout }) {+ return (+ <>+ <div+ style={{+ ...abs(l.header),+ borderBottom: `1px solid ${C.stroke}`,+ display: "flex",+ alignItems: "center",+ gap: 12,+ paddingLeft: l.pad,+ fontSize: 14,+ }}+ >+ <Glyph size={16} color={C.sub} />+ <span style={{ fontWeight: 600, color: C.ink }}>+ Monday, November 2+ </span>+ <span style={{ color: C.soft }}>+ You have 3 meetings and 1 event today.+ </span>+ </div>+ <div+ style={{+ ...abs({ x: l.button.x - 104, y: l.button.y, w: 92, h: l.button.h }),+ display: "flex",+ alignItems: "center",+ justifyContent: "center",+ gap: 6,+ borderRadius: l.v === 2 ? 8 : 6,+ border: `1px solid ${C.stroke}`,+ fontSize: 13,+ color: C.sub,+ }}+ >+ Schedule+ </div>+ <div+ style={{+ ...abs(l.button),+ display: "flex",+ alignItems: "center",+ justifyContent: "center",+ borderRadius: l.v === 2 ? 8 : 6,+ background: l.v === 2 ? C.primary : "#8B5CF6",+ color: "#fff",+ fontSize: 13,+ fontWeight: 500,+ }}+ >+ + Create event+ </div>+ </>+ );+}++function Tabs({ l }: { l: DemoLayout }) {+ return (+ <>+ {TABS.map((tab, i) => (+ <div+ key={tab.label}+ style={{+ ...abs(l.tabs[i]),+ display: "flex",+ alignItems: "center",+ gap: 7,+ fontSize: 13,+ fontWeight: i === 0 ? 500 : 400,+ color: i === 0 ? C.ink : C.sub,+ borderBottom: i === 0 ? `2px solid ${C.primary}` : undefined,+ }}+ >+ <Glyph color={i === 0 ? C.primary : C.soft} />+ {tab.label}+ <span+ style={{+ fontSize: 11,+ fontWeight: 500,+ color: i === 0 ? "#fff" : C.soft,+ background:+ i === 0 ? (l.v === 2 ? C.primary : "#8B5CF6") : undefined,+ borderRadius: 8,+ padding: i === 0 ? "1px 6px" : 0,+ }}+ >+ {tab.count}+ </span>+ </div>+ ))}+ <div+ style={{+ position: "absolute",+ left: l.contentX,+ top: l.tabs[0].y + 32,+ width: WIN.x + WIN.w - l.pad - l.contentX,+ height: 1,+ background: C.stroke,+ }}+ />+ </>+ );+}++function Cards({ l }: { l: DemoLayout }) {+ return (+ <>+ {CARDS.map((card, i) => {+ const r = l.cards[i];+ return (+ <div key={card.title}>+ <div+ style={{+ ...abs(r.rect),+ borderRadius: l.radius,+ border: `1px solid ${C.stroke}`,+ background: "#fff",+ boxShadow: "0 1px 2px rgba(10,13,20,0.04)",+ }}+ />+ <div+ style={{+ ...abs(r.title),+ width: r.rect.w - l.cardPad * 2 - 24,+ fontSize: l.v === 2 ? 14 : 13.5,+ fontWeight: 600,+ color: C.ink,+ whiteSpace: "nowrap",+ overflow: "hidden",+ textOverflow: "ellipsis",+ }}+ >+ {card.title}+ </div>+ <div+ style={{ ...abs(r.time), width: 160, fontSize: 12, color: C.sub }}+ >+ {card.time}+ </div>+ <div+ style={{+ ...abs(r.chevron),+ display: "flex",+ alignItems: "center",+ justifyContent: "center",+ color: C.soft,+ fontSize: 11,+ }}+ >+ ⌄+ </div>+ <div+ style={{+ ...abs(r.status),+ display: "flex",+ alignItems: "center",+ justifyContent: "space-between",+ padding: "0 8px",+ borderRadius: l.v === 2 ? 6 : 4,+ background: card.bg,+ fontSize: 12,+ }}+ >+ <span+ style={{+ display: "flex",+ alignItems: "center",+ gap: 6,+ color: C.ink,+ }}+ >+ <span+ style={{+ width: 8,+ height: 8,+ borderRadius: 4,+ background: card.dot,+ }}+ />+ {card.status}+ </span>+ <span+ style={{+ color: C.sub,+ textDecoration: i === 0 ? "underline" : undefined,+ }}+ >+ {card.action}+ </span>+ </div>+ </div>+ );+ })}+ </>+ );+}++function Calendar({ l }: { l: DemoLayout }) {+ const { calendar: cal, columns, dayHeaderH, hourH } = l;+ return (+ <>+ {DAYS.map((day, i) => (+ <div+ key={day}+ style={{+ ...abs({+ x: columns[i].x,+ y: cal.y,+ w: columns[i].w,+ h: dayHeaderH,+ }),+ display: "flex",+ alignItems: "center",+ justifyContent: "center",+ fontSize: 12,+ fontWeight: i === 0 ? 600 : 400,+ color: i === 0 ? C.ink : C.soft,+ borderLeft: `1px solid ${C.stroke}`,+ borderBottom: `1px solid ${C.stroke}`,+ }}+ >+ {day}+ </div>+ ))}+ {HOURS.slice(0, 4).map((hour, i) => (+ <div+ key={hour}+ style={{+ position: "absolute",+ left: cal.x,+ top: cal.y + dayHeaderH + i * hourH - 2,+ width: l.gutter - 10,+ textAlign: "right",+ fontSize: 11,+ color: C.soft,+ }}+ >+ {hour}+ </div>+ ))}+ {columns.map((col) => (+ <div+ key={col.x}+ style={{+ position: "absolute",+ left: col.x,+ top: cal.y + dayHeaderH,+ width: 1,+ height: cal.h - dayHeaderH,+ background: C.stroke,+ }}+ />+ ))}+ {l.events.map((event) => {+ const tone = TONES[event.tone];+ return (+ <div+ key={`${event.day}-${event.from}`}+ style={{+ ...abs(event.rect),+ borderRadius: l.v === 2 ? 8 : 4,+ background: tone.bg,+ padding: "6px 8px",+ fontSize: 11.5,+ fontWeight: 500,+ color: tone.ink,+ overflow: "hidden",+ whiteSpace: "nowrap",+ textOverflow: "ellipsis",+ }}+ >+ {event.title}+ </div>+ );+ })}+ </>+ );+}++/** The whole dashboard window, positioned in a 1280x720 frame. */+export function DemoDashboard({ v }: { v: Version }) {+ const l = demoLayout(v);+ return (+ <div style={{ position: "absolute", inset: 0, fontFamily: FONT }}>+ <div+ style={{+ ...abs(WIN),+ background: C.window,+ borderRadius: 16,+ boxShadow:+ "0 0 0 1px rgba(10,13,20,0.04), 0 16px 40px -12px rgba(10,13,20,0.12)",+ }}+ />+ <div+ style={{+ ...abs(WIN),+ borderRadius: 16,+ overflow: "hidden",+ }}+ >+ <div+ style={{+ position: "absolute",+ left: -WIN.x,+ top: -WIN.y,+ width: 1280,+ height: 720,+ }}+ >+ <Sidebar l={l} />+ <Header l={l} />+ <Tabs l={l} />+ <Cards l={l} />+ <Calendar l={l} />+ </div>+ </div>+ </div>+ );+}++/* Marks */++/**+ * Annotation primitives: the redline marks a design review paints over a UI.+ * Each takes a `delay` in frames and draws itself in from there.+ */++const clamp = {+ extrapolateLeft: "clamp" as const,+ extrapolateRight: "clamp" as const,+};++export function progress(frame: number, start: number, duration: number) {+ return interpolate(frame, [start, start + duration], [0, 1], {+ ...clamp,+ easing: Easing.out(Easing.cubic),+ });+}++/** Pop-in for labels and chips: a cubic ease-out, no overshoot. */+function usePop(delay: number) {+ return progress(useAuditFrame(), delay, 12);+}++function Layer({ children }: { children: ReactNode }) {+ return (+ <svg+ width={1280}+ height={720}+ viewBox="0 0 1280 720"+ style={{ position: "absolute", inset: 0, overflow: "visible" }}+ >+ {children}+ </svg>+ );+}++export type Side =+ | "center"+ | "above"+ | "below"+ | "left"+ | "right"+ | "aboveStart"+ | "aboveEnd"+ | "belowStart";++/** Small spec label: mono text on a solid color chip. */+export function Pill({+ x,+ y,+ text,+ color,+ delay = 0,+ anchor = "center",+ ink = "#fff",+}: {+ x: number;+ y: number;+ text: string;+ color: string;+ delay?: number;+ anchor?: Side;+ ink?: string;+}) {+ const pop = usePop(delay);+ const shift = {+ center: "translate(-50%, -50%)",+ above: "translate(-50%, calc(-100% - 5px))",+ below: "translate(-50%, 5px)",+ left: "translate(calc(-100% - 6px), -50%)",+ right: "translate(6px, -50%)",+ aboveStart: "translate(0, calc(-100% - 5px))",+ aboveEnd: "translate(-100%, calc(-100% - 5px))",+ belowStart: "translate(0, 5px)",+ }[anchor];+ return (+ <div+ style={{+ position: "absolute",+ left: x,+ top: y,+ transform: `${shift} scale(${0.7 + 0.3 * pop})`,+ opacity: Math.min(1, pop * 1.4),+ background: color,+ color: ink,+ fontFamily: MONO,+ fontSize: 10.5,+ fontWeight: 600,+ lineHeight: "15px",+ padding: "0 5px",+ borderRadius: 3,+ whiteSpace: "nowrap",+ }}+ >+ {text}+ </div>+ );+}++/**+ * Measurement between two points on one axis: end ticks snap in, the line+ * grows out from its middle, then the value pops on.+ */+export function Ruler({+ from,+ to,+ label,+ color,+ delay = 0,+ labelSide,+}: {+ from: [number, number];+ to: [number, number];+ label: string;+ color: string;+ delay?: number;+ labelSide?: Side;+}) {+ const frame = useAuditFrame();+ const grow = progress(frame, delay, 12);+ const ticks = progress(frame, delay - 2, 6);+ const horizontal = Math.abs(to[0] - from[0]) >= Math.abs(to[1] - from[1]);+ const mx = (from[0] + to[0]) / 2;+ const my = (from[1] + to[1]) / 2;+ const x1 = mx + (from[0] - mx) * grow;+ const y1 = my + (from[1] - my) * grow;+ const x2 = mx + (to[0] - mx) * grow;+ const y2 = my + (to[1] - my) * grow;+ const t = 4 * ticks;+ const tick = (x: number, y: number) =>+ horizontal ? `M${x} ${y - t}V${y + t}` : `M${x - t} ${y}H${x + t}`;+ return (+ <>+ <Layer>+ <path+ d={`${tick(...from)}${tick(...to)}`}+ stroke={color}+ strokeWidth={1.25}+ fill="none"+ />+ <line+ x1={x1}+ y1={y1}+ x2={x2}+ y2={y2}+ stroke={color}+ strokeWidth={1.25}+ />+ </Layer>+ <Pill+ x={mx}+ y={my}+ text={label}+ color={color}+ delay={delay + 7}+ anchor={labelSide ?? (horizontal ? "above" : "left")}+ />+ </>+ );+}++/** Hairline box traced around an element, clockwise from the top left. */+export function OutlineBox({+ rect,+ color,+ delay = 0,+ radius = 3,+ inset = -3,+ dashed,+ fill,+}: {+ rect: Rect;+ color: string;+ delay?: number;+ radius?: number;+ inset?: number;+ dashed?: boolean;+ fill?: string;+}) {+ const frame = useAuditFrame();+ const draw = progress(frame, delay, 14);+ const x = rect.x + inset;+ const y = rect.y + inset;+ const w = rect.w - inset * 2;+ const h = rect.h - inset * 2;+ return (+ <Layer>+ <rect+ x={x}+ y={y}+ width={w}+ height={h}+ rx={radius}+ fill={fill ?? "none"}+ fillOpacity={draw}+ stroke={color}+ strokeWidth={1.25}+ pathLength={1}+ strokeDasharray={dashed ? undefined : `${draw} 1`}+ strokeOpacity={dashed ? draw : 1}+ style={dashed ? { strokeDasharray: "3 3" } : undefined}+ />+ </Layer>+ );+}++/** Quarter arc swept into a corner to call out its radius. */+export function CornerArc({+ x,+ y,+ r,+ color,+ label,+ delay = 0,+}: {+ x: number;+ y: number;+ r: number;+ color: string;+ label: string;+ delay?: number;+}) {+ const frame = useAuditFrame();+ const draw = progress(frame, delay, 12);+ const size = Math.max(r, 10) + 4;+ return (+ <>+ <Layer>+ <path+ d={`M${x} ${y + size}A${size} ${size} 0 0 1 ${x + size} ${y}`}+ stroke={color}+ strokeWidth={1.5}+ fill="none"+ pathLength={1}+ strokeDasharray={`${draw} 1`}+ strokeLinecap="round"+ />+ </Layer>+ <Pill+ x={x - 2}+ y={y - 2}+ text={label}+ color={color}+ delay={delay + 8}+ anchor="aboveStart"+ />+ </>+ );+}++/**+ * Design-token tag: a dot lands on the element, a leader line runs out with+ * one elbow, and a dark chip with the token name settles at its end.+ */+export function TokenTag({+ anchor,+ at,+ label,+ swatch,+ delay = 0,+ lineColor = "#0E121B",+}: {+ anchor: [number, number];+ at: [number, number];+ label: string;+ swatch: string;+ delay?: number;+ lineColor?: string;+}) {+ const frame = useAuditFrame();+ const dot = usePop(delay);+ const draw = progress(frame, delay + 3, 14);+ const elbowY = at[1];+ const path = `M${anchor[0]} ${anchor[1]}L${anchor[0] + (at[0] - anchor[0]) * 0.35} ${elbowY}H${at[0]}`;+ return (+ <>+ <Layer>+ <path+ d={path}+ stroke={lineColor}+ strokeOpacity={0.55}+ strokeWidth={1}+ fill="none"+ pathLength={1}+ strokeDasharray={`${draw} 1`}+ />+ <circle+ cx={anchor[0]}+ cy={anchor[1]}+ r={3.5 * dot}+ fill="#fff"+ stroke={lineColor}+ strokeWidth={1.5}+ />+ </Layer>+ <TokenChip+ x={at[0]}+ y={at[1]}+ label={label}+ swatch={swatch}+ delay={delay + 13}+ />+ </>+ );+}++export function TokenChip({+ x,+ y,+ label,+ swatch,+ delay = 0,+}: {+ x: number;+ y: number;+ label: string;+ swatch: string;+ delay?: number;+}) {+ const pop = usePop(delay);+ return (+ <div+ style={{+ position: "absolute",+ left: x,+ top: y,+ transform: `translate(-50%, -50%) translateY(${(1 - pop) * 6}px)`,+ opacity: Math.min(1, pop * 1.4),+ display: "flex",+ alignItems: "center",+ gap: 6,+ background: "#0E121B",+ color: "#fff",+ fontFamily: MONO,+ fontSize: 11,+ lineHeight: "22px",+ padding: "0 8px",+ borderRadius: 5,+ whiteSpace: "nowrap",+ boxShadow: "0 4px 10px -4px rgba(10,13,20,0.4)",+ }}+ >+ <span+ style={{+ width: 8,+ height: 8,+ borderRadius: 4,+ background: swatch,+ boxShadow: "0 0 0 1px rgba(255,255,255,0.35)",+ }}+ />+ {label}+ </div>+ );+}++/** Guide line that drops down (vertical) or slides across (horizontal). */+export function Guide({+ x,+ y,+ length,+ vertical,+ color,+ delay = 0,+ dashed,+ width = 1,+}: {+ x: number;+ y: number;+ length: number;+ vertical?: boolean;+ color: string;+ delay?: number;+ dashed?: boolean;+ width?: number;+}) {+ const frame = useAuditFrame();+ const draw = progress(frame, delay, 16) * length;+ return (+ <Layer>+ <line+ x1={x}+ y1={y}+ x2={vertical ? x : x + draw}+ y2={vertical ? y + draw : y}+ stroke={color}+ strokeWidth={width}+ strokeDasharray={dashed ? "4 4" : undefined}+ />+ </Layer>+ );+}++/**+ * Scan band: a crisp line with a soft wash trailing behind it, the way the+ * fix pass sweeps the screen. `y` is the line's position.+ */+export function ScanBand({+ y,+ color,+ x = 0,+ w = 1280,+ trail = 90,+ opacity = 1,+}: {+ y: number;+ color: string;+ x?: number;+ w?: number;+ trail?: number;+ opacity?: number;+}) {+ return (+ <div+ style={{ position: "absolute", inset: 0, opacity, pointerEvents: "none" }}+ >+ <div+ style={{+ position: "absolute",+ left: x,+ width: w,+ top: y - trail,+ height: trail,+ background: `linear-gradient(to bottom, transparent, ${color}2E)`,+ }}+ />+ <div+ style={{+ position: "absolute",+ left: x,+ width: w,+ top: y - 1,+ height: 2,+ background: color,+ boxShadow: `0 0 12px 1px ${color}`,+ }}+ />+ </div>+ );+}++/** Stage-colored wash over everything except one rect, to push focus. */+export function Spotlight({+ rect,+ opacity,+ color = C.stage,+}: {+ rect: Rect;+ opacity: number;+ color?: string;+}) {+ const pad = 10;+ const x = rect.x - pad;+ const y = rect.y - pad;+ const w = rect.w + pad * 2;+ const h = rect.h + pad * 2;+ const r = 12;+ return (+ <svg+ width={1280}+ height={720}+ style={{ position: "absolute", inset: 0, opacity }}+ >+ <path+ fillRule="evenodd"+ fill={color}+ fillOpacity={0.72}+ d={`M0 0H1280V720H0Z M${x + r} ${y}H${x + w - r}Q${x + w} ${y} ${x + w} ${y + r}V${y + h - r}Q${x + w} ${y + h} ${x + w - r} ${y + h}H${x + r}Q${x} ${y + h} ${x} ${y + h - r}V${y + r}Q${x} ${y} ${x + r} ${y}Z`}+ />+ </svg>+ );+}++/** Two full frames split at `y`: `top` shows above the line, `bottom` below. */+export function SplitAt({+ y,+ top,+ bottom,+}: {+ y: number;+ top: ReactNode;+ bottom: ReactNode;+}) {+ return (+ <>+ <div+ style={{+ position: "absolute",+ inset: 0,+ clipPath: `inset(${Math.max(0, y)}px 0 0 0)`,+ }}+ >+ {bottom}+ </div>+ <div+ style={{+ position: "absolute",+ inset: 0,+ clipPath: `inset(0 0 ${Math.max(0, 720 - y)}px 0)`,+ }}+ >+ {top}+ </div>+ </>+ );+}++/** Cubic ease-in-out between keyframes, clamped at both ends. */+export function easeInOut(frame: number, input: number[], output: number[]) {+ return interpolate(frame, input, output, {+ ...clamp,+ easing: Easing.inOut(Easing.cubic),+ });+}++/* Mark data */++export type Point = [number, number];++/** A distance between two points on one axis, with its value. */+export type Measure = { from: Point; to: Point; label: string; side?: Side };+/** A corner whose radius gets an arc and a label. `x`, `y` is the corner. */+export type RadiusMark = { x: number; y: number; r: number; label: string };+/** An off-spec element and the fix it needs. */+export type Issue = {+ rect: Rect;+ note: string;+ side?: "start" | "end" | "below";+};+/** A token tag: dot on `anchor`, chip centered on `at`. */+export type TokenSpec = {+ anchor: Point;+ at: Point;+ label: string;+ swatch: string;+};+/** Layout guides over a column grid. */+export type GuideSpec = {+ /** x of every column edge, left to right. */+ columns: number[];+ top: number;+ bottom: number;+ /** One column (or any rect) to fill and label. */+ highlight?: { rect: Rect; label: string };+ /** A measurement drawn with the guides, like a gutter width. */+ ruler?: Measure;+ /** A horizontal marker line across the grid, like a calendar's now line. */+ now?: { y: number; from: number; to: number; label: string };+};++export const AUDIT_COLORS = {+ audit: C.error,+ fix: C.blue,+ scan: C.primary,+ ink: C.ink,+ stage: C.stage,+};++/** Spacing and size redlines across the demo header, tabs and first cards. */+function demoMeasures(l: DemoLayout): Measure[] {+ const card = l.cards[0];+ const next = l.cards[1];+ const tabsBottom = l.tabs[0].y + 32;+ const headerBottom = l.header.y + l.header.h;+ const tabGapX = l.tabs[1].x + l.tabs[1].w + 7;+ const right = l.button.x + l.button.w + 8;+ return [+ {+ from: [l.header.x, l.tabs[0].y + 16],+ to: [l.contentX, l.tabs[0].y + 16],+ label: `pad ${l.pad}`,+ side: "below",+ },+ {+ from: [tabGapX, headerBottom],+ to: [tabGapX, l.tabs[0].y],+ label: `${l.tabs[0].y - headerBottom}`,+ side: "right",+ },+ {+ from: [next.rect.x + 150, tabsBottom],+ to: [next.rect.x + 150, next.rect.y],+ label: `${next.rect.y - tabsBottom}`,+ side: "right",+ },+ {+ from: [card.rect.x + card.rect.w, card.rect.y + 46],+ to: [next.rect.x, card.rect.y + 46],+ label: `gap ${l.gap}`,+ },+ {+ from: [card.rect.x, card.title.y + 9],+ to: [card.title.x, card.title.y + 9],+ label: `${l.cardPad}`,+ side: "left",+ },+ {+ from: [card.title.x + 96, card.rect.y],+ to: [card.title.x + 96, card.title.y],+ label: `${l.cardPad}`,+ side: "right",+ },+ {+ from: [right, l.button.y],+ to: [right, l.button.y + l.button.h],+ label: `h ${l.button.h}`,+ side: "below",+ },+ ];+}++function demoRadii(l: DemoLayout): RadiusMark[] {+ const next = l.cards[1].rect;+ return [{ x: next.x, y: next.y, r: l.radius, label: `radius ${l.radius}` }];+}++function demoIssues(l: DemoLayout): Issue[] {+ return [+ { rect: l.cards[0].title, note: "13.5 → 14", side: "start" },+ { rect: l.cards[0].status, note: "radius 4 → 6", side: "below" },+ { rect: l.cards[0].chevron, note: "hit 20 → 24", side: "end" },+ { rect: l.button, note: "#8B5CF6 ≠ primary", side: "end" },+ { rect: l.sideActive, note: "radius 5 → 8", side: "start" },+ { rect: l.events[2].rect, note: "radius 4 → 8", side: "start" },+ { rect: l.events[6].rect, note: "pad 6 → 8", side: "start" },+ ];+}++function demoTokens(l: DemoLayout): TokenSpec[] {+ const [c0, c1, c2, c3] = l.cards;+ const chipY = l.calendar.y + 70;+ return [+ {+ anchor: [c0.status.x + 12, c0.status.y + 13],+ at: [c0.rect.x + 50, chipY + 50],+ label: "state/success/lighter",+ swatch: C.successBg,+ },+ {+ anchor: [c0.title.x + 40, c0.title.y + 9],+ at: [c0.rect.x + 170, chipY],+ label: "text/strong-950",+ swatch: C.ink,+ },+ {+ anchor: [c1.status.x + 12, c1.status.y + 13],+ at: [c1.rect.x + 110, chipY + 92],+ label: "state/warning/base",+ swatch: C.warning,+ },+ {+ anchor: [c2.status.x + 12, c2.status.y + 13],+ at: [c2.rect.x + 90, chipY + 20],+ label: "state/error/base",+ swatch: C.error,+ },+ {+ anchor: [c3.rect.x + c3.rect.w, c3.rect.y + 40],+ at: [c3.rect.x + 90, chipY + 70],+ label: "stroke/soft-200",+ swatch: C.stroke,+ },+ ];+}++function demoGuides(l: DemoLayout): GuideSpec {+ const cal = l.calendar;+ const today = l.columns[0];+ return {+ columns: [...l.columns.map((col) => col.x), cal.x + cal.w],+ top: cal.y,+ bottom: cal.y + cal.h,+ highlight: { rect: today, label: "Mon 2 · today" },+ ruler: {+ from: [cal.x, cal.y + l.dayHeaderH + 14],+ to: [cal.x + l.gutter, cal.y + l.dayHeaderH + 14],+ label: `w ${l.gutter}`,+ side: "below",+ },+ now: {+ y: cal.y + l.dayHeaderH + 1.25 * l.hourH,+ from: cal.x + l.gutter,+ to: cal.x + cal.w,+ label: "10:15 AM",+ },+ };+}++/** Close-up spec of the first card, sized for a zoomed camera. */+function demoFocus(l: DemoLayout) {+ const card = l.cards[0];+ const r = card.rect;+ const below = r.y + r.h + 34;+ return {+ rect: r,+ measures: [+ {+ from: [r.x, card.title.y + 9],+ to: [card.title.x, card.title.y + 9],+ label: `${l.cardPad}`,+ side: "below",+ },+ {+ from: [card.title.x + 110, r.y],+ to: [card.title.x + 110, card.title.y],+ label: `${l.cardPad}`,+ side: "right",+ },+ {+ from: [r.x + r.w + 8, card.status.y],+ to: [r.x + r.w + 8, card.status.y + card.status.h],+ label: `h ${card.status.h}`,+ side: "right",+ },+ {+ from: [card.chevron.x - 2, card.chevron.y - 6],+ to: [card.chevron.x + card.chevron.w + 2, card.chevron.y - 6],+ label: "24",+ },+ ] as Measure[],+ radii: [{ x: r.x, y: r.y, r: l.radius, label: `radius ${l.radius}` }],+ tokens: [+ {+ anchor: [card.status.x + 12, card.status.y + 13],+ at: [r.x + 40, below],+ label: "state/success/base",+ swatch: C.success,+ },+ {+ anchor: [card.title.x + 60, card.title.y + 9],+ at: [r.x + 205, below - 4],+ label: "text/strong-950",+ swatch: C.ink,+ },+ {+ anchor: [card.time.x + 40, card.time.y + 8],+ at: [r.x + 70, below + 30],+ label: "text/sub-600",+ swatch: C.sub,+ },+ {+ anchor: [r.x + r.w, r.y + 30],+ at: [r.x + 230, below + 30],+ label: "stroke/soft-200",+ swatch: C.stroke,+ },+ ] as TokenSpec[],+ };+}++function demoSet(v: Version) {+ const l = demoLayout(v);+ return {+ layout: l,+ measures: demoMeasures(l),+ radii: demoRadii(l),+ issues: demoIssues(l),+ tokens: demoTokens(l),+ guides: demoGuides(l),+ focus: demoFocus(l),+ /** Rect around the tabs and the card row. */+ cardRow: {+ x: l.contentX,+ y: l.tabs[0].y,+ w: l.calendar.w,+ h: l.cards[0].rect.y + 92 - l.tabs[0].y,+ } satisfies Rect,+ };+}++/** Mark data measured off the demo dashboard: `before` is v1, `after` v2. */+export const DEMO = { before: demoSet(1), after: demoSet(2) };+export const DEMO_WINDOW = WIN;++/* Mark sets */++/** Rulers then radius arcs, each `stagger` frames after the last. */+export function MeasureMarks({+ measures,+ radii = [],+ color,+ start = 0,+ stagger = 5,+}: {+ measures: Measure[];+ radii?: RadiusMark[];+ color: string;+ start?: number;+ stagger?: number;+}) {+ return (+ <>+ {measures.map((m, i) => (+ <Ruler+ key={`${m.from.join()}-${m.to.join()}`}+ from={m.from}+ to={m.to}+ label={m.label}+ color={color}+ delay={start + i * stagger}+ labelSide={m.side}+ />+ ))}+ {radii.map((r, i) => (+ <CornerArc+ key={`${r.x}-${r.y}`}+ x={r.x}+ y={r.y}+ r={r.r}+ label={r.label}+ color={color}+ delay={start + (measures.length + i) * stagger}+ />+ ))}+ </>+ );+}++const NOTE_SPOT = {+ start: (r: Rect) => ({+ x: r.x - 3,+ y: r.y - 3,+ anchor: "aboveStart" as const,+ }),+ end: (r: Rect) => ({+ x: r.x + r.w + 3,+ y: r.y - 3,+ anchor: "aboveEnd" as const,+ }),+ below: (r: Rect) => ({+ x: r.x - 3,+ y: r.y + r.h + 3,+ anchor: "belowStart" as const,+ }),+};++/** Every issue boxed, with its note popping on once the box closes. */+export function IssueMarks({+ issues,+ color,+ start = 0,+ stagger = 4,+}: {+ issues: Issue[];+ color: string;+ start?: number;+ stagger?: number;+}) {+ return (+ <>+ {issues.map((issue, i) => (+ <div key={`${issue.rect.x}-${issue.rect.y}-${issue.note}`}>+ <OutlineBox+ rect={issue.rect}+ color={color}+ delay={start + i * stagger}+ />+ <Pill+ {...NOTE_SPOT[issue.side ?? "start"](issue.rect)}+ text={issue.note}+ color={color}+ delay={start + i * stagger + 10}+ />+ </div>+ ))}+ </>+ );+}++export function TokenMarks({+ tokens,+ start = 0,+ stagger = 6,+ lineColor,+}: {+ tokens: TokenSpec[];+ start?: number;+ stagger?: number;+ lineColor?: string;+}) {+ return (+ <>+ {tokens.map((tag, i) => (+ <TokenTag+ key={`${tag.label}-${tag.anchor.join()}`}+ anchor={tag.anchor}+ at={tag.at}+ label={tag.label}+ swatch={tag.swatch}+ lineColor={lineColor}+ delay={start + i * stagger}+ />+ ))}+ </>+ );+}++/** Column guides drop in, the highlight fills, then the now line slides across. */+export function GuideMarks({+ guides,+ color,+ nowColor = C.primary,+ start = 0,+}: {+ guides: GuideSpec;+ color: string;+ nowColor?: string;+ start?: number;+}) {+ const { columns, top, bottom, highlight, ruler, now } = guides;+ const h = highlight?.rect;+ return (+ <>+ {columns.map((x, i) => (+ <Guide+ key={x}+ x={x}+ y={top}+ length={bottom - top}+ vertical+ color={color}+ dashed+ delay={start + i * 3}+ />+ ))}+ {h && highlight && (+ <>+ <OutlineBox+ rect={h}+ color={color}+ fill={`${color}14`}+ inset={0}+ radius={0}+ delay={start + 14}+ />+ <OutlineBox+ rect={{ x: h.x + 6, y: h.y + 4, w: h.w - 12, h: 22 }}+ color={color}+ radius={4}+ inset={0}+ delay={start + 20}+ />+ <Pill+ x={h.x + h.w / 2}+ y={h.y + 4}+ text={highlight.label}+ color={color}+ delay={start + 26}+ anchor="above"+ />+ </>+ )}+ {ruler && (+ <Ruler+ from={ruler.from}+ to={ruler.to}+ label={ruler.label}+ color={color}+ delay={start + 24}+ labelSide={ruler.side}+ />+ )}+ {now && (+ <>+ <Guide+ x={now.from}+ y={now.y}+ length={now.to - now.from}+ color={nowColor}+ width={1.5}+ delay={start + 30}+ />+ <Pill+ x={now.from}+ y={now.y}+ text={now.label}+ color={nowColor}+ delay={start + 30}+ anchor="left"+ />+ </>+ )}+ </>+ );+}++/** Brand name with a version chip that flips once the fix lands. */+export function VersionChip({+ brand,+ versions,+ fixed,+ colors,+}: {+ brand: string;+ versions: [string, string];+ fixed: boolean;+ colors: [string, string];+}) {+ return (+ <div+ style={{+ position: "absolute",+ left: WIN.x,+ top: 26,+ display: "flex",+ alignItems: "center",+ gap: 8,+ fontSize: 15,+ fontWeight: 600,+ color: C.ink,+ }}+ >+ {brand}+ <span+ style={{+ fontFamily: MONO,+ fontSize: 11,+ color: "#fff",+ background: fixed ? colors[1] : colors[0],+ borderRadius: 999,+ padding: "1px 8px",+ }}+ >+ {fixed ? versions[1] : versions[0]}+ </span>+ </div>+ );+}diff --git a/registry/remocn/design-audit/config.ts b/registry/remocn/design-audit/config.tsnew file mode 100644index 00000000..f8018737--- /dev/null+++ b/registry/remocn/design-audit/config.ts@@ -0,0 +1,23 @@+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const designAuditConfig: ComponentConfig = {+ componentName: "DesignAudit",+ importPath: "@/components/remocn/design-audit",+ controls: {+ brand: { type: "text-content", default: "Synergy", description: "Brand" },+ auditColor: { type: "color", default: "#FB3748", description: "Audit" },+ fixColor: { type: "color", default: "#335CFF", description: "Fix" },+ scanColor: { type: "color", default: "#7D52F4", description: "Scan" },+ background: {+ type: "color",+ default: "#EDEDEF",+ description: "Background",+ },+ },+ durationInFrames: 340,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#EDEDEF" },+ card: { fit: false },+};diff --git a/registry/remocn/design-audit/index.tsx b/registry/remocn/design-audit/index.tsxnew file mode 100644index 00000000..d86828bc--- /dev/null+++ b/registry/remocn/design-audit/index.tsx@@ -0,0 +1,293 @@+"use client";++import type { ReactNode } from "react";+import { AbsoluteFill } from "remotion";+import {+ AUDIT_COLORS,+ AuditClock,+ DEMO,+ DEMO_WINDOW,+ DemoDashboard,+ easeInOut,+ FONT,+ GuideMarks,+ type GuideSpec,+ type Issue,+ IssueMarks,+ type Measure,+ MeasureMarks,+ progress,+ type RadiusMark,+ type Rect,+ ScanBand,+ SplitAt,+ Spotlight,+ TokenMarks,+ type TokenSpec,+ useAuditFrame,+ VersionChip,+} from "@/lib/remocn/audit-core";++export type DesignAuditMarks = {+ measures?: Measure[];+ radii?: RadiusMark[];+};++export type DesignAuditFocus = {+ /** Element the camera pushes in on. */+ rect: Rect;+ measures?: Measure[];+ radii?: RadiusMark[];+ tokens?: TokenSpec[];+};++export type DesignAuditProps = {+ /** UI before the fix, 1280x720. Defaults to a demo dashboard with drifted spacing. */+ before?: ReactNode;+ /** The fixed UI, same layout. */+ after?: ReactNode;+ /** Red redlines drawn over `before`. */+ beforeMarks?: DesignAuditMarks;+ /** Off-spec elements boxed on `before`. */+ issues?: Issue[];+ /** Blue redlines over `after`, shown once the scan lands. */+ afterMarks?: DesignAuditMarks;+ /** Close-up the camera pushes into, with its specs and tokens. `null` skips the zoom. */+ focus?: DesignAuditFocus | null;+ /** Guides drawn after the camera pulls back. */+ guides?: GuideSpec | null;+ /** Four step names lit one by one across the top. */+ steps?: string[];+ /** Name next to the version chip. Empty hides the top bar. */+ brand?: string;+ versions?: [string, string];+ auditColor?: string;+ fixColor?: string;+ scanColor?: string;+ background?: string;+ speed?: number;+};++export const designAuditDefaults = {+ steps: ["Audit", "Layout", "Components", "Tokens"],+ brand: "Synergy",+ versions: ["v1.0", "v2.0"] as [string, string],+ auditColor: AUDIT_COLORS.audit,+ fixColor: AUDIT_COLORS.fix,+ scanColor: AUDIT_COLORS.scan,+ background: AUDIT_COLORS.stage,+ speed: 1,+};++const T = {+ redline: 14,+ audit: 34,+ scan: 72,+ scanLength: 64,+ zoomIn: 156,+ callouts: 180,+ tokens: 208,+ zoomOut: 252,+ guides: 278,+};++export const designAuditLength = 332;++export function DesignAudit(props: DesignAuditProps) {+ const { speed = 1 } = props;+ return (+ <AuditClock speed={speed}>+ <Scene {...props} />+ </AuditClock>+ );+}++function Scene({+ before,+ after,+ beforeMarks,+ issues,+ afterMarks,+ focus,+ guides,+ steps = designAuditDefaults.steps,+ brand = designAuditDefaults.brand,+ versions = designAuditDefaults.versions,+ auditColor = designAuditDefaults.auditColor,+ fixColor = designAuditDefaults.fixColor,+ scanColor = designAuditDefaults.scanColor,+ background = designAuditDefaults.background,+}: DesignAuditProps) {+ const frame = useAuditFrame();+ const demo = !before && !after;+ const redBefore = beforeMarks ?? (demo ? DEMO.before : {});+ const blueAfter = afterMarks ?? (demo ? DEMO.after : {});+ const flagged = issues ?? (demo ? DEMO.before.issues : []);+ const zoomed = focus === undefined ? (demo ? DEMO.after.focus : null) : focus;+ const grid =+ guides === undefined ? (demo ? DEMO.after.guides : null) : guides;++ const y = easeInOut(frame, [T.scan, T.scan + T.scanLength], [-20, 760]);+ const band = easeInOut(+ frame,+ [T.scan - 4, T.scan + 2, T.scan + T.scanLength - 8, T.scan + T.scanLength],+ [0, 1, 1, 0],+ );+ const enter = progress(frame, 0, 18);+ const zoom = zoomed+ ? easeInOut(+ frame,+ [T.zoomIn, T.zoomIn + 22, T.zoomOut, T.zoomOut + 22],+ [0, 1, 1, 0],+ )+ : 0;+ const card = zoomed?.rect ?? { x: 640, y: 360, w: 0, h: 0 };+ const center = { x: card.x + card.w / 2 + 40, y: card.y + card.h / 2 + 46 };+ const camera = `translate(${(640 - center.x) * zoom}px, ${(360 - center.y) * zoom}px) scale(${1 + zoom * 1.35})`;+ const fadeOut = (at: number) => easeInOut(frame, [at - 10, at], [1, 0]);++ const active =+ frame < T.scan ? 0 : frame < T.zoomIn ? 1 : frame < T.tokens ? 2 : 3;++ return (+ <AbsoluteFill style={{ background, fontFamily: FONT }}>+ <AbsoluteFill+ style={{+ transform: camera,+ transformOrigin: `${center.x}px ${center.y}px`,+ }}+ >+ <AbsoluteFill+ style={{+ opacity: enter,+ transform: `translateY(${(1 - enter) * 18}px) scale(${0.97 + 0.03 * enter})`,+ }}+ >+ <SplitAt+ y={y}+ bottom={+ <>+ {before ?? <DemoDashboard v={1} />}+ <MeasureMarks+ measures={redBefore.measures ?? []}+ radii={redBefore.radii}+ color={auditColor}+ start={T.redline}+ />+ <IssueMarks+ issues={flagged}+ color={auditColor}+ start={T.audit}+ />+ </>+ }+ top={+ <>+ {after ?? <DemoDashboard v={2} />}+ <AbsoluteFill+ style={{ opacity: zoomed ? fadeOut(T.zoomIn) : 1 }}+ >+ <MeasureMarks+ measures={blueAfter.measures ?? []}+ radii={blueAfter.radii}+ color={fixColor}+ start={-200}+ />+ </AbsoluteFill>+ </>+ }+ />+ <ScanBand y={y} color={scanColor} opacity={band} />+ {zoomed && (+ <>+ <Spotlight rect={zoomed.rect} color={background} opacity={zoom} />+ {frame >= T.callouts && (+ <AbsoluteFill style={{ opacity: fadeOut(T.zoomOut + 6) }}>+ <MeasureMarks+ measures={zoomed.measures ?? []}+ radii={zoomed.radii}+ color={fixColor}+ start={T.callouts}+ stagger={4}+ />+ <TokenMarks tokens={zoomed.tokens ?? []} start={T.tokens} />+ </AbsoluteFill>+ )}+ </>+ )}+ {grid && (+ <GuideMarks guides={grid} color={fixColor} start={T.guides} />+ )}+ </AbsoluteFill>+ </AbsoluteFill>+ {brand && (+ <AbsoluteFill style={{ opacity: enter * (1 - zoom) }}>+ <VersionChip+ brand={brand}+ versions={versions}+ fixed={y > 36}+ colors={[auditColor, fixColor]}+ />+ <StepBar+ steps={steps}+ active={active}+ colors={[auditColor, fixColor]}+ />+ </AbsoluteFill>+ )}+ </AbsoluteFill>+ );+}++function StepBar({+ steps,+ active,+ colors,+}: {+ steps: string[];+ active: number;+ colors: [string, string];+}) {+ return (+ <div+ style={{+ position: "absolute",+ right: 1280 - DEMO_WINDOW.x - DEMO_WINDOW.w,+ top: 28,+ display: "flex",+ gap: 18,+ fontSize: 12.5,+ }}+ >+ {steps.map((step, i) => {+ const on = i <= active;+ return (+ <span+ key={step}+ style={{+ display: "flex",+ alignItems: "center",+ gap: 6,+ color: on ? AUDIT_COLORS.ink : "#99A0AE",+ fontWeight: i === active ? 600 : 400,+ }}+ >+ <span+ style={{+ width: 6,+ height: 6,+ borderRadius: 3,+ background: on+ ? active === 0+ ? colors[0]+ : colors[1]+ : "#E1E4EA",+ }}+ />+ {step}+ </span>+ );+ })}+ </div>+ );+}diff --git a/registry/remocn/layout-guides/config.ts b/registry/remocn/layout-guides/config.tsnew file mode 100644index 00000000..b6c3beb0--- /dev/null+++ b/registry/remocn/layout-guides/config.ts@@ -0,0 +1,21 @@+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const layoutGuidesConfig: ComponentConfig = {+ componentName: "LayoutGuides",+ importPath: "@/components/remocn/layout-guides",+ controls: {+ color: { type: "color", default: "#335CFF", description: "Guides" },+ nowColor: { type: "color", default: "#7D52F4", description: "Now line" },+ background: {+ type: "color",+ default: "#EDEDEF",+ description: "Background",+ },+ },+ durationInFrames: 81,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#EDEDEF" },+ card: { fit: false },+};diff --git a/registry/remocn/layout-guides/index.tsx b/registry/remocn/layout-guides/index.tsxnew file mode 100644index 00000000..44d9c05a--- /dev/null+++ b/registry/remocn/layout-guides/index.tsx@@ -0,0 +1,65 @@+"use client";++import type { ReactNode } from "react";+import { AbsoluteFill } from "remotion";+import {+ AUDIT_COLORS,+ AuditClock,+ DEMO,+ DemoDashboard,+ FONT,+ GuideMarks,+ type GuideSpec,+} from "@/lib/remocn/audit-core";++export type LayoutGuidesProps = {+ /** UI to lay guides over, in a 1280x720 frame. Defaults to a demo calendar dashboard. */+ children?: ReactNode;+ /** Column edges, highlight, ruler and now line, in frame pixels. */+ guides?: GuideSpec;+ color?: string;+ /** Color of the now line and its label. */+ nowColor?: string;+ background?: string;+ speed?: number;+};++export const layoutGuidesDefaults = {+ color: AUDIT_COLORS.fix,+ nowColor: AUDIT_COLORS.scan,+ background: AUDIT_COLORS.stage,+ speed: 1,+};++export const layoutGuidesLength = 54;++export function LayoutGuides(props: LayoutGuidesProps) {+ const { speed = 1 } = props;+ return (+ <AuditClock speed={speed}>+ <Scene {...props} />+ </AuditClock>+ );+}++function Scene({+ children,+ guides = children ? undefined : DEMO.after.guides,+ color = layoutGuidesDefaults.color,+ nowColor = layoutGuidesDefaults.nowColor,+ background = layoutGuidesDefaults.background,+}: LayoutGuidesProps) {+ return (+ <AbsoluteFill style={{ background, fontFamily: FONT }}>+ {children ?? <DemoDashboard v={2} />}+ {guides && (+ <GuideMarks+ guides={guides}+ color={color}+ nowColor={nowColor}+ start={8}+ />+ )}+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/redline-measure/config.ts b/registry/remocn/redline-measure/config.tsnew file mode 100644index 00000000..f74ba43c--- /dev/null+++ b/registry/remocn/redline-measure/config.ts@@ -0,0 +1,38 @@+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const redlineMeasureConfig: ComponentConfig = {+ componentName: "RedlineMeasure",+ importPath: "@/components/remocn/redline-measure",+ controls: {+ color: { type: "color", default: "#FB3748", description: "Marks" },+ background: {+ type: "color",+ default: "#EDEDEF",+ description: "Background",+ },+ dim: {+ type: "number",+ min: 0,+ max: 0.6,+ step: 0.02,+ default: 0.18,+ description: "Dim UI",+ hiddenFromList: false,+ },+ stagger: {+ type: "number",+ min: 1,+ max: 12,+ step: 1,+ default: 5,+ description: "Stagger",+ hiddenFromList: false,+ },+ },+ durationInFrames: 90,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#EDEDEF" },+ card: { fit: false },+};diff --git a/registry/remocn/redline-measure/index.tsx b/registry/remocn/redline-measure/index.tsxnew file mode 100644index 00000000..780294c6--- /dev/null+++ b/registry/remocn/redline-measure/index.tsx@@ -0,0 +1,80 @@+"use client";++import type { ReactNode } from "react";+import { AbsoluteFill } from "remotion";+import {+ AUDIT_COLORS,+ AuditClock,+ DEMO,+ DemoDashboard,+ easeInOut,+ FONT,+ type Measure,+ MeasureMarks,+ type RadiusMark,+ useAuditFrame,+} from "@/lib/remocn/audit-core";++export type RedlineMeasureProps = {+ /** UI to measure, laid out in a 1280x720 frame. Defaults to a demo calendar dashboard. */+ children?: ReactNode;+ /** Distances to draw, in frame pixels. Defaults to spacing on the demo dashboard. */+ measures?: Measure[];+ /** Corners whose radius gets an arc and a label. */+ radii?: RadiusMark[];+ color?: string;+ background?: string;+ /** How far the UI fades toward the background so the marks read, 0 to 1. */+ dim?: number;+ /** Frames between one mark and the next. */+ stagger?: number;+ speed?: number;+};++export const redlineMeasureDefaults = {+ color: AUDIT_COLORS.audit,+ background: AUDIT_COLORS.stage,+ dim: 0.18,+ stagger: 5,+ speed: 1,+};++export const redlineMeasureLength = 63;++const START = 8;++export function RedlineMeasure(props: RedlineMeasureProps) {+ const { speed = 1 } = props;+ return (+ <AuditClock speed={speed}>+ <Scene {...props} />+ </AuditClock>+ );+}++function Scene({+ children,+ measures = children ? [] : DEMO.before.measures,+ radii = children ? [] : DEMO.before.radii,+ color = redlineMeasureDefaults.color,+ background = redlineMeasureDefaults.background,+ dim = redlineMeasureDefaults.dim,+ stagger = redlineMeasureDefaults.stagger,+}: RedlineMeasureProps) {+ const frame = useAuditFrame();+ return (+ <AbsoluteFill style={{ background, fontFamily: FONT }}>+ {children ?? <DemoDashboard v={1} />}+ <AbsoluteFill+ style={{ background, opacity: easeInOut(frame, [0, 10], [0, dim]) }}+ />+ <MeasureMarks+ measures={measures}+ radii={radii}+ color={color}+ start={START}+ stagger={stagger}+ />+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/registry.json b/registry/remocn/registry.jsonindex 84fc48f9..6f3fef58 100644--- a/registry/remocn/registry.json+++ b/registry/remocn/registry.json@@ -11591,6 +11591,110 @@"target": "components/remocn/feature-flag-rollout.tsx"}]+ },+ {+ "name": "audit-core",+ "type": "registry:lib",+ "title": "Audit Core",+ "description": "Shared kit behind the design-review components: redline rulers, issue boxes, radius arcs, token tags, layout guides, the scan band and a demo dashboard to measure.",+ "dependencies": ["remotion"],+ "files": [+ {+ "path": "audit-core/index.tsx",+ "type": "registry:lib",+ "target": "lib/remocn/audit-core.tsx"+ }+ ]+ },+ {+ "name": "redline-measure",+ "type": "registry:component",+ "title": "Redline Measure",+ "description": "Spacing and size redlines draw over a UI one by one: ticks snap in, the line grows from its middle and the value pops on.",+ "dependencies": ["remotion"],+ "registryDependencies": ["@remocn/audit-core"],+ "files": [+ {+ "path": "redline-measure/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/redline-measure.tsx"+ }+ ]+ },+ {+ "name": "audit-boxes",+ "type": "registry:component",+ "title": "Audit Boxes",+ "description": "Off-spec elements of a UI get traced with red boxes, each with the fix it needs, while an issue counter ticks up.",+ "dependencies": ["remotion"],+ "registryDependencies": ["@remocn/audit-core"],+ "files": [+ {+ "path": "audit-boxes/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/audit-boxes.tsx"+ }+ ]+ },+ {+ "name": "scan-fix",+ "type": "registry:component",+ "title": "Scan Fix",+ "description": "A scan band sweeps down a screen: below it the old build with red redlines, above it the fixed build with blue ones, and the version chip flips.",+ "dependencies": ["remotion"],+ "registryDependencies": ["@remocn/audit-core"],+ "files": [+ {+ "path": "scan-fix/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/scan-fix.tsx"+ }+ ]+ },+ {+ "name": "token-tags",+ "type": "registry:component",+ "title": "Token Tags",+ "description": "The rest of the UI washes out and leader lines run from elements to dark chips naming the design tokens they use.",+ "dependencies": ["remotion"],+ "registryDependencies": ["@remocn/audit-core"],+ "files": [+ {+ "path": "token-tags/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/token-tags.tsx"+ }+ ]+ },+ {+ "name": "layout-guides",+ "type": "registry:component",+ "title": "Layout Guides",+ "description": "Dashed column guides drop over a grid, one column fills and gets a label, a gutter is measured and a now line slides across.",+ "dependencies": ["remotion"],+ "registryDependencies": ["@remocn/audit-core"],+ "files": [+ {+ "path": "layout-guides/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/layout-guides.tsx"+ }+ ]+ },+ {+ "name": "design-audit",+ "type": "registry:component",+ "title": "Design Audit",+ "description": "A full design review in one scene: redlines and issue boxes, a scan that ships the fix, a camera push into one card with specs and tokens, then layout guides.",+ "dependencies": ["remotion"],+ "registryDependencies": ["@remocn/audit-core"],+ "files": [+ {+ "path": "design-audit/index.tsx",+ "type": "registry:component",+ "target": "components/remocn/design-audit.tsx"+ }+ ]}]}diff --git a/registry/remocn/scan-fix/config.ts b/registry/remocn/scan-fix/config.tsnew file mode 100644index 00000000..1161cdbd--- /dev/null+++ b/registry/remocn/scan-fix/config.ts@@ -0,0 +1,23 @@+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const scanFixConfig: ComponentConfig = {+ componentName: "ScanFix",+ importPath: "@/components/remocn/scan-fix",+ controls: {+ brand: { type: "text-content", default: "Synergy", description: "Brand" },+ scanColor: { type: "color", default: "#7D52F4", description: "Scan" },+ beforeColor: { type: "color", default: "#FB3748", description: "Before" },+ afterColor: { type: "color", default: "#335CFF", description: "After" },+ background: {+ type: "color",+ default: "#EDEDEF",+ description: "Background",+ },+ },+ durationInFrames: 127,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#EDEDEF" },+ card: { fit: false },+};diff --git a/registry/remocn/scan-fix/index.tsx b/registry/remocn/scan-fix/index.tsxnew file mode 100644index 00000000..6c23e8eb--- /dev/null+++ b/registry/remocn/scan-fix/index.tsx@@ -0,0 +1,133 @@+"use client";++import type { ReactNode } from "react";+import { AbsoluteFill } from "remotion";+import {+ AUDIT_COLORS,+ AuditClock,+ DEMO,+ DemoDashboard,+ easeInOut,+ FONT,+ IssueMarks,+ MeasureMarks,+ ScanBand,+ SplitAt,+ useAuditFrame,+ VersionChip,+} from "@/lib/remocn/audit-core";++export type ScanFixProps = {+ /** Frame before the fix, 1280x720. Defaults to the demo dashboard with red redlines. */+ before?: ReactNode;+ /** Frame after the fix, same size. Defaults to the fixed dashboard with blue redlines. */+ after?: ReactNode;+ /** Name next to the version chip. Empty hides the chip. */+ brand?: string;+ /** Version chip text before and after the band passes it. */+ versions?: [string, string];+ scanColor?: string;+ beforeColor?: string;+ afterColor?: string;+ background?: string;+ speed?: number;+};++export const scanFixDefaults = {+ brand: "Synergy",+ versions: ["v1.0", "v2.0"] as [string, string],+ scanColor: AUDIT_COLORS.scan,+ beforeColor: AUDIT_COLORS.audit,+ afterColor: AUDIT_COLORS.fix,+ background: AUDIT_COLORS.stage,+ speed: 1,+};++export const scanFixLength = 100;++const SCAN_START = 18;+const SCAN_LENGTH = 80;++export function ScanFix(props: ScanFixProps) {+ const { speed = 1 } = props;+ return (+ <AuditClock speed={speed}>+ <Scene {...props} />+ </AuditClock>+ );+}++function DemoBefore({ color }: { color: string }) {+ return (+ <>+ <DemoDashboard v={1} />+ <MeasureMarks+ measures={DEMO.before.measures}+ radii={DEMO.before.radii}+ color={color}+ start={-200}+ />+ <IssueMarks issues={DEMO.before.issues} color={color} start={-200} />+ </>+ );+}++function DemoAfter({ color }: { color: string }) {+ return (+ <>+ <DemoDashboard v={2} />+ <MeasureMarks+ measures={DEMO.after.measures}+ radii={DEMO.after.radii}+ color={color}+ start={-200}+ />+ </>+ );+}++function Scene({+ before,+ after,+ brand = scanFixDefaults.brand,+ versions = scanFixDefaults.versions,+ scanColor = scanFixDefaults.scanColor,+ beforeColor = scanFixDefaults.beforeColor,+ afterColor = scanFixDefaults.afterColor,+ background = scanFixDefaults.background,+}: ScanFixProps) {+ const frame = useAuditFrame();+ const y = easeInOut(+ frame,+ [SCAN_START, SCAN_START + SCAN_LENGTH],+ [-20, 760],+ );+ const band = easeInOut(+ frame,+ [+ SCAN_START - 4,+ SCAN_START + 2,+ SCAN_START + SCAN_LENGTH - 6,+ SCAN_START + SCAN_LENGTH + 2,+ ],+ [0, 1, 1, 0],+ );+ return (+ <AbsoluteFill style={{ background, fontFamily: FONT }}>+ <SplitAt+ y={y}+ bottom={before ?? <DemoBefore color={beforeColor} />}+ top={after ?? <DemoAfter color={afterColor} />}+ />+ {brand && (+ <VersionChip+ brand={brand}+ versions={versions}+ fixed={y > 36}+ colors={[beforeColor, afterColor]}+ />+ )}+ <ScanBand y={y} color={scanColor} opacity={band} />+ </AbsoluteFill>+ );+}diff --git a/registry/remocn/token-tags/config.ts b/registry/remocn/token-tags/config.tsnew file mode 100644index 00000000..76b90c1d--- /dev/null+++ b/registry/remocn/token-tags/config.ts@@ -0,0 +1,29 @@+import { type ComponentConfig, FPS, H, W } from "@/lib/customizer-config";++export const tokenTagsConfig: ComponentConfig = {+ componentName: "TokenTags",+ importPath: "@/components/remocn/token-tags",+ controls: {+ lineColor: { type: "color", default: "#0E121B", description: "Leaders" },+ background: {+ type: "color",+ default: "#EDEDEF",+ description: "Background",+ },+ stagger: {+ type: "number",+ min: 1,+ max: 12,+ step: 1,+ default: 6,+ description: "Stagger",+ hiddenFromList: false,+ },+ },+ durationInFrames: 88,+ fps: FPS,+ compositionWidth: W,+ compositionHeight: H,+ previewBackdrop: { type: "color", value: "#EDEDEF" },+ card: { fit: false },+};diff --git a/registry/remocn/token-tags/index.tsx b/registry/remocn/token-tags/index.tsxnew file mode 100644index 00000000..3f6ead5d--- /dev/null+++ b/registry/remocn/token-tags/index.tsx@@ -0,0 +1,80 @@+"use client";++import type { ReactNode } from "react";+import { AbsoluteFill } from "remotion";+import {+ AUDIT_COLORS,+ AuditClock,+ DEMO,+ DemoDashboard,+ easeInOut,+ FONT,+ type Rect,+ Spotlight,+ TokenMarks,+ type TokenSpec,+ useAuditFrame,+} from "@/lib/remocn/audit-core";++export type TokenTagsProps = {+ /** UI to tag, laid out in a 1280x720 frame. Defaults to a demo calendar dashboard. */+ children?: ReactNode;+ /** Token tags: a dot on `anchor`, the chip centered on `at`, in frame pixels. */+ tokens?: TokenSpec[];+ /** Area kept bright while the rest washes out. `null` skips the wash. */+ focus?: Rect | null;+ lineColor?: string;+ background?: string;+ /** Frames between one tag and the next. */+ stagger?: number;+ speed?: number;+};++export const tokenTagsDefaults = {+ lineColor: AUDIT_COLORS.ink,+ background: AUDIT_COLORS.stage,+ stagger: 6,+ speed: 1,+};++export const tokenTagsLength = 61;++const START = 12;++export function TokenTags(props: TokenTagsProps) {+ const { speed = 1 } = props;+ return (+ <AuditClock speed={speed}>+ <Scene {...props} />+ </AuditClock>+ );+}++function Scene({+ children,+ tokens = children ? [] : DEMO.after.tokens,+ focus = children ? null : DEMO.after.cardRow,+ lineColor = tokenTagsDefaults.lineColor,+ background = tokenTagsDefaults.background,+ stagger = tokenTagsDefaults.stagger,+}: TokenTagsProps) {+ const frame = useAuditFrame();+ return (+ <AbsoluteFill style={{ background, fontFamily: FONT }}>+ {children ?? <DemoDashboard v={2} />}+ {focus && (+ <Spotlight+ rect={focus}+ color={background}+ opacity={easeInOut(frame, [0, 12], [0, 1])}+ />+ )}+ <TokenMarks+ tokens={tokens}+ start={START}+ stagger={stagger}+ lineColor={lineColor}+ />+ </AbsoluteFill>+ );+}diff --git a/remotion.config.ts b/remotion.config.tsindex 5e432c17..f2dc3bd7 100644--- a/remotion.config.ts+++ b/remotion.config.ts@@ -34,6 +34,10 @@ Config.overrideWebpackConfig((config) => ({process.cwd(),"registry/remocn/radial-burst/index.tsx",),+ "@/lib/remocn/audit-core$": path.join(+ process.cwd(),+ "registry/remocn/audit-core/index.tsx",+ ),"@": process.cwd(),},},diff --git a/scripts/build-elements.mts b/scripts/build-elements.mtsindex 2ef2711c..dac134fe 100644--- a/scripts/build-elements.mts+++ b/scripts/build-elements.mts@@ -30,6 +30,10 @@ const INLINABLE_LIBS: Record<string, { artifact: string; importPath: string }> =artifact: "caption-core",importPath: "@/lib/remocn/caption-core",},+ "@remocn/audit-core": {+ artifact: "audit-core",+ importPath: "@/lib/remocn/audit-core",+ },};interface RegistryItem {diff --git a/src/remotion/design-audit-root.tsx b/src/remotion/design-audit-root.tsxnew file mode 100644index 00000000..6cf63563--- /dev/null+++ b/src/remotion/design-audit-root.tsx@@ -0,0 +1,25 @@+import { Composition, Folder, registerRoot } from "remotion";+import { designAuditDrafts } from "./design-audit/drafts";++// Studio shelf for the design-audit family: redlines, scan, tokens, guides.+// Run: bun run studio:design-audit+function DesignAuditRoot() {+ return (+ <Folder name="Design-audit">+ {designAuditDrafts.map((entry) => (+ <Composition+ key={entry.id}+ id={entry.id}+ component={entry.component}+ durationInFrames={entry.durationInFrames}+ fps={30}+ width={1280}+ height={720}+ defaultProps={entry.defaultProps ?? {}}+ />+ ))}+ </Folder>+ );+}++registerRoot(DesignAuditRoot);diff --git a/src/remotion/design-audit/drafts.tsx b/src/remotion/design-audit/drafts.tsxnew file mode 100644index 00000000..3fc3d701--- /dev/null+++ b/src/remotion/design-audit/drafts.tsx@@ -0,0 +1,49 @@+import { AuditBoxes, auditBoxesLength } from "@/registry/remocn/audit-boxes";+import { DesignAudit, designAuditLength } from "@/registry/remocn/design-audit";+import {+ LayoutGuides,+ layoutGuidesLength,+} from "@/registry/remocn/layout-guides";+import {+ RedlineMeasure,+ redlineMeasureLength,+} from "@/registry/remocn/redline-measure";+import { ScanFix, scanFixLength } from "@/registry/remocn/scan-fix";+import { TokenTags, tokenTagsLength } from "@/registry/remocn/token-tags";+import type { DraftEntry } from "../motion-pack/shared";++/** Each scene holds a beat past its own motion so the end state reads. */+const HOLD = 27;++export const designAuditDrafts: DraftEntry[] = [+ {+ id: "design-audit",+ component: DesignAudit,+ durationInFrames: designAuditLength + 8,+ },+ {+ id: "redline-measure",+ component: RedlineMeasure,+ durationInFrames: redlineMeasureLength + HOLD,+ },+ {+ id: "audit-boxes",+ component: AuditBoxes,+ durationInFrames: auditBoxesLength + HOLD,+ },+ {+ id: "scan-fix",+ component: ScanFix,+ durationInFrames: scanFixLength + HOLD,+ },+ {+ id: "token-tags",+ component: TokenTags,+ durationInFrames: tokenTagsLength + HOLD,+ },+ {+ id: "layout-guides",+ component: LayoutGuides,+ durationInFrames: layoutGuidesLength + HOLD,+ },+];diff --git a/tsconfig.json b/tsconfig.jsonindex fdea32e3..2cbc7f44 100644--- a/tsconfig.json+++ b/tsconfig.json@@ -36,6 +36,7 @@"./registry/remocn/canvas-presentation/index.tsx"],"@/lib/remocn/caption-core": ["./registry/remocn/caption-core/index.ts"],+ "@/lib/remocn/audit-core": ["./registry/remocn/audit-core/index.tsx"],"@/components/remocn/brush": ["./registry/remocn/brush/index.tsx"],"@/components/remocn/handwrite": ["./registry/remocn/handwrite/index.tsx"