mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-03 01:41:44 +00:00
refactor: reorganize pkl files for better separation of concerns
This commit is contained in:
@@ -0,0 +1,140 @@
|
||||
@go.Package { name = "github.com/onsonr/sonr/pkg/nebula/models" }
|
||||
|
||||
module models
|
||||
|
||||
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 Highlight {
|
||||
title: String
|
||||
description: String
|
||||
image: Image
|
||||
}
|
||||
|
||||
class Stat {
|
||||
value: String
|
||||
label: String
|
||||
}
|
||||
|
||||
// ╭───────────────────────────────────────────────────────────╮
|
||||
// │ Homepage View Model │
|
||||
// ╰───────────────────────────────────────────────────────────╯
|
||||
|
||||
class Hero {
|
||||
titleFirst: String
|
||||
titleEmphasis: String
|
||||
titleSecond: String
|
||||
subtitle: String
|
||||
primaryButton: Button
|
||||
secondaryButton: Button
|
||||
image: Image
|
||||
stats: Listing<Stat>
|
||||
}
|
||||
|
||||
class Highlights {
|
||||
heading: String
|
||||
subheading: String
|
||||
highlights: Listing<Highlight>
|
||||
}
|
||||
|
||||
class Features {
|
||||
title: String
|
||||
description: String
|
||||
image: Image
|
||||
}
|
||||
|
||||
class Bento {
|
||||
title: String
|
||||
description: String
|
||||
primaryButton: Button
|
||||
secondaryButton: Button
|
||||
}
|
||||
|
||||
class Lowlights {
|
||||
title: String
|
||||
description: String
|
||||
image: Image
|
||||
}
|
||||
|
||||
class CallToAction {
|
||||
title: String
|
||||
description: String
|
||||
primaryButton: Button
|
||||
secondaryButton: Button
|
||||
}
|
||||
|
||||
class Footer {
|
||||
logo: Image
|
||||
mediumLink: SocialLink
|
||||
twitterLink: SocialLink
|
||||
discordLink: SocialLink
|
||||
githubLink: SocialLink
|
||||
companyLinks: Listing<Link>
|
||||
resourcesLinks: Listing<Link>
|
||||
}
|
||||
|
||||
class Home {
|
||||
hero: Hero
|
||||
highlights: Listing<Highlight>
|
||||
features: Listing<Features>
|
||||
bento: Bento
|
||||
lowlights: Listing<Lowlights>
|
||||
callToAction: CallToAction
|
||||
footer: Footer
|
||||
}
|
||||
|
||||
home : Home
|
||||
|
||||
Reference in New Issue
Block a user