Repository Public MIT
1// =============================================================================2// SP BOUCHER | SOFTWARE & RESEARCH3// ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING4// =============================================================================5//6// Project : SP GlassKit7// File : Examples/Gallery/Containers/GlassSheetExample.swift8// Module : Examples9// Repository : https://git.spboucher.ai/sp-glasskit10// Project Website : https://glass.spboucher.ai11// Created : 2026-12-0212// Last Modified : 2026-12-0213//14// Author : Simon-Pierre Boucher15// Position : Professor of Finance16// Institution : Université du Québec en Outaouais (UQO)17// Organization : SP Boucher18// Website : https://spboucher.ai19// Git : https://git.spboucher.ai20//21// Preferred Contact: contact@spboucher.ai22// Development : dev@spboucher.ai23// Support : support@spboucher.ai24// Security/Admin : admin@spboucher.ai25//26// Copyright (c) 202627// Simon-Pierre Boucher28// All rights reserved where applicable. This file is governed by the29// applicable project license, copyright notices and relevant law.30// Existing third-party rights and notices remain unaffected.31//32// License : MIT33//34// Do not embed credentials, private keys, access tokens,35// certificates or confidential personal information.36//37// =============================================================================38// END OF SP BOUCHER SOURCE HEADER39// =============================================================================4041import SwiftUI42import SPGlassKit4344public struct GlassSheetExample: GlassExample {45 public static let componentID = "glass-sheet"46 @State private var showsFilters = false47 @State private var showsTerms = false48 @State private var keyword = ""49 @State private var onlyAvailable = true5051 public init() {}5253 public var body: some View {54 VStack(spacing: 16) {55 GlassButton("Filters", systemImage: "line.3.horizontal.decrease") { showsFilters = true }56 GlassButton("Terms of use") { showsTerms = true }57 }58 .padding()59 .glassSheet(isPresented: $showsFilters, title: "Filters", configuration: .halfAndFull) {60 Form {61 TextField("Keyword", text: $keyword)62 Toggle("Only available", isOn: $onlyAvailable)63 }64 }65 .glassSheet(66 isPresented: $showsTerms,67 title: "Terms of use",68 configuration: GlassSheetConfiguration(detents: [.fraction(0.4), .large], isInteractiveDismissDisabled: true)69 ) {70 ScrollView {71 Text("Sample terms. This sheet cannot be swiped away: the close button is the way out.")72 .frame(maxWidth: .infinity, alignment: .leading)73 .padding()74 }75 }76 }77}7879#Preview("GlassSheet") { GlassSheetExample() }80