From a2e4fc903996401256142d42aaa6a15aaeac0d6f Mon Sep 17 00:00:00 2001 From: Satyam <95536056+Satyam-Rastogi@users.noreply.github.com> Date: Fri, 13 Mar 2026 16:13:45 +0530 Subject: [PATCH] =?UTF-8?q?feat(leads):=20Lead=20Creation=20Phase=202=20?= =?UTF-8?q?=E2=80=94=20Job=20Details=20section=20with=20live=20fields?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - UrgencyPillSelector: 3-pill selector (Standard/High/Emergency) with Framer Motion layoutId sliding background, spring physics, color transition on text - LeadJobSection: full Job Details fields — Lead Source (always), Lead Type / Work Type / Trade Type (Full Form only, each row animates in/out with spring height collapse), Urgency pill (always), Notes textarea (Full Form only) - Full Form fields use overflow-hidden + height:auto spring animation — no phantom gaps since spacing is managed via pt-4 inside each animated block - CreateLeadPage: formData state tracking all sections (scaffold for Phase 3-6 fields), updateField handler, sectionCompletion map, GSAP progress bar now driven by real field completion percentage, Job Details section wired up with live data --- src/components/leads/LeadJobSection.jsx | 191 +++++++++++++++++++ src/components/leads/UrgencyPillSelector.jsx | 50 +++++ src/pages/CreateLeadPage.jsx | 131 ++++++++++--- 3 files changed, 345 insertions(+), 27 deletions(-) create mode 100644 src/components/leads/LeadJobSection.jsx create mode 100644 src/components/leads/UrgencyPillSelector.jsx diff --git a/src/components/leads/LeadJobSection.jsx b/src/components/leads/LeadJobSection.jsx new file mode 100644 index 0000000..0333842 --- /dev/null +++ b/src/components/leads/LeadJobSection.jsx @@ -0,0 +1,191 @@ +import React from 'react'; +import { motion, AnimatePresence } from 'framer-motion'; +import { ChevronDown } from 'lucide-react'; +import { useTheme } from '../../context/ThemeContext'; +import { LEAD_FORM_OPTIONS } from '../../data/mockStore'; +import UrgencyPillSelector from './UrgencyPillSelector'; + +// --------------------------------------------------------------------------- +// Shared field primitives (local to Job section for now) +// --------------------------------------------------------------------------- +function FieldLabel({ children }) { + return ( + + ); +} + +function LeadSelect({ label, value, onChange, options, placeholder }) { + const { theme } = useTheme(); + const isDark = theme === 'dark'; + + return ( +
+ {label} +
+ + +
+
+ ); +} + +function LeadTextarea({ label, value, onChange, placeholder, rows = 3 }) { + const { theme } = useTheme(); + const isDark = theme === 'dark'; + + return ( +
+ {label} +