root = Card([header, stepsSection, caloriesSection, weeklyWorkoutsSection, logWorkoutTrigger], "card", "column", "l")
header = CardHeader("Daily Summary", "Monday, January 15, 2025")
stepsSection = Card([stepsLabel, stepsProgress, stepsDetail], "sunk", "column", "m")
stepsLabel = Heading("Steps Today", "h3")
stepsProgress = Progress(7842, "7,842 / 10,000 steps")
stepsDetail = TextContent("You're 78% to your daily goal. Keep moving!", "small")
caloriesSection = Card([caloriesLabel, caloriesValue, caloriesDetail], "sunk", "column", "m")
caloriesLabel = Heading("Calories Burned", "h3")
caloriesValue = TextContent("2,347 kcal", "large-heavy")
caloriesDetail = TextContent("Active: 642 kcal • Resting: 1,705 kcal", "small")
weeklyWorkoutsSection = Card([weeklyLabel, weeklyChart], "sunk", "column", "m")
weeklyLabel = Heading("Workouts This Week", "h3")
weeklyChart = BarChart(weeklyLabels, [workoutSeries], "grouped", "Day", "Minutes")
weeklyLabels = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
workoutSeries = Series("Minutes", [45, 0, 60, 30, 50, 40, 0])
logWorkoutTrigger = DrawerBlock("Log Workout", "Add a Workout", "Record your activity", logWorkoutForm, "primary")
logWorkoutForm = Form("log-workout", logWorkoutButtons, [workoutTypeField, durationField, intensityField, notesField])
workoutTypeField = FormControl("Workout Type", workoutTypeSelect, "Select the type of exercise")
workoutTypeSelect = Select("workout_type", workoutTypeOptions, "Choose workout type")
workoutTypeOptions = [typeRun, typeWalk, typeCycle, typeSwim, typeStrength, typeYoga, typeOther]
typeRun = SelectItem("run", "Running")
typeWalk = SelectItem("walk", "Walking")
typeCycle = SelectItem("cycle", "Cycling")
typeSwim = SelectItem("swim", "Swimming")
typeStrength = SelectItem("strength", "Strength Training")
typeYoga = SelectItem("yoga", "Yoga")
typeOther = SelectItem("other", "Other")
durationField = FormControl("Duration (minutes)", durationInput, "How long did you exercise?")
durationInput = Input("duration", "30", "number")
intensityField = FormControl("Intensity", intensityRadio, "How hard did you push?")
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)
logWorkoutButtons = Buttons([logSaveBtn, logCancelBtn], "row")
logSaveBtn = Button("Save Workout", null, "primary")
logCancelBtn = Button("Cancel", null, "tertiary")