root = Card([header, stepsHeading, stepsProgress, stepsTags, caloriesHeading, caloriesText, sep1, weekHeading, weekChart, weekTags, sep2, logHeading, logForm])
header = CardHeader("Today's Summary", "Fitness app — your daily overview")
stepsHeading = Heading("Today's Steps", "h2")
stepsProgress = Progress(84, "8,432 of 10,000 steps")
stepsTags = TagBlock(["84% of goal", "On track"])
caloriesHeading = Heading("Calories Burned", "h2")
caloriesText = TextContent("512 kcal", "large-heavy")
sep1 = Separator("horizontal", false)
weekHeading = Heading("Workouts This Week", "h2")
weekChart = BarChart(["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], [workoutSeries], "grouped", "Day", "Minutes")
workoutSeries = Series("Workout minutes", [35, 0, 50, 42, 0, 60, 55])
weekTags = TagBlock(["4 workouts", "242 active minutes"])
sep2 = Separator("horizontal", false)
logHeading = Heading("Log a New Workout", "h2")
logForm = Form("workout-log", logButtons, [typeField, durationField, intensityField, notesField])
typeField = FormControl("Workout type", typeSelect)
typeSelect = Select("workout_type", [runItem, cycleItem, strengthItem, yogaItem], "Select workout type")
runItem = SelectItem("running", "Running")
cycleItem = SelectItem("cycling", "Cycling")
strengthItem = SelectItem("strength", "Strength training")
yogaItem = SelectItem("yoga", "Yoga")
durationField = FormControl("Duration (minutes)", durationInput, "Enter the workout length")
durationInput = Input("duration", "e.g. 45", "number")
intensityField = FormControl("Intensity", intensityRadio)
intensityRadio = RadioGroup("intensity", [lowItem, medItem, highItem], "medium")
lowItem = RadioItem("Low", "Easy effort, conversational pace", "low")
medItem = RadioItem("Medium", "Moderate effort, steady pace", "medium")
highItem = RadioItem("High", "Maximum effort, all-out", "high")
notesField = FormControl("Notes", notesArea, "Optional — how did it feel?")
notesArea = TextArea("notes", "How did it feel?", 3)
logButtons = Buttons([saveBtn, clearBtn])
saveBtn = Button("Log Workout", null, "primary")
clearBtn = Button("Clear", null, "tertiary")