root = Card([header, keyMetrics, openRolesSection, pipelineSection, deptSplitSection, interviewsSection, attritionSection, newRoleAction])
header = CardHeader("Hiring Overview", "Live snapshot of recruiting health — updated daily")
keyMetrics = Card([headcountMetric, timeToHireMetric, openRolesMetric], "clear", "row", "l")
headcountMetric = Callout("info", "Current Headcount", "247 employees")
timeToHireMetric = Callout("neutral", "Avg Time to Hire", "38 days")
openRolesMetric = Callout("warning", "Open Roles", "12 positions")
openRolesSection = Card([openRolesHeader, openRolesTable], "sunk")
openRolesHeader = Heading("Open Roles by Department", "h3")
openRolesTable = Table([roleTitleCol, roleDeptCol, roleStatusCol, rolePostedCol])
roleTitleCol = Col("Role", ["Senior Frontend Engineer", "Product Designer", "Backend Engineer", "DevOps Engineer", "Sales Development Rep", "Customer Success Manager", "Data Analyst", "Engineering Manager", "Marketing Specialist", "HR Business Partner", "QA Engineer", "Technical Writer"])
roleDeptCol = Col("Department", ["Engineering", "Design", "Engineering", "Engineering", "Sales", "Customer Success", "Data", "Engineering", "Marketing", "People", "Engineering", "Design"])
roleStatusCol = Col("Status", ["Active", "Active", "Active", "Pipeline Building", "Active", "On Hold", "Active", "Active", "Pipeline Building", "Active", "Active", "Pipeline Building"])
rolePostedCol = Col("Days Posted", [14, 7, 21, 3, 10, 45, 5, 12, 2, 8, 18, 1])
pipelineSection = Card([pipelineHeader, pipelineChart], "sunk")
pipelineHeader = Heading("Candidates by Pipeline Stage", "h3")
pipelineChart = HorizontalBarChart(pipelineLabels, [pipelineSeries], "grouped", "Candidates", "Stage")
pipelineLabels = ["Applied", "Screen", "Technical", "Onsite", "Offer", "Hired"]
pipelineSeries = Series("Count", [89, 34, 18, 12, 5, 3])
deptSplitSection = Card([deptSplitHeader, deptSplitChart], "sunk")
deptSplitHeader = Heading("Headcount Split by Department", "h3")
deptSplitChart = PieChart(deptLabels, deptValues, "donut", "circular")
deptLabels = ["Engineering", "Sales", "Customer Success", "Marketing", "Design", "Data", "People", "Finance", "Operations"]
deptValues = [78, 34, 28, 19, 15, 12, 11, 8, 42]
interviewsSection = Card([interviewsHeader, interviewsList], "sunk")
interviewsHeader = Heading("Interviews Scheduled This Week", "h3")
interviewsList = ListBlock(interviewItems, "number")
interviewItems = [interview1, interview2, interview3, interview4, interview5, interview6]
interview1 = ListItem("Sarah Chen — Senior Frontend Engineer", "Technical interview • Tue 10:00 AM • Panel: J. Park, M. Rodriguez", null, "View details")
interview2 = ListItem("Marcus Johnson — Product Designer", "Portfolio review • Wed 2:00 PM • Panel: L. Kim, A. Foster", null, "View details")
interview3 = ListItem("Priya Patel — Backend Engineer", "System design • Thu 11:00 AM • Panel: D. Wong, K. Thompson", null, "View details")
interview4 = ListItem("James Wilson — DevOps Engineer", "Culture fit • Fri 9:00 AM • Panel: R. Gupta, S. Martinez", null, "View details")
interview5 = ListItem("Emily Davis — Sales Dev Rep", "Role play • Mon 3:00 PM • Panel: T. Brown, N. Anderson", null, "View details")
interview6 = ListItem("Robert Kim — Customer Success Mgr", "Case study • Wed 4:00 PM • Panel: H. Lee, C. Davis", null, "View details")
attritionSection = Card([attritionHeader, attritionChart], "sunk")
attritionHeader = Heading("Attrition — Past 6 Months", "h3")
attritionChart = LineChart(attritionLabels, [attritionVoluntary, attritionInvoluntary], "natural", "Month", "Employees")
attritionLabels = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"]
attritionVoluntary = Series("Voluntary", [3, 2, 4, 1, 3, 2])
attritionInvoluntary = Series("Involuntary", [1, 0, 1, 0, 1, 0])
newRoleAction = DialogBlock("Open New Role", "Create a new requisition", "Fill in the details below to post a new position", newRoleForm, "primary")
newRoleForm = Form("new-role", formButtons, [roleTitleField, roleDeptField, roleTypeField, roleLevelField, roleLocationField, roleDescriptionField])
roleTitleField = FormControl("Role Title", roleTitleInput, "e.g., Senior Frontend Engineer")
roleTitleInput = Input("role_title", "Enter role title", "text", ["required"])
roleDeptField = FormControl("Department", roleDeptSelect, "Select the hiring department")
roleDeptSelect = Select("department", deptSelectItems, "Choose department")
deptSelectItems = [deptEng, deptSales, deptCS, deptMktg, deptDesign, deptData, deptPeople, deptFinance, deptOps]
deptEng = SelectItem("engineering", "Engineering")
deptSales = SelectItem("sales", "Sales")
deptCS = SelectItem("customer_success", "Customer Success")
deptMktg = SelectItem("marketing", "Marketing")
deptDesign = SelectItem("design", "Design")
deptData = SelectItem("data", "Data")
deptPeople = SelectItem("people", "People")
deptFinance = SelectItem("finance", "Finance")
deptOps = SelectItem("operations", "Operations")
roleTypeField = FormControl("Employment Type", roleTypeRadio)
roleTypeRadio = RadioGroup("employment_type", [typeFull, typeContract, typeIntern], "full_time")
typeFull = RadioItem("Full-time", "Permanent employee with benefits", "full_time")
typeContract = RadioItem("Contract", "Fixed-term contractor", "contract")
typeIntern = RadioItem("Intern", "Internship program", "intern")
roleLevelField = FormControl("Seniority Level", roleLevelSelect)
roleLevelSelect = Select("seniority", levelSelectItems, "Choose level")
levelSelectItems = [levelJunior, levelMid, levelSenior, levelLead, levelManager, levelDirector]
levelJunior = SelectItem("junior", "Junior (0-2 years)")
levelMid = SelectItem("mid", "Mid-level (2-5 years)")
levelSenior = SelectItem("senior", "Senior (5-8 years)")
levelLead = SelectItem("lead", "Lead (8+ years)")
levelManager = SelectItem("manager", "Manager")
levelDirector = SelectItem("director", "Director")
roleLocationField = FormControl("Location", roleLocationSelect)
roleLocationSelect = Select("location", locationSelectItems, "Choose location")
locationSelectItems = [locSF, locNYC, locRemote, locLondon, locSingapore]
locSF = SelectItem("san_francisco", "San Francisco, CA")
locNYC = SelectItem("new_york", "New York, NY")
locRemote = SelectItem("remote", "Remote (US)")
locLondon = SelectItem("london", "London, UK")
locSingapore = SelectItem("singapore", "Singapore")
roleDescriptionField = FormControl("Job Description", roleDescriptionInput, "Key responsibilities, requirements, and nice-to-haves")
roleDescriptionInput = TextArea("description", "Describe the role...", 6, ["required"])
formButtons = Buttons([submitBtn, cancelBtn])
submitBtn = Button("Post Role", null, "primary")
cancelBtn = Button("Cancel", null, "tertiary")