root = Card([header, stepsSection, caloriesSection, weeklyWorkoutsSection, logWorkoutTrigger])
header = CardHeader("Daily Summary", "Monday, January 15, 2024")
stepsSection = Card([stepsTitle, stepsProgress, stepsDetail], "sunk", "column", "m")
stepsTitle = Heading("Steps", "h3")
stepsProgress = Progress(85, "8,500 / 10,000 steps")
stepsDetail = TextContent("You're 1,500 steps away from your goal. Keep moving!", "small")
caloriesSection = Card([caloriesTitle, caloriesValue, caloriesBreakdown], "sunk", "column", "m")
caloriesTitle = Heading("Calories Burned", "h3")
caloriesValue = TextContent("2,340 kcal", "large-heavy")
caloriesBreakdown = TextContent("Active: 420 kcal  •  Resting: 1,920 kcal", "small")
weeklyWorkoutsSection = Card([weeklyTitle, weeklyChart], "sunk", "column", "m")
weeklyTitle = Heading("Workouts This Week", "h3")
weeklyChart = BarChart(weeklyLabels, [weeklySeries], "grouped", "Day", "Minutes")
weeklyLabels = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
weeklySeries = Series("Workout Minutes", [45, 0, 60, 30, 45, 0, 50])
logWorkoutTrigger = DialogBlock("Log Workout", "Log New Workout", "Record your exercise session", [workoutForm], "primary")
workoutForm = Form("log-workout", formButtons, [typeField, durationField, intensityField, notesField])
typeField = FormControl("Workout Type", typeSelect, "Select the type of exercise")
typeSelect = Select("workout_type", typeOptions, "Choose workout type")
typeOptions = [typeRun, typeWalk, typeCycle, typeStrength, typeYoga, typeSwim, typeOther]
typeRun = SelectItem("running", "Running")
typeWalk = SelectItem("walking", "Walking")
typeCycle = SelectItem("cycling", "Cycling")
typeStrength = SelectItem("strength", "Strength Training")
typeYoga = SelectItem("yoga", "Yoga")
typeSwim = SelectItem("swimming", "Swimming")
typeOther = SelectItem("other", "Other")
durationField = FormControl("Duration (minutes)", durationInput, "How long did you exercise?")
durationInput = Input("duration", "30", "number")
intensityField = FormControl("Intensity", intensityRadio, "How intense was the workout?")
intensityRadio = RadioGroup("intensity", intensityOptions, "moderate")
intensityOptions = [intensityLow, intensityModerate, intensityHigh]
intensityLow = RadioItem("Low", "Light effort, can hold conversation", "low")
intensityModerate = RadioItem("Moderate", "Breathing harder, can talk in short sentences", "moderate")
intensityHigh = RadioItem("High", "Vigorous effort, difficult to talk", "high")
notesField = FormControl("Notes (optional)", notesInput, "Any additional details")
notesInput = TextArea("notes", "Felt great today!", 3)
formButtons = Buttons([submitBtn, cancelBtn])
submitBtn = Button("Save Workout", null, "primary")
cancelBtn = Button("Cancel", null, "tertiary")