export let widget_window = (b) => {
let w = attr_or(b, "width", 360)
let h = attr_or(b, "height", 240)
let title = attr_or(b, "title", "Window")
let surface_fill = attr_or(b, "surface_fill", "var(--color-bg)")
let border_stroke = attr_or(b, "border_stroke", "var(--color-nav-border)")
let border_width = attr_or(b, "border_width", 2)
let chrome_fill = attr_or(b, "chrome_fill", "var(--color-nav-bg)")
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)
[
{ kind = "rect", x = 0, y = 0, width = w, height = h, rx = radius,
fill = surface_fill, stroke = border_stroke, stroke_width = border_width },
{ kind = "rect", x = 0, y = 0, width = w, height = 36, rx = radius,
fill = chrome_fill },
{ kind = "rect", x = 0, y = 28, width = w, height = 10, fill = chrome_fill },
{ kind = "circle", x = 14, y = 12, r = 6, fill = attr_or(b, "close_fill", "#ff5f56") },
{ kind = "circle", x = 34, y = 12, r = 6, fill = attr_or(b, "minimize_fill", "#ffbd2e") },
{ kind = "circle", x = 54, y = 12, r = 6, fill = attr_or(b, "maximize_fill", "#27c93f") },
{ kind = "text", x = 76, y = 0, width = w - 96, height = 36,
content = title, font_size = 13, anchor = "start", fill = title_fill },
{ kind = "line", x1 = 0, y1 = 36, x2 = w, y2 = 36,
stroke = separator_stroke, stroke_width = 1 }
]
}