From eb17f47441afc8e32b9923befa9390dd492ff8bc Mon Sep 17 00:00:00 2001 From: John Estropia Date: Thu, 5 Dec 2024 13:48:47 +0900 Subject: [PATCH] UI updates --- Sources/StorybookKit/Primitives/Book.swift | 41 ++++++++++++---------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/Sources/StorybookKit/Primitives/Book.swift b/Sources/StorybookKit/Primitives/Book.swift index 1a14678..98c7d63 100644 --- a/Sources/StorybookKit/Primitives/Book.swift +++ b/Sources/StorybookKit/Primitives/Book.swift @@ -51,26 +51,31 @@ public struct Book: BookView, Identifiable { 0, title: .init(fileID[module.endIndex...]), destination: { [registries = registriesByFileID[fileID]!] in - ScrollView { - LazyVStack( - alignment: .center, - spacing: 16, - pinnedViews: .sectionHeaders - ) { - Section( - content: { - ForEach.inefficient(items: registries) { registry in - AnyView(registry.makeView()) - } - }, - header: { - Text(fileID) - .truncationMode(.head) - .font(.caption.monospacedDigit()) + LazyVStack( + alignment: .center, + spacing: 16, + pinnedViews: .sectionHeaders + ) { + Section( + content: { + ForEach.inefficient(items: registries) { registry in + AnyView(registry.makeView()) } - ) - } + }, + header: { + Text(fileID) + .multilineTextAlignment(.leading) + .truncationMode(.head) + .foregroundStyle(.secondary) + .font(.caption.monospacedDigit()) + .padding(.horizontal, 16) + .padding(.vertical, 8) + .frame(maxWidth: .infinity) + .background(.thickMaterial) + } + ) } + .edgesIgnoringSafeArea(.top) } ) )