From 00121874a7445d085178770798d6713f5a6b3709 Mon Sep 17 00:00:00 2001 From: Priec Date: Mon, 3 Aug 2026 17:25:12 +0200 Subject: [PATCH] penguinui --- web/src/lib.rs | 14 +- web/src/pages/add_table/ui.rs | 37 +++ web/src/ui/mod.rs | 24 +- web/static/app.css | 293 +++++++++++---------- web/templates/pages/add_table/builder.html | 8 + web/templates/ui/alert.html | 40 ++- web/templates/ui/alert_fragment.html | 13 +- web/templates/ui/base.html | 49 ++++ web/templates/ui/dialog.html | 54 ++++ 9 files changed, 383 insertions(+), 149 deletions(-) create mode 100644 web/templates/ui/dialog.html diff --git a/web/src/lib.rs b/web/src/lib.rs index 6e06841d..978cef6c 100644 --- a/web/src/lib.rs +++ b/web/src/lib.rs @@ -207,10 +207,20 @@ mod tests { body.contains("href=\"/static/app.css\""), "{path} is missing the shared stylesheet" ); - assert!( - !body.contains(" + + + {# + Penguin UI (https://www.penguinui.com) is Tailwind + Alpine, and its + components are what this app uses for anything the user has to be told: + ui/alert.html and ui/dialog.html. The focus plugin is what x-trap in the + dialog needs, and it has to load before Alpine itself. + #} + + + + + + {% block head %}{% endblock %} diff --git a/web/templates/ui/dialog.html b/web/templates/ui/dialog.html new file mode 100644 index 00000000..c1c2cd51 --- /dev/null +++ b/web/templates/ui/dialog.html @@ -0,0 +1,54 @@ +{# + Blocking modal dialog — Penguin UI's "modal" component + (https://www.penguinui.com/components/modal, modern style), with the dark + variants dropped because the app has no dark theme. + + It is Tailwind + Alpine markup, so a page that calls this macro must load + both in its `head` block; `pages/add_table/add_table.html` shows the set. + The `@theme` block there maps Penguin UI's semantic colour names onto the + palette in `static/app.css`. + + Rendered already open (`modalIsOpen: true`): the server only sends the + dialog when there is something the user has to be told, so there is no + trigger button — the response itself is the trigger. + + {% import "ui/dialog.html" as dialog %} + {% call dialog::error("Could not add the column", message) %}{% endcall %} +#} +{% macro error(title, message) %} +
+ +
+{% endmacro %}