feat: add ModalForm component

This commit is contained in:
Prad Nukala
2024-10-07 13:59:29 -04:00
parent b633d21ea8
commit f7f0c11587
9 changed files with 226 additions and 299 deletions
+10 -44
View File
@@ -8,61 +8,28 @@ import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
// │ General State │
// ╰───────────────────────────────────────────────────────────╯
typealias InputType = "text" | "password" | "email" | "credential" | "file"
class Button {
text: String
href: String
}
abstract class Form {
title: String
description: String
inputs: List<Input>
}
class Image {
src: String
width: String
height: String
}
class Input {
label: String
type: InputType
placeholder: String
value: String?
error: String?
help: String?
required: Boolean?
}
class Link {
text: String
href: String
}
class SocialLink {
link: Link
icon: String
}
// ╭───────────────────────────────────────────────────────────╮
// │ Data Models │
// ╰───────────────────────────────────────────────────────────╯
class Feature {
title: String
description: String
icon: String?
image: Image?
}
class Stat {
value: String
label: String
}
class ModalForm {
title: String
description: String
id: String
}
// ╭───────────────────────────────────────────────────────────╮
// │ Homepage View Model │
// ╰───────────────────────────────────────────────────────────╯
@@ -78,14 +45,13 @@ class Hero {
stats: Listing<Stat>
}
class Highlights {
heading: String
subheading: String
highlights: Listing<Feature>
}
class Home {
hero: Hero
}
home : Home
register: ModalForm
login: ModalForm
authorize: ModalForm
privacyConsent: ModalForm