root = Card([header, tabs, readershipSection, scheduleForm, newDraftBtn], "card", "column", "l")
header = CardHeader("Editor's Content Studio", "Manage drafts, publishing, and readership")
tabs = Tabs([overviewTab, draftsTab, scheduleTab, commentsTab])
overviewTab = TabItem("overview", "Overview", [overviewContent])
overviewContent = Card([overviewHeading, publishedSection, mostReadSection], "sunk", "column", "m")
overviewHeading = Heading("Overview", "h2")
publishedSection = Card([publishedHeading, publishedTable], "clear", "column", "s")
publishedHeading = Heading("Published this week", "h3")
publishedTable = Table([pubTitle, pubCategory, pubViews])
pubTitle = Col("Title", ["The Future of AI Writing", "Editorial Workflows in 2025", "How We Edit at Scale", "A Guide to Content Strategy", "The Rise of Long-form", "Metrics That Matter"])
pubCategory = Col("Category", ["Technology", "Process", "Strategy", "Strategy", "Writing", "Analytics"])
pubViews = Col("Views", [4820, 3910, 3560, 2980, 2450, 1870])
mostReadSection = Card([mostReadHeading, mostReadCallout], "clear", "column", "s")
mostReadHeading = Heading("Most-read article this month", "h3")
mostReadCallout = Callout("success", "The Future of AI Writing", "8,420 reads this month — our top performer across all categories.")
readershipSection = Card([readershipHeading, readershipChart], "sunk", "column", "m")
readershipHeading = Heading("Readership over the past 30 days", "h3")
readershipChart = AreaChart(["1", "3", "5", "7", "9", "11", "13", "15", "17", "19", "21", "23", "25", "27", "29"], [readershipSeries], "natural", "Day", "Readers")
readershipSeries = Series("Readers", [1200, 1450, 1320, 1680, 1540, 1890, 1720, 2100, 1950, 2280, 2140, 2560, 2380, 2740, 2600])
draftsTab = TabItem("drafts", "Drafts", [draftsContent])
draftsContent = Card([draftsHeading, categoryFilter, draftsTable], "sunk", "column", "m")
draftsHeading = Heading("Drafts", "h2")
categoryFilter = Form("category-filter", filterButtons, [categoryField])
categoryField = FormControl("Narrow by category", categorySelect)
categorySelect = Select("category", [catAll, catTech, catProcess, catStrategy, catWriting, catAnalytics], "Select a category")
catAll = SelectItem("all", "All categories")
catTech = SelectItem("technology", "Technology")
catProcess = SelectItem("process", "Process")
catStrategy = SelectItem("strategy", "Strategy")
catWriting = SelectItem("writing", "Writing")
catAnalytics = SelectItem("analytics", "Analytics")
filterButtons = Buttons([applyFilterBtn])
applyFilterBtn = Button("Apply filter", null, "secondary")
draftsTable = Table([draftTitle, draftCategory, draftStatus])
draftTitle = Col("Title", ["Draft: The AI Editing Boom", "Draft: SEO in 2025", "Draft: Building a Content Team", "Draft: The Psychology of Headlines", "Draft: Data-Driven Storytelling"])
draftCategory = Col("Category", ["Technology", "Strategy", "Process", "Writing", "Analytics"])
draftStatus = Col("Status", ["In review", "Needs edit", "Ready to publish", "In review", "Needs edit"])
scheduleTab = TabItem("schedule", "Schedule", [scheduleContent])
scheduleContent = Card([scheduleHeading, scheduleForm], "sunk", "column", "m")
scheduleHeading = Heading("Schedule a piece", "h2")
scheduleForm = Form("schedule-piece", scheduleButtons, [scheduleTitleField, scheduleDateField])
scheduleTitleField = FormControl("Title", scheduleTitleInput)
scheduleTitleInput = Input("title", "Enter the piece title", "text")
scheduleDateField = FormControl("Publish date", scheduleDateInput)
scheduleDateInput = DatePicker("publish_date", "single")
scheduleButtons = Buttons([scheduleBtn])
scheduleBtn = Button("Schedule piece", null, "primary")
commentsTab = TabItem("comments", "Comments", [commentsContent])
commentsContent = Card([commentsHeading, commentsList], "sunk", "column", "m")
commentsHeading = Heading("Comments awaiting reply", "h2")
commentsList = ListBlock([comment1, comment2, comment3, comment4])
comment1 = ListItem("Maria on The Future of AI Writing", "“Great piece — how do you handle editing AI drafts?”")
comment2 = ListItem("Daniel on Editorial Workflows in 2025", "“Could you share your approval process?”")
comment3 = ListItem("Priya on A Guide to Content Strategy", "“Loved the case studies, more please!”")
comment4 = ListItem("Tom on Metrics That Matter", "“What metrics do you track weekly?”")
newDraftBtn = Button("Start a new draft", null, "primary")