import React, { useState } from "react"; import { motion, AnimatePresence } from…
- User
import React, { useState } from "react"; import { motion, AnimatePresence } from "framer-motion"; import { Plus, Search, ChevronDown, CheckCircle, FileText, User, Car, Wrench, DollarSign, Clock } from "lucide-react";
// --- Custom Styles for Luxury Tech Feel --- const styles = { container: { minHeight: "100vh", backgroundColor: "#0d0d0d", // Matte Black Background color: "#f5f5f7", fontFamily: "Inter, sans-serif", padding: "24px 16px", display: "flex", flexDirection: "column", alignItems: "center", }, card: { background: "rgba(26, 26, 26, 0.65)", backdropFilter: "blur(12px)", border: "1px solid rgba(255, 255, 255, 0.08)", borderRadius: "16px", padding: "20px", width: "100%", maxWidth: "480px", marginBottom: "16px", boxShadow: "0 8px 32px 0 rgba(0, 0, 0, 0.37)", }, buttonPrimary: { background: "#f5f5f7", color: "#0d0d0d", border: "none", borderRadius: "12px", padding: "14px 20px", fontSize: "16px", fontWeight: "600", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center", gap: "8px", width: "100%", maxWidth: "480px", transition: "all 0.2s ease", }, inputWrapper: { position: "relative", marginTop: "10px", }, input: { width: "100%", backgroundColor: "#1a1a1a", border: "1px solid rgba(255, 255, 255, 0.1)", borderRadius: "10px", padding: "12px 12px 12px 40px", color: "#fff", fontSize: "14px", boxSizing: "border-box", }, dropdown: { backgroundColor: "#1a1a1a", border: "1px solid rgba(255, 255, 255, 0.1)", borderRadius: "10px", marginTop: "8px", overflow: "hidden", }, dropdownItem: { padding: "12px", borderBottom: "1px solid rgba(255, 255, 255, 0.05)", cursor: "pointer", fontSize: "14px", transition: "background 0.2s", }, };
// --- Framer Motion Mask Variants --- const maskVariants = { hidden: { opacity: 0, y: 20, clipPath: "inset(0% 0% 100% 0%)" // Top to bottom reveal mask }, visible: { opacity: 1, y: 0, clipPath: "inset(0% 0% 0% 0%)", transition: { duration: 0.5, ease: "easeInOut" } }, };
export default function AutodotsEstimateFlow() { // Flow States const [step, setStep] = useState(0); // 0: Initial, 1: Customer, 2: Vehicle Auto-Added, 3: Service Selected, 4: Saved const [showCustomerDropdown, setShowCustomerDropdown] = useState(false); const [showServiceDropdown, setShowServiceDropdown] = useState(false); const [selectedCustomer, setSelectedCustomer] = useState(""); const [selectedService, setSelectedService] = useState("");
const handleNewEstimate = () => { setStep(1); };
const handleSelectCustomer = (name) => { setSelectedCustomer(name); setShowCustomerDropdown(false); // 2-3 સેકન્ડ પછી ઓટોમેટિક વ્હીકલ કાર્ડ એડ થશે setTimeout(() => { setStep(2); }, 800); };
const handleSelectService = (serviceName) => { setSelectedService(serviceName); setShowServiceDropdown(false); // સર્વિસ સિલેક્ટ થતાં જ પ્રાઇસ સમરી અને હિસ્ટ્રી બંને એકસાથે ઓપન થશે setStep(3); };
return ( {/* Header Info */} <div style={{ textAlign: "center", marginBottom: "24px" }}> <h2 style={{ fontSize: "20px", fontWeight: "600", letterSpacing: "-0.5px" }}>Autodots Flow <p style={{ fontSize: "13px", color: "#86868b" }}>Interactive Mask Animation Draft
- Assistant
I'll build the Autodots Estimate Flow app with the animation component you provided. Let me install the required packages and set up the files.
Now let me update the App.tsx with the provided component and update the index.html title:
I need to fix the TypeScript errors. Let me update the file to resolve the type issues:
Now let me build the project to confirm everything works:
The project builds successfully. Here's what I created:
Autodots Estimate Flow - An interactive multi-step estimate creation flow with luxury dark theme and Framer Motion mask animations.
The app features:
- Step 0: A "New Estimate" button to start the flow
- Step 1: Customer search with a dropdown showing sample customers (Ramesh Pandya, Darshita Sojitra)
- Step 2: Auto-detected vehicle card with service selection dropdown
- Step 3: Pricing summary card + Service history card with a "Send Estimate" button
- Step 4: Success confirmation with a reset option