secant-ios-wallet/secant/UI Components/DesignGuide.swift

161 lines
5.0 KiB
Swift
Raw Normal View History

//
// DesignGuide.swift
// secant-testnet
//
// Created by Francisco Gindre on 10/18/21.
2021-10-21 12:35:21 -07:00
// swiftlint:disable line_length
import SwiftUI
struct DesignGuide: View {
2021-10-21 12:35:21 -07:00
var body: some View {
HStack {
TextAndPlaceholdersGuide()
SmallVisualElements()
ButtonGuide()
}
}
}
struct TextAndPlaceholdersGuide: View {
var body: some View {
VStack(spacing: 30) {
2021-10-19 11:11:47 -07:00
Text("H1 Onboarding Rubik Light")
.font(FontFamily.Rubik.light.textStyle(.title))
.foregroundColor(Asset.Colors.Text.titleText.color)
2021-10-21 12:35:21 -07:00
Text(
"""
Rubik 16 regular #93A4BE Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd
"""
)
.font(FontFamily.Rubik.light.textStyle(.footnote))
.fontWeight(.thin)
2021-10-19 11:11:47 -07:00
.foregroundColor(Asset.Colors.Text.titleText.color)
2021-10-21 12:35:21 -07:00
Text("Placeholder for circular view")
.frame(width: 370, height: 370, alignment: .center)
Text("Placeholder for rectangular view")
.frame(width: 386, height: 125, alignment: .center)
OnboardingProgressViewPreviewHelper()
}
}
}
struct SmallVisualElements: View {
let gridItems = [GridItem(.flexible(minimum: 40, maximum: 100)), GridItem(.flexible(minimum: 40, maximum: 100))]
var body: some View {
VStack {
2021-10-21 12:41:39 -07:00
Text("Navigation Buttons")
.font(.caption)
2021-10-21 12:35:21 -07:00
LazyVGrid(columns: gridItems) {
// TODO: Change state to selected
Button("Back") { dump("Example button") }
.buttonStyle(NavigationButtonStyle())
.frame(width: 80, height: 40)
Button("Skip") { dump("Example button") }
.buttonStyle(NavigationButtonStyle())
.frame(width: 80, height: 40)
Button("Back") { dump("Example button") }
.buttonStyle(NavigationButtonStyle())
.frame(width: 80, height: 40)
Button("Skip") { dump("Example button") }
.buttonStyle(NavigationButtonStyle())
.frame(width: 80, height: 40)
}
2021-10-21 12:41:39 -07:00
Text("Recovery Phrase Chip")
.font(.caption)
EnumeratedChip(index: 1, text: "Salami")
.frame(width: 100, height: 40)
2021-10-21 12:35:21 -07:00
Text("shield icon")
.frame(width: 76, height: 76)
Text("profile icon")
.frame(width: 76, height: 76)
Text("listing icon")
.frame(width: 76, height: 76)
}
}
}
struct ButtonGuide: View {
let buttonHeight: CGFloat = 60
var body: some View {
VStack(spacing: 30) {
// Idle Primary Button
Button(action: {}) {
Text("Primary Button")
}
.primaryButtonStyle
2021-10-21 12:35:21 -07:00
.frame(height: buttonHeight)
2021-10-21 12:35:21 -07:00
// TODO: Pressed Primary Button
Button(action: {}) {
Text("Primary Button")
}
.primaryButtonStyle
.frame(height: buttonHeight)
// Disabled Primary Button
Button(action: {}) {
Text("Primary Button")
}
.primaryButtonStyle
.frame(height: buttonHeight)
.disabled(true)
// Idle Primary Action Button
Button(action: {}) {
Text("Primary Active Button")
}
.createButtonStyle
2021-10-21 12:35:21 -07:00
.frame(height: buttonHeight)
2021-10-21 12:35:21 -07:00
// TODO: Pressed Primary Action Button
Button(action: {}) {
Text("Primary Active Button")
}
.createButtonStyle
.frame(height: buttonHeight)
// TODO: Pressed Primary Action Button
Button(action: {}) {
Text("Primary Active Button")
}
.createButtonStyle
.frame(height: buttonHeight)
// Idle Secondary Button
Button(action: {}) {
Text("Secondary Button")
}
.secondaryButtonStyle
2021-10-21 12:35:21 -07:00
.frame(height: buttonHeight)
2021-10-21 12:35:21 -07:00
// Action Button
Button(action: {}) {
Text("Action Button")
}
.activeButtonStyle
2021-10-21 12:35:21 -07:00
.frame(height: buttonHeight)
Spacer()
}
}
}
struct DesignGuide_Previews: PreviewProvider {
static var previews: some View {
DesignGuide()
2021-10-21 12:35:21 -07:00
.padding(30)
.applyScreenBackground()
.preferredColorScheme(.dark)
2021-10-21 12:35:21 -07:00
.previewLayout(.fixed(width: 1086, height: 1080))
DesignGuide()
2021-10-21 12:35:21 -07:00
.padding(30)
.applyScreenBackground()
.preferredColorScheme(.light)
2021-10-21 12:35:21 -07:00
.previewLayout(.fixed(width: 1086, height: 1080))
}
}