root = Card([header, currentStatus, deliveryInfo, problemSection])
header = CardHeader("Delivery Tracking", "Track your package in real time")
currentStatus = Card([statusLabel, statusValue, locationLabel, locationValue], "sunk", "column", "m")
statusLabel = TextContent("Current Status", "small-heavy")
statusValue = TextContent("Out for Delivery", "large")
locationLabel = TextContent("Current Location", "small-heavy")
locationValue = TextContent("Distribution Center, Springfield — 2.3 miles away", "default")
deliveryInfo = Card([deliveryLabel, deliveryDate, deliveryWindow], "sunk", "column", "m")
deliveryLabel = TextContent("Estimated Delivery", "small-heavy")
deliveryDate = TextContent("Today, December 15, 2024", "large")
deliveryWindow = TextContent("Between 2:00 PM – 5:00 PM", "default")
problemSection = Card([problemLabel, problemBtn], "clear", "column", "m")
problemLabel = TextContent("Need help?", "small-heavy")
problemBtn = DialogBlock("Report a Problem", "Report Delivery Issue", "Describe the issue you're experiencing with this delivery.", [problemForm], "default")
problemForm = Form("delivery-issue", problemButtons, [issueTypeField, descriptionField, contactField])
issueTypeField = FormControl("Issue Type", issueTypeSelect, "Select the type of problem")
issueTypeSelect = Select("issue_type", issueTypeOptions, "Choose an issue type")
issueTypeOptions = [optLate, optDamaged, optMissing, optWrongAddress, optOther]
optLate = SelectItem("late", "Package is late")
optDamaged = SelectItem("damaged", "Package appears damaged")
optMissing = SelectItem("missing", "Package not delivered")
optWrongAddress = SelectItem("wrong_address", "Delivered to wrong address")
optOther = SelectItem("other", "Other issue")
descriptionField = FormControl("Description", descriptionInput, "Please provide details about the issue")
descriptionInput = TextArea("description", "Describe what happened...", 4)
contactField = FormControl("Contact Preference", contactRadio, "How should we reach you?")
contactRadio = RadioGroup("contact_method", [radioEmail, radioPhone, radioSms], "email")
radioEmail = RadioItem("Email", "We'll email you at your account address", "email")
radioPhone = RadioItem("Phone", "We'll call the number on file", "phone")
radioSms = RadioItem("SMS", "We'll send a text message", "sms")
problemButtons = Buttons([submitBtn, cancelBtn])
submitBtn = Button("Submit Report", null, "primary")
cancelBtn = Button("Cancel", null, "tertiary")