From c80ebcb9b1fc7261b68767f0c83e83a973e6fa6a Mon Sep 17 00:00:00 2001 From: Arthur Belleville Date: Sat, 16 May 2026 14:07:07 +0200 Subject: [PATCH] feat(13-04): port icon-button/space components; wire UIIcon into button.templ; update tailwind.input.css (GREEN) - icon-button.css + icon_button.templ: UIIcon switch (plus/grid3x3/list/filter/search/calendar/pencil/trash + fallback span) - spacing.css + space.templ: SpaceX/SpaceY with SpacingStep classes - button.templ: wire @UIIcon(props.Icon) replacing Plan 02 placeholder comment - tailwind.input.css: add modal, empty-state, table, icon-button, form-field, spacing imports (14 total) - All 7 new tests pass; full go test ./... green --- backend/internal/web/ui/button.templ | 4 +- backend/internal/web/ui/icon-button.css | 50 +++++++++++++++ backend/internal/web/ui/icon_button.templ | 74 +++++++++++++++++++++++ backend/internal/web/ui/space.templ | 13 ++++ backend/internal/web/ui/spacing.css | 48 +++++++++++++++ backend/tailwind.input.css | 5 ++ 6 files changed, 193 insertions(+), 1 deletion(-) create mode 100644 backend/internal/web/ui/icon-button.css create mode 100644 backend/internal/web/ui/icon_button.templ create mode 100644 backend/internal/web/ui/space.templ create mode 100644 backend/internal/web/ui/spacing.css diff --git a/backend/internal/web/ui/button.templ b/backend/internal/web/ui/button.templ index 1c517af..6401eb7 100644 --- a/backend/internal/web/ui/button.templ +++ b/backend/internal/web/ui/button.templ @@ -17,7 +17,9 @@ type ButtonProps struct { templ Button(props ButtonProps) { } diff --git a/backend/internal/web/ui/icon-button.css b/backend/internal/web/ui/icon-button.css new file mode 100644 index 0000000..a60bdcc --- /dev/null +++ b/backend/internal/web/ui/icon-button.css @@ -0,0 +1,50 @@ +.ui-icon-button { + align-items: center; + appearance: none; + background: transparent; + border: 0; + border-radius: 0.5rem; + cursor: pointer; + display: inline-flex; + justify-content: center; + min-height: 44px; + min-width: 44px; + padding: 0.5rem; + transition: + background-color 0.2s ease, + color 0.2s ease; +} + +.ui-icon-button:focus-visible, +.borderless-icon-button:focus-visible { + box-shadow: 0 0 0 3px var(--color-focus-ring); + outline: none; +} + +.ui-icon-button-solid.ui-icon-button-neutral { + color: var(--color-text-muted); +} + +.ui-icon-button-solid.ui-icon-button-neutral:hover { + background: var(--color-surface-neutral-hover); + color: var(--color-text-primary); +} + +.borderless-icon-button { + appearance: none; + background: transparent; + border: 0; + box-shadow: none; + cursor: pointer; + outline: none; +} + +.ui-icon-button-ghost.ui-icon-button-neutral, +.ui-icon-button-ghost.ui-icon-button-danger { + color: var(--color-text-faint); +} + +.borderless-icon-button svg { + height: 1rem; + width: 1rem; +} diff --git a/backend/internal/web/ui/icon_button.templ b/backend/internal/web/ui/icon_button.templ new file mode 100644 index 0000000..bd97b32 --- /dev/null +++ b/backend/internal/web/ui/icon_button.templ @@ -0,0 +1,74 @@ +package ui + +type IconButtonProps struct { + Label string + Icon string + Variant IconButtonVariant + Tone IconButtonTone + Type string + Attrs templ.Attributes +} + +templ IconButton(props IconButtonProps) { + +} + +templ UIIcon(kind string) { + switch kind { + case "plus": + + case "grid3x3": + + case "list": + + case "filter": + + case "search": + + case "calendar": + + case "pencil": + + case "trash": + + default: + + } +} diff --git a/backend/internal/web/ui/space.templ b/backend/internal/web/ui/space.templ new file mode 100644 index 0000000..4cdd215 --- /dev/null +++ b/backend/internal/web/ui/space.templ @@ -0,0 +1,13 @@ +package ui + +type SpaceProps struct { + Size SpacingStep +} + +templ SpaceX(props SpaceProps) { + +} + +templ SpaceY(props SpaceProps) { + +} diff --git a/backend/internal/web/ui/spacing.css b/backend/internal/web/ui/spacing.css new file mode 100644 index 0000000..2d0e782 --- /dev/null +++ b/backend/internal/web/ui/spacing.css @@ -0,0 +1,48 @@ +.ui-space-x { + display: inline-block; + flex-shrink: 0; +} + +.ui-space-y { + display: block; +} + +.ui-space-x-xs { + width: 0.25rem; +} + +.ui-space-x-sm { + width: 0.5rem; +} + +.ui-space-x-md { + width: 0.75rem; +} + +.ui-space-x-lg { + width: 1rem; +} + +.ui-space-x-xl { + width: 1.5rem; +} + +.ui-space-y-xs { + height: 0.25rem; +} + +.ui-space-y-sm { + height: 0.5rem; +} + +.ui-space-y-md { + height: 0.75rem; +} + +.ui-space-y-lg { + height: 1rem; +} + +.ui-space-y-xl { + height: 1.5rem; +} diff --git a/backend/tailwind.input.css b/backend/tailwind.input.css index 6581cc5..2e10b45 100644 --- a/backend/tailwind.input.css +++ b/backend/tailwind.input.css @@ -12,4 +12,9 @@ @import "./internal/web/ui/input.css"; @import "./internal/web/ui/textarea.css"; @import "./internal/web/ui/select.css"; +@import "./internal/web/ui/modal.css"; +@import "./internal/web/ui/empty-state.css"; +@import "./internal/web/ui/table.css"; +@import "./internal/web/ui/icon-button.css"; @import "./internal/web/ui/form-field.css"; +@import "./internal/web/ui/spacing.css";