From ed985d950021b337792d1570ad94d399f095c122 Mon Sep 17 00:00:00 2001 From: Till-JS <101404291+Till-JS@users.noreply.github.com> Date: Thu, 4 Dec 2025 17:27:43 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(shared-ui):=20add=20centered?= =?UTF-8?q?=20mode=20to=20PageHeader=20component?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add optional 'centered' prop that centers the title with back button on left and actions on right. Useful for mobile-style headers. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../shared-ui/src/molecules/PageHeader.svelte | 99 ++++++++++++++----- 1 file changed, 77 insertions(+), 22 deletions(-) diff --git a/packages/shared-ui/src/molecules/PageHeader.svelte b/packages/shared-ui/src/molecules/PageHeader.svelte index c2a138530..45a574c64 100644 --- a/packages/shared-ui/src/molecules/PageHeader.svelte +++ b/packages/shared-ui/src/molecules/PageHeader.svelte @@ -53,6 +53,8 @@ size?: HeaderSize; /** Whether to show bottom border */ bordered?: boolean; + /** Center the title (with actions on the right, back on the left) */ + centered?: boolean; /** Back navigation href (shows back arrow button) */ backHref?: string; /** Icon snippet (before title) */ @@ -72,6 +74,7 @@ description, size = 'md', bordered = false, + centered = false, backHref, icon, breadcrumb, @@ -103,18 +106,23 @@ > {#if breadcrumb} -
+
{@render breadcrumb()}
{/if} -
-
- + {#if centered} + +
+ {#if backHref} @@ -128,16 +136,14 @@ {/if} - - {#if icon} -
- {@render icon()} -
- {/if} - - -
-

+ +
+ {#if icon} +
+ {@render icon()} +
+ {/if} +

{title}

{#if description} @@ -146,15 +152,64 @@ {/if}
-

- - {#if actions} -
- {@render actions()} + + {#if actions} +
+ {@render actions()} +
+ {/if} +
+ {:else} + +
+
+ + {#if backHref} + + + + + + {/if} + + + {#if icon} +
+ {@render icon()} +
+ {/if} + + +
+

+ {title} +

+ {#if description} + + {description} + + {/if} +
- {/if} -
+ + + {#if actions} +
+ {@render actions()} +
+ {/if} +
+ {/if} {#if tabs}