root = Card([header, goalsSection, workoutSection, logSection])
header = CardHeader("Daily Summary", "Your fitness snapshot for today")
goalsSection = Card([goalsTitle, stepsProgress, calorieStats], "sunk")
goalsTitle = Heading("Today's Activity", "h3")
stepsProgress = Progress(7821, "Steps: 7,821 of 10,000")
calorieStats = Table([calorieMetric, calorieValue])
calorieMetric = Col("Metric", ["Calories burned", "Active minutes", "Distance"])
calorieValue = Col("Value", ["1,284 kcal", "42 min", "5.3 km"])
workoutSection = Card([workoutTitle, workoutChart, workoutTrend], "sunk")
workoutTitle = Heading("Workouts This Week", "h3")
workoutChart = BarChart(["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], [workoutSeries], "grouped", "Day", "Minutes")
workoutSeries = Series("Workout minutes", [30, 45, 20, 60, 50, 75, 40])
workoutTrend = TextContent("You trained **5 days** this week, averaging **46 minutes** per session. Keep it up!", "small")
logSection = Card([logTitle, logForm])
logTitle = Heading("Log a New Workout", "h3")
logForm = Form("log-workout", logButtons, [workoutTypeField, durationField, intensityField])
workoutTypeField = FormControl("Workout type", workoutTypeSelect)
workoutTypeSelect = Select("workout_type", [typeRun, typeCycle, typeStrength, typeYoga], "Select type")
typeRun = SelectItem("run", "Running")
typeCycle = SelectItem("cycle", "Cycling")
typeStrength = SelectItem("strength", "Strength training")
typeYoga = SelectItem("yoga", "Yoga")
durationField = FormControl("Duration (minutes)", durationInput)
durationInput = Input("duration", "e.g. 30", "number")
intensityField = FormControl("Intensity", intensityRadio)
intensityRadio = RadioGroup("intensity", [intensityLow, intensityModerate, intensityHigh], "moderate")
intensityLow = RadioItem("Low", "Easy pace", "low")
intensityModerate = RadioItem("Moderate", "Steady effort", "moderate")
intensityHigh = RadioItem("High", "All out", "high")
logButtons = Buttons([logSubmit, logCancel])
logSubmit = Button("Log workout", null, "primary")
logCancel = Button("Cancel", null, "tertiary")