Project Plan: HP Presentation to Code Conversion
Project Goal
Convert Figma slides from the HP template (https://www.figma.com/design/Zfi3imguE8CMj6a0UTRiAE/Untitled?t=O9lCG6gTBD4g299J-0) into a structured TypeScript code format similar to the provided example (block-text.ts).
Project Steps
Review provided documents:
https://www.figma.com/design/Zfi3imguE8CMj6a0UTRiAE/Untitled?t=O9lCG6gTBD4g299J-0: Familiarize with the presentation design, content structure, and slide types.
block-text.ts: Analyze the existing example to understand the coding style, structure, and standards expected.
Establish a clear mapping guideline from Figma elements to TypeScript code components:
Text Blocks: Slide titles, subtitles, body text.
Images: Placement, dimensions, and placeholder handling.
Layout Management: Translate Figma layouts (title, subtitle, image-text, text-heavy slides, dividers, timelines) into appropriate TypeScript component structures.
Slide Parsing:
Extract textual content, layout positions, and style attributes from the Figma file.
Identify and handle different Figma frame layouts systematically.
Code Generation Logic:
Implement logic to convert parsed slide data into structured TypeScript JSX code as shown in the example.
Automate handling of typography, colors, spacing, and other design properties to match the HP template.
Each type of slide from the Figma template will be mapped into a specific code structure.
Slide Type
Code Component Structure
Example Slide Elements
Opening Slide
<OpeningSlide title="" subtitle="" />Deck title, subtitle
Agenda Slide
<Agenda items={["Intro", "Styles", ...]} />
Agenda list items
Section Divider
<Divider title="" subtitle="" />Divider titles, subtitles
Text Heavy Slide
<TextBlock title="" subtitle="" text="" />Main text-heavy slides
Image + Text Slide
<ImageText imgSrc="" title="" text="" />Combination of image and text content
Timeline Slide
<Timeline entries={[{month:"", text:""}]} />
Monthly timeline points
Data Visualization Slide
<DataViz title="" data={} />Charts, stats, and data visualizations
Thank You Slide
<ThankYou message="" />Thank you and closing message
Quote Slide
<QuoteBlock quote="" author="" />Quotes and attribution
Create automated tests to:
Verify correct mapping of slide elements to the TypeScript components.
Validate that the generated components accurately reproduce the original slide layouts and styles.
Confirm text content integrity and formatting consistency.
Integrate generated code within a React project for easy visualization.
Provide a preview feature enabling verification against the original Figma slide.
Conduct thorough testing for all slide types.
Make necessary adjustments to the mapping logic and styling.
Document clearly:
How to use and extend the v0.dev assistant.
Code generation logic and architecture.
Usage examples and integration guide.
Deliverables
List of .ts files corresponding to each slide shown in the Figma presentation.
Comprehensive documentation for future maintenance and updates.
This structured approach will help ensure clarity and consistency throughout the implementation, making it straightforward to automate and scale this process for additional presentations in the future.
I'll help you convert the Figma slides from the HP template into a structured TypeScript code format similar to the provided block-text.ts
example. Let's start by analyzing the example and creating a plan for implementing different slide types.
Based on your project plan, I'll create TypeScript files for different slide types from the HP template, following the structure of the provided block-text.ts
example.
Let's start with implementing several key slide types:
I've created TypeScript files for 8 different slide types based on the HP template, following the structure of the provided block-text.ts
example:
Opening Slide (opening-slide.ts
)
Agenda Slide (agenda-slide.ts
)
Divider Slide (divider-slide.ts
)
Image + Text Slide (image-text-slide.ts
)
Timeline Slide (timeline-slide.ts
)
Data Visualization Slide (data-viz-slide.ts
)
Quote Block Slide (quote-block-slide.ts
)
Thank You Slide (thank-you-slide.ts
)
Each file follows the same pattern:
I've also included:
utils.ts
with helper functionsindex.ts
that exports all slide typesHere's how you would use these components to create slides:
import { OpeningSlide, Agenda, ImageText, Timeline, ThankYou } from './index';
// Create an opening slide
const slide1 = OpeningSlide({
title: "HP Quarterly Report",
subtitle: "Q2 2023 Financial Results"
});
// Create an agenda slide
const slide2 = Agenda({
title: "Today's Agenda",
items: [
"Financial Highlights",
"Product Performance",
"Market Analysis",
"Future Outlook"
]
});
// Create an image + text slide
const slide3 = ImageText({
title: "Product Performance",
text: "Our latest product line has exceeded expectations with a 15% increase in sales compared to last quarter.",
imgSrc: "product-chart.png",
imageOnRight: true
});
// Create a timeline slide
const slide4 = Timeline({
title: "Roadmap",
entries: [
{ month: "Jan", text: "Product Launch" },
{ month: "Mar", text: "Market Expansion" },
{ month: "May", text: "Feature Update" },
{ month: "Jul", text: "Partner Program" },
{ month: "Sep", text: "Global Rollout" }
]
});
// Create a thank you slide
const slide5 = ThankYou({
message: "Thank You",
contactInfo: "contact@example.com | www.example.com"
});