root = Card([header, stepsSection, caloriesSection, weeklyWorkoutsSection, logWorkoutTrigger])
header = CardHeader("Daily Summary", "Monday, January 15, 2024")
stepsSection = Card([stepsHeading, stepsProgress, stepsDetail], "sunk")
stepsHeading = Heading("Steps", "h3")
stepsProgress = Progress(7842, "7,842 / 10,000 steps")
stepsDetail = TextContent("You're 78% to your daily goal. Keep moving!")
caloriesSection = Card([caloriesHeading, caloriesValue, caloriesDetail], "sunk")
caloriesHeading = Heading("Calories Burned", "h3")
caloriesValue = TextContent("2,347 kcal", "large-heavy")
caloriesDetail = TextContent("Active: 487 kcal • Resting: 1,860 kcal", "small")
weeklyWorkoutsSection = Card([weeklyHeading, weeklyChart], "sunk")
weeklyHeading = Heading("Workouts This Week", "h3")
weeklyChart = BarChart(weeklyLabels, [workoutSeries], "grouped", "Day", "Minutes")
weeklyLabels = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
workoutSeries = Series("Workout Minutes", [45, 0, 60, 30, 50, 40, 35])
logWorkoutTrigger = DrawerBlock("Log Workout", "Add New Workout", "Record your exercise session", [logWorkoutForm])
logWorkoutForm = Form("log-workout", formButtons, [workoutTypeField, durationField, intensityField, notesField])
workoutTypeField = FormControl("Workout Type", workoutTypeSelect)
workoutTypeSelect = Select("workout_type", [typeRun, typeWalk, typeCycle, typeStrength, typeYoga, typeSwim, typeOther], "Select workout type")
typeRun = SelectItem("run", "Running")
typeWalk = SelectItem("walk", "Walking")
typeCycle = SelectItem("cycle", "Cycling")
typeStrength = SelectItem("strength", "Strength Training")
typeYoga = SelectItem("yoga", "Yoga")
typeSwim = SelectItem("swim", "Swimming")
typeOther = SelectItem("other", "Other")
durationField = FormControl("Duration (minutes)", durationInput, "How long was your workout?")
durationInput = Input("duration", "30", "number")
intensityField = FormControl("Intensity", intensityRadio)
intensityRadio = RadioGroup("intensity", [intensityLow, intensityModerate, intensityHigh], "moderate")
intensityLow = RadioItem("Low", "Light effort, can hold conversation", "low")
intensityModerate = RadioItem("Moderate", "Somewhat hard, breathing heavier", "moderate")
intensityHigh = RadioItem("High", "Vigorous effort, difficult to talk", "high")
notesField = FormControl("Notes (optional)", notesInput, "Any details you want to remember")
notesInput = TextArea("notes", "Felt great today!", 3)
formButtons = Buttons([saveBtn, cancelBtn])
saveBtn = Button("Save Workout", null, "primary")
cancelBtn = Button("Cancel", null, "tertiary")