root = Card([header, kpiSection, filterSection, ordersSection, volumeSection], "card", "column", "l")
header = CardHeader("Operations Desk", "Today's live overview")
kpiSection = Card([kpis], "sunk")
kpis = Table([kpiMetric, kpiValue])
kpiMetric = Col("Metric", ["Orders today", "Revenue today", "Average order value", "Refund rate (month)"])
kpiValue = Col("Value", ["127", "$8,462.50", "$66.63", "2.4%"])
filterSection = Card([filterForm], "sunk")
filterForm = Form("order-filters", filterButtons, [searchControl, statusControl])
searchControl = FormControl("Search customer", searchInput)
searchInput = Input("customer_search", "Search by customer name...")
statusControl = FormControl("Narrow by status", statusSelect)
statusSelect = Select("status_filter", [statusAll, statusPending, statusPaid, statusFulfilled, statusRefunded], "All statuses")
statusAll = SelectItem("all", "All statuses")
statusPending = SelectItem("pending", "Pending")
statusPaid = SelectItem("paid", "Paid")
statusFulfilled = SelectItem("fulfilled", "Fulfilled")
statusRefunded = SelectItem("refunded", "Refunded")
filterButtons = Buttons([applyBtn, resetBtn])
applyBtn = Button("Apply filters", null, "primary")
resetBtn = Button("Reset", null, "tertiary")
ordersSection = Card([ordersHeading, orders], "sunk")
ordersHeading = CardHeader("Recent orders", "Latest transactions across all channels")
orders = Table([orderIdCol, orderCustomerCol, orderTotalCol, orderStatusCol, orderActionCol])
orderIdCol = Col("Order ID", ["#10482", "#10481", "#10480", "#10479", "#10478"])
orderCustomerCol = Col("Customer", ["Maya Chen", "Liam Ortiz", "Priya Sharma", "Noah Becker", "Sofia Rossi"])
orderTotalCol = Col("Total", ["$124.00", "$78.50", "$215.90", "$89.99", "$164.20"])
orderStatusCol = Col("Status", ["Paid", "Pending", "Fulfilled", "Pending", "Paid"])
orderActionCol = Col("", ["Fulfill", "Fulfill", "—", "Fulfill", "Fulfill"], "action")
volumeSection = Card([volumeHeading, volumeChart], "sunk")
volumeHeading = CardHeader("Order volume", "Past four weeks")
volumeChart = BarChart(["Week 1", "Week 2", "Week 3", "Week 4"], [volumeSeries], "grouped", "Week", "Orders")
volumeSeries = Series("Orders", [820, 945, 1012, 1187])