From 9a479544a66f70eb4e21d141b1a07be6db36b53f Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Thu, 22 Jan 2026 10:25:39 +0100 Subject: [PATCH] Add support for rounded layout (#18283) --- .../src/app/layout/desktop-layout.component.html | 2 +- libs/components/src/layout/layout.component.html | 3 ++- libs/components/src/layout/layout.component.ts | 8 +++++++- libs/components/src/layout/layout.stories.ts | 11 ++++++++++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/apps/desktop/src/app/layout/desktop-layout.component.html b/apps/desktop/src/app/layout/desktop-layout.component.html index cb969f573fc..f9921ac11ef 100644 --- a/apps/desktop/src/app/layout/desktop-layout.component.html +++ b/apps/desktop/src/app/layout/desktop-layout.component.html @@ -1,4 +1,4 @@ - + diff --git a/libs/components/src/layout/layout.component.html b/libs/components/src/layout/layout.component.html index 255799b6690..66bfcafafe9 100644 --- a/libs/components/src/layout/layout.component.html +++ b/libs/components/src/layout/layout.component.html @@ -1,5 +1,5 @@ @let mainContentId = "main-content"; -
+
diff --git a/libs/components/src/layout/layout.component.ts b/libs/components/src/layout/layout.component.ts index 7460099cf92..5e3d420c8e5 100644 --- a/libs/components/src/layout/layout.component.ts +++ b/libs/components/src/layout/layout.component.ts @@ -1,7 +1,7 @@ import { A11yModule, CdkTrapFocus } from "@angular/cdk/a11y"; import { PortalModule } from "@angular/cdk/portal"; import { CommonModule } from "@angular/common"; -import { Component, ElementRef, inject, viewChild } from "@angular/core"; +import { booleanAttribute, Component, ElementRef, inject, input, viewChild } from "@angular/core"; import { RouterModule } from "@angular/router"; import { DrawerHostDirective } from "../drawer/drawer-host.directive"; @@ -38,6 +38,12 @@ export class LayoutComponent { protected drawerPortal = inject(DrawerService).portal; private readonly mainContent = viewChild.required>("main"); + + /** + * Rounded top left corner for the main content area + */ + readonly rounded = input(false, { transform: booleanAttribute }); + protected focusMainContent() { this.mainContent().nativeElement.focus(); } diff --git a/libs/components/src/layout/layout.stories.ts b/libs/components/src/layout/layout.stories.ts index 59770c21d2e..75ae329a1b3 100644 --- a/libs/components/src/layout/layout.stories.ts +++ b/libs/components/src/layout/layout.stories.ts @@ -14,6 +14,8 @@ import { StorybookGlobalStateProvider } from "../utils/state-mock"; import { LayoutComponent } from "./layout.component"; import { mockLayoutI18n } from "./mocks"; +import { formatArgsForCodeSnippet } from ".storybook/format-args-for-code-snippet"; + export default { title: "Component Library/Layout", component: LayoutComponent, @@ -63,7 +65,7 @@ export const WithContent: Story = { render: (args) => ({ props: args, template: /* HTML */ ` - + (args)}> @@ -111,3 +113,10 @@ export const Secondary: Story = { `, }), }; + +export const Rounded: Story = { + ...WithContent, + args: { + rounded: true, + }, +};