root = Card([header, thresholdBanner, searchForm, itemsHeader, itemsGrid, followUps])
header = CardHeader("Low Inventory Alert", "12 items below reorder threshold — action required")
thresholdBanner = Callout("warning", "Reorder Threshold", "Items with 10 or fewer units remaining trigger this warning. Threshold is configurable per category in Settings → Inventory Rules.")
searchForm = Form("inventory-search", searchButtons, [searchField])
searchButtons = Buttons([searchBtn], "row")
searchBtn = Button("Search", { type: "continue_conversation", context: "Filter low-inventory list by search term" }, "primary")
searchField = FormControl("Search Items", searchInput, "Type product name, SKU, or category")
searchInput = Input("search-term", "Search low-stock items...", "text")
itemsHeader = InlineHeader("Items Running Low", "Each card shows current stock vs. threshold. Tap Reorder to create a PO.")
itemsGrid = CompositeCardBlock([item1, item2, item3, item4, item5, item6], "grid", true)
item1 = CompositeCardItem("sku-1001", item1Header, [item1Body, item1Metrics], { button: item1Btn })
item1Header = IconText(item1Icon, "warning", "m", "Organic Almond Milk 1L", "SKU: ALM-1001 · Dairy Alternatives", false, "horizontal")
item1Icon = Icon("package", "shopping")
item1Body = Text("text", "Supplier: Califia Farms · Lead time: 3 days", "Last restocked: 2026-01-15")
item1Metrics = EntityList([item1m1, item1m2, item1m3], "small")
item1m1 = { left: "Current Stock", right: "7 units", rightVariant: "number" }
item1m2 = { left: "Threshold", right: "10 units", rightVariant: "number" }
item1m3 = { left: "Avg. Daily Sales", right: "2.4 units", rightVariant: "number" }
item1Btn = Button("Reorder (50 units)", { type: "continue_conversation", context: "Create purchase order for Organic Almond Milk 1L (SKU: ALM-1001), 50 units" }, "primary")
item2 = CompositeCardItem("sku-2003", item2Header, [item2Body, item2Metrics], { button: item2Btn })
item2Header = IconText(item2Icon, "warning", "m", "Artisan Sourdough Loaf", "SKU: BRD-2003 · Bakery", false, "horizontal")
item2Icon = Icon("package", "shopping")
item2Body = Text("text", "Supplier: Local Bakery Co. · Lead time: 1 day", "Last restocked: 2026-01-19")
item2Metrics = EntityList([item2m1, item2m2, item2m3], "small")
item2m1 = { left: "Current Stock", right: "4 units", rightVariant: "number" }
item2m2 = { left: "Threshold", right: "10 units", rightVariant: "number" }
item2m3 = { left: "Avg. Daily Sales", right: "6.2 units", rightVariant: "number" }
item2Btn = Button("Reorder (30 units)", { type: "continue_conversation", context: "Create purchase order for Artisan Sourdough Loaf (SKU: BRD-2003), 30 units" }, "primary")
item3 = CompositeCardItem("sku-3045", item3Header, [item3Body, item3Metrics], { button: item3Btn })
item3Header = IconText(item3Icon, "danger", "m", "Cold-Press Juice Cleanse 3-Day", "SKU: JUI-3045 · Beverages", false, "horizontal")
item3Icon = Icon("alert-triangle", "alerts")
item3Body = Text("text", "Supplier: Pressed Juicery · Lead time: 5 days", "Last restocked: 2026-01-10")
item3Metrics = EntityList([item3m1, item3m2, item3m3], "small")
item3m1 = { left: "Current Stock", right: "2 units", rightVariant: "number" }
item3m2 = { left: "Threshold", right: "10 units", rightVariant: "number" }
item3m3 = { left: "Avg. Daily Sales", right: "1.8 units", rightVariant: "number" }
item3Btn = Button("Reorder (25 units)", { type: "continue_conversation", context: "Create purchase order for Cold-Press Juice Cleanse 3-Day (SKU: JUI-3045), 25 units" }, "primary")
item4 = CompositeCardItem("sku-4112", item4Header, [item4Body, item4Metrics], { button: item4Btn })
item4Header = IconText(item4Icon, "warning", "m", "Plant-Based Burger Patties 8pk", "SKU: PLT-4112 · Frozen", false, "horizontal")
item4Icon = Icon("package", "shopping")
item4Body = Text("text", "Supplier: Beyond Meat · Lead time: 7 days", "Last restocked: 2026-01-08")
item4Metrics = EntityList([item4m1, item4m2, item4m3], "small")
item4m1 = { left: "Current Stock", right: "6 units", rightVariant: "number" }
item4m2 = { left: "Threshold", right: "10 units", rightVariant: "number" }
item4m3 = { left: "Avg. Daily Sales", right: "1.5 units", rightVariant: "number" }
item4Btn = Button("Reorder (40 units)", { type: "continue_conversation", context: "Create purchase order for Plant-Based Burger Patties 8pk (SKU: PLT-4112), 40 units" }, "primary")
item5 = CompositeCardItem("sku-5008", item5Header, [item5Body, item5Metrics], { button: item5Btn })
item5Header = IconText(item5Icon, "warning", "m", "Greek Yogurt Plain 32oz", "SKU: DAI-5008 · Dairy", false, "horizontal")
item5Icon = Icon("package", "shopping")
item5Body = Text("text", "Supplier: Fage · Lead time: 2 days", "Last restocked: 2026-01-17")
item5Metrics = EntityList([item5m1, item5m2, item5m3], "small")
item5m1 = { left: "Current Stock", right: "8 units", rightVariant: "number" }
item5m2 = { left: "Threshold", right: "10 units", rightVariant: "number" }
item5m3 = { left: "Avg. Daily Sales", right: "3.1 units", rightVariant: "number" }
item5Btn = Button("Reorder (60 units)", { type: "continue_conversation", context: "Create purchase order for Greek Yogurt Plain 32oz (SKU: DAI-5008), 60 units" }, "primary")
item6 = CompositeCardItem("sku-6021", item6Header, [item6Body, item6Metrics], { button: item6Btn })
item6Header = IconText(item6Icon, "danger", "m", "Gluten-Free Granola 12oz", "SKU: GRN-6021 · Pantry", false, "horizontal")
item6Icon = Icon("alert-triangle", "alerts")
item6Body = Text("text", "Supplier: Purely Elizabeth · Lead time: 4 days", "Last restocked: 2026-01-12")
item6Metrics = EntityList([item6m1, item6m2, item6m3], "small")
item6m1 = { left: "Current Stock", right: "3 units", rightVariant: "number" }
item6m2 = { left: "Threshold", right: "10 units", rightVariant: "number" }
item6m3 = { left: "Avg. Daily Sales", right: "2.7 units", rightVariant: "number" }
item6Btn = Button("Reorder (35 units)", { type: "continue_conversation", context: "Create purchase order for Gluten-Free Granola 12oz (SKU: GRN-6021), 35 units" }, "primary")
followUps = FollowUpBlock([fu1, fu2, fu3])
fu1 = FollowUpItem("Show all inventory levels")
fu2 = FollowUpItem("Adjust reorder thresholds by category")
fu3 = FollowUpItem("View supplier lead time report")