root = Card([header, storeSwitcher, kpiSection, trafficSection, bestSellersSection, comparisonSection, promotionsSection, stockSection, shiftsSection, registersSection, reorderSection], "clear", "column", "l")
header = CardHeader("Daily Store Console", "Overview for Downtown Store")
storeSwitcher = Card([storeHeading, storeForm], "sunk")
storeHeading = Heading("Viewing: Downtown Store", "h3")
storeForm = Form("store-select", storeButtons, [storeField])
storeField = FormControl("Switch store", storeSelect)
storeSelect = Select("store", [store1, store2, store3], "Select a store")
store1 = SelectItem("downtown", "Downtown")
store2 = SelectItem("uptown", "Uptown")
store3 = SelectItem("mall", "Mall")
storeButtons = Buttons([storeGo])
storeGo = Button("View store")
kpiSection = Card([salesCard, basketCard, returnsCard], "sunk", "row", "m")
salesCard = Card([salesHeader, salesText, salesProgress], "card", "column", "xs")
salesHeader = CardHeader("Sales Today", "$7,820")
salesText = TextContent("Target: $10,000")
salesProgress = Progress(78, "78% of target")
basketCard = Card([basketHeader, basketValue], "card", "column", "xs")
basketHeader = CardHeader("Avg Basket", "$54.20")
basketValue = TextContent("+4% vs last week", "small")
returnsCard = Card([returnsHeader, returnsValue], "card", "column", "xs")
returnsHeader = CardHeader("Returns This Week", "12")
returnsValue = TextContent("Down 8% vs last week", "small")
trafficSection = Card([trafficHeader, trafficChart], "sunk")
trafficHeader = Heading("Foot Traffic Through the Day", "h3")
trafficChart = AreaChart(["8a", "10a", "12p", "2p", "4p", "6p", "8p"], [trafficSeries], "natural", "Time", "Visitors")
trafficSeries = Series("Visitors", [120, 210, 380, 320, 290, 410, 150])
bestSellersSection = Card([bestHeader, bestChart], "sunk")
bestHeader = Heading("Best Sellers Today", "h3")
bestChart = HorizontalBarChart(["Espresso", "Latte", "Cold Brew", "Tea", "Croissant"], [unitsSeries])
unitsSeries = Series("Units", [96, 82, 65, 54, 41])
comparisonSection = Card([comparisonHeader, comparisonChart], "sunk")
comparisonHeader = Heading("This Week vs Last Week", "h3")
comparisonChart = BarChart(["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], [thisWeekSeries, lastWeekSeries], "grouped", "Day", "Revenue")
thisWeekSeries = Series("This Week", [1120, 980, 1340, 1210, 1560, 1890, 1450])
lastWeekSeries = Series("Last Week", [1050, 1120, 1180, 1090, 1420, 1730, 1390])
promotionsSection = Card([promoHeader, promoRow], "sunk")
promoHeader = Heading("Running Promotions", "h3")
promoRow = Card([promoBogo, promoApparel, promoShipping], "clear", "row", "m")
promoBogo = Card([bogoHeader, bogoText, bogoProgress], "card", "column", "xs")
bogoHeader = CardHeader("Buy 1 Get 1", "$1,240")
bogoText = TextContent("Goal: $1,500")
bogoProgress = Progress(83, "83%")
promoApparel = Card([apparelHeader, apparelText, apparelProgress], "card", "column", "xs")
apparelHeader = CardHeader("20% Off Apparel", "$890")
apparelText = TextContent("Goal: $1,000")
apparelProgress = Progress(89, "89%")
promoShipping = Card([shippingHeader, shippingText, shippingProgress], "card", "column", "xs")
shippingHeader = CardHeader("Free Shipping", "$430")
shippingText = TextContent("Goal: $500")
shippingProgress = Progress(86, "86%")
stockSection = Card([stockHeader, stockList], "sunk")
stockHeader = Heading("Items Out of Stock", "h3")
stockList = ListBlock([stockItem1, stockItem2, stockItem3, stockItem4])
stockItem1 = ListItem("Oat Milk", "SKU 1042 · Out of stock", null, "Reorder")
stockItem2 = ListItem("Cold Brew Concentrate", "SKU 1087 · Out of stock", null, "Reorder")
stockItem3 = ListItem("Almond Croissant", "SKU 1103 · Out of stock", null, "Reorder")
stockItem4 = ListItem("Lid Size L", "SKU 1155 · Out of stock", null, "Reorder")
shiftsSection = Card([shiftsHeader, shiftsList], "sunk")
shiftsHeader = Heading("On Shift Today", "h3")
shiftsList = ListBlock([shift1, shift2, shift3, shift4], "image")
shift1 = ListItem("Maya Rodriguez", "8:00 AM – 4:00 PM", ["https://picsum.photos/seed/maya/100/100"])
shift2 = ListItem("James Chen", "8:00 AM – 4:00 PM", ["https://picsum.photos/seed/james/100/100"])
shift3 = ListItem("Priya Patel", "10:00 AM – 6:00 PM", ["https://picsum.photos/seed/priya/100/100"])
shift4 = ListItem("Sam Walker", "12:00 PM – 8:00 PM", ["https://picsum.photos/seed/sam/100/100"])
registersSection = Card([registersHeader, registersTable], "sunk")
registersHeader = Heading("Registers", "h3")
registersTable = Table([registerCol, statusCol, cashierCol])
registerCol = Col("Register", ["1", "2", "3", "4"])
statusCol = Col("Status", ["Open", "Open", "Closed", "Open"])
cashierCol = Col("Cashier", ["Maya", "James", "—", "Priya"])
reorderSection = Card([reorderHeader, reorderForm], "sunk")
reorderHeader = Heading("Reorder an Item", "h3")
reorderForm = Form("reorder", reorderButtons, [reorderItemField, reorderQtyField])
reorderItemField = FormControl("Item", reorderItemSelect)
reorderItemSelect = Select("reorder_item", [itemOat, itemColdBrew, itemAlmond], "Select an item")
itemOat = SelectItem("oat", "Oat Milk")
itemColdBrew = SelectItem("coldbrew", "Cold Brew Concentrate")
itemAlmond = SelectItem("almond", "Almond Croissant")
reorderQtyField = FormControl("Quantity", reorderQtyInput)
reorderQtyInput = Input("quantity", "10", "number")
reorderButtons = Buttons([reorderSubmit])
reorderSubmit = Button("Reorder item", null, "primary")