root = Card([header, kpiTable, rolesHeading, rolesTable, pipelineHeading, pipelineChart, departmentHeading, deptPie, attritionHeading, attritionChart, interviewsHeading, interviewsTable, newRoleDialog], "card", "column", "l")
header = CardHeader("Hiring Overview", "Live snapshot for the People team")
kpiTable = Table([kpiMetric, kpiValue])
kpiMetric = Col("KPI", ["Current headcount", "Open roles", "Avg. time to hire", "Interviews this week"])
kpiValue = Col("Value", ["342", "12", "23 days", "18"])
rolesHeading = Heading("Open roles", "h2")
rolesTable = Table([roleCol, departmentCol, statusCol])
roleCol = Col("Role", ["Senior Frontend Engineer", "Product Manager", "Data Analyst", "HR Business Partner", "Sales Executive", "DevOps Engineer"])
departmentCol = Col("Department", ["Engineering", "Product", "Data", "People", "Sales", "Engineering"])
statusCol = Col("Status", ["Screening", "Interviewing", "Sourcing", "Offer", "Sourcing", "Interviewing"])
pipelineHeading = Heading("Candidates by pipeline stage", "h2")
pipelineChart = HorizontalBarChart(["Applied", "Screened", "Interview", "Offer", "Hired"], [pipelineSeries], "grouped", "Candidates", "Stage")
pipelineSeries = Series("Candidates", [120, 84, 46, 12, 5])
departmentHeading = Heading("Headcount by department", "h2")
deptPie = PieChart(["Engineering", "Product", "Sales", "Data", "People", "Finance"], [128, 52, 67, 38, 24, 33], "donut")
attritionHeading = Heading("Attrition — last 6 months", "h2")
attritionChart = LineChart(["Feb", "Mar", "Apr", "May", "Jun", "Jul"], [attritionSeries], "natural", "Month", "Monthly attrition rate (%)")
attritionSeries = Series("Attrition rate", [1.8, 1.2, 2.3, 1.5, 2.1, 0.9])
interviewsHeading = Heading("Upcoming interviews this week", "h2")
interviewsTable = Table([candidateCol, interviewRoleCol, timeCol])
candidateCol = Col("Candidate", ["Priya Sharma", "Liam O'Connor", "Sofia Reyes", "Noah Kim", "Emma Larsen"])
interviewRoleCol = Col("Role", ["Senior Frontend Engineer", "Product Manager", "Data Analyst", "DevOps Engineer", "Sales Executive"])
timeCol = Col("Time", ["Mon 10:00", "Mon 14:30", "Tue 09:00", "Wed 11:00", "Thu 15:00"])
newRoleDialog = DialogBlock("Open New Role", "Create an opening", "Post a new role to start hiring", [roleForm], "primary")
roleForm = Form("new-role", roleButtons, [roleTitleField, roleDepartmentField, roleLevelField, roleManagerField])
roleButtons = Buttons([postRoleBtn, cancelRoleBtn])
postRoleBtn = Button("Post role", null, "primary")
cancelRoleBtn = Button("Cancel", null, "tertiary")
roleTitleField = FormControl("Role title", roleTitleInput, "Give the role a clear title")
roleTitleInput = Input("role_title", "e.g. Senior UX Designer")
roleDepartmentField = FormControl("Department", roleDepartmentSelect)
roleDepartmentSelect = Select("role_department", [deptOptEng, deptOptProduct, deptOptSales, deptOptData, deptOptPeople], "Select a department")
deptOptEng = SelectItem("engineering", "Engineering")
deptOptProduct = SelectItem("product", "Product")
deptOptSales = SelectItem("sales", "Sales")
deptOptData = SelectItem("data", "Data")
deptOptPeople = SelectItem("people", "People")
roleLevelField = FormControl("Level", roleLevelRadio)
roleLevelRadio = RadioGroup("role_level", [levelIc, levelMgr], "ic")
levelIc = RadioItem("Individual contributor", "Ships as an individual", "ic")
levelMgr = RadioItem("Manager", "Leads a team", "mgr")
roleManagerField = FormControl("Hiring manager", roleManagerInput)
roleManagerInput = Input("hiring_manager", "e.g. Alex Chen")