export let widget_card = (b) => {
let w = attr_or(b, "width", 300)
let h = attr_or(b, "height", 200)
let title = attr_or(b, "title", "")
let surface_fill = attr_or(b, "surface_fill", "var(--color-bg)")
let border_stroke = attr_or(b, "border_stroke", "var(--color-nav-border)")
let title_fill = attr_or(b, "title_fill", "currentColor")
let separator_stroke = attr_or(b, "separator_stroke", border_stroke)
let radius = attr_or(b, "radius", 8)
let border_width = attr_or(b, "border_width", 1.5)
let frame = [{ kind = "rect", x = 0, y = 0, width = w, height = h, rx = radius,
fill = surface_fill, stroke = border_stroke, stroke_width = border_width }]
let header = title != "" ? [
{ kind = "text", x = 12, y = 6, width = w - 24, height = 20,
content = title, font_size = 14, anchor = "start", fill = title_fill },
{ kind = "line", x1 = 0, y1 = 30, x2 = w, y2 = 30,
stroke = separator_stroke, stroke_width = 1 }
] : []
concat(frame, header)
}