root = Card([header, stepsSection, statsSection, weeklySection, logSection, followUps], "card", "column", "l")
header = CardHeader("Good morning, Alex", "Tuesday, June 11 — your daily fitness summary")
stepsSection = Card([stepsHeader, stepsProgress, stepsMeta], "sunk", "column", "s")
stepsHeader = Heading("Steps today", "h3")
stepsProgress = Progress(82, "8,204 of 10,000 steps")
stepsMeta = TextContent("On pace to reach your goal by **7:40 pm**.", "small")
statsSection = Card([statsHeading, statsTable], "sunk", "column", "s")
statsHeading = Heading("Activity snapshot", "h3")
statsTable = Table([statMetric, statValue])
statMetric = Col("Metric", ["Calories burned", "Active minutes", "Distance"])
statValue = Col("Value", ["486 kcal", "52 min", "6.2 km"])
weeklySection = Card([weeklyHeading, weeklyNote, weeklyChart], "sunk", "column", "s")
weeklyHeading = Heading("Workouts this week", "h3")
weeklyNote = TextContent("5 workouts logged — **18%** more than last week.", "small")
weeklyChart = BarChart(["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], [weeklySeries], "grouped", "Day", "Minutes")
weeklySeries = Series("Active minutes", [45, 30, 65, 0, 52, 80, 90])
logSection = Card([logHeading, logForm], "sunk", "column", "s")
logHeading = Heading("Log a new workout", "h3")
logForm = Form("log-workout", logButtons, [typeField, durationField, intensityField])
typeField = FormControl("Workout type", typeSelect)
typeSelect = Select("workout_type", [typeRun, typeCycle, typeStrength, typeYoga], "Choose a workout")
typeRun = SelectItem("running", "Running")
typeCycle = SelectItem("cycling", "Cycling")
typeStrength = SelectItem("strength", "Strength training")
typeYoga = SelectItem("yoga", "Yoga")
durationField = FormControl("Duration", durationInput, "In minutes")
durationInput = Input("duration", "e.g. 30", "number")
intensityField = FormControl("How hard was it?", intensitySlider)
intensitySlider = Slider("intensity", "discrete", 1, 10, 1, [5])
logButtons = Buttons([saveBtn])
saveBtn = Button("Log workout", null, "primary")
followUps = FollowUpBlock([fuWeekly, fuCalories, fuChallenge])
fuWeekly = FollowUpItem("Show my full weekly report")
fuCalories = FollowUpItem("How many calories this week?")
fuChallenge = FollowUpItem("Suggest a workout for tomorrow")