root = Card([header, currentSection, deliverySection, problemSection])
header = CardHeader("Delivery Tracking", "Order #28374 • Ground shipping")
currentSection = Card([statusHeading, statusText, progressSteps], "sunk")
statusHeading = Heading("Where your package is now", "h2")
statusText = Callout("info", "Out for delivery", "Your package left the Grand Rapids, MI sorting facility and is on the truck for final delivery.")
progressSteps = Steps([step1, step2, step3, step4])
step1 = StepsItem("Order confirmed", "We received your order on March 24.")
step2 = StepsItem("Shipped", "Package departed the Harrisburg, PA warehouse.")
step3 = StepsItem("In transit", "Arrived at the Grand Rapids, MI sorting center.")
step4 = StepsItem("Out for delivery", "On the truck now — arriving today.")
deliverySection = Card([deliveryHeading, deliveryInfo, deliveryTag], "sunk")
deliveryHeading = Heading("Estimated delivery", "h2")
deliveryInfo = TextContent("**Thursday, March 27** between **3:00 PM and 5:00 PM**", "large")
deliveryTag = Tag("On track", null, null, "success")
problemSection = Card([problemHeading, problemHelp, reportButton], "sunk")
problemHeading = Heading("Report a problem", "h2")
problemHelp = TextContent("Something wrong with this delivery? Tell us and we'll make it right.")
reportButton = DialogBlock("Report a problem", "Report a delivery problem", "Select the issue and give us a few details.", [issueForm], "outline")
issueForm = Form("delivery-issue", formButtons, [issueTypeControl, detailControl, contactControl])
issueTypeControl = FormControl("Issue type", issueTypeSelect)
issueTypeSelect = Select("issue_type", [issueLost, issueDamaged, issueLate, issueOther], "Select the issue")
issueLost = SelectItem("lost", "Package marked delivered but not received")
issueDamaged = SelectItem("damaged", "Package arrived damaged")
issueLate = SelectItem("late", "Delayed / running late")
issueOther = SelectItem("other", "Something else")
detailControl = FormControl("Details", detailArea)
detailArea = TextArea("details", "Describe what happened...", 4)
contactControl = FormControl("Contact email", contactInput, "We'll follow up at this address")
contactInput = Input("email", "you@example.com", "email")
formButtons = Buttons([submitBtn, cancelBtn])
submitBtn = Button("Submit report", null, "primary")
cancelBtn = Button("Cancel", null, "tertiary")