-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwelcome.templ
More file actions
148 lines (145 loc) · 4.97 KB
/
Copy pathwelcome.templ
File metadata and controls
148 lines (145 loc) · 4.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
package templpreview
import (
uiutils "github.com/ui8kit/ui/utils"
"github.com/ui8kit/ui/ui/badge"
"github.com/ui8kit/ui/ui/block"
"github.com/ui8kit/ui/ui/box"
"github.com/ui8kit/ui/ui/button"
"github.com/ui8kit/ui/ui/card"
"github.com/ui8kit/ui/ui/container"
"github.com/ui8kit/ui/ui/grid"
"github.com/ui8kit/ui/ui/group"
"github.com/ui8kit/ui/ui/link"
"github.com/ui8kit/ui/ui/stack"
"github.com/ui8kit/ui/ui/text"
"github.com/ui8kit/ui/ui/title"
)
type WelcomeProps struct {
Runtime string
}
templ Welcome(props WelcomeProps) {
@block.Block(block.BlockProps{Tag: "main", Class: "min-h-screen bg-muted/30 text-foreground"}) {
@container.Container(container.ContainerProps{Class: "mx-auto max-w-4xl px-4 py-16"}) {
@stack.Stack(stack.StackProps{Class: "gap-8"}) {
@stack.Stack(stack.StackProps{Class: "items-center gap-4 text-center"}) {
@badge.Badge(badge.BadgeProps{Variant: "outline", Class: "text-xs uppercase tracking-wide"}) {
{ props.Runtime }
}
@title.Title(title.TitleProps{As: uiutils.H1, Class: "text-3xl font-bold tracking-tight"}) {
UI8Kit Codegen
}
@text.Text(text.TextProps{Class: "max-w-2xl text-muted-foreground"}) {
One typed render contract — seven generated runtimes with identical DOM, design, and ARIA.
}
}
@card.Card(card.CardProps{Variant: "default"}) {
@card.CardHeader(card.CardHeaderProps{}) {
@card.CardTitle(card.CardTitleProps{}) {
Generated primitives
}
}
@card.CardContent(card.CardContentProps{}) {
@stack.Stack(stack.StackProps{Class: "gap-4"}) {
@group.Group(group.GroupProps{Class: "flex-wrap gap-2"}) {
@button.Button(button.ButtonProps{Variant: "default", Size: "sm"}) {
Default
}
@button.Button(button.ButtonProps{Variant: "secondary", Size: "sm"}) {
Secondary
}
@button.Button(button.ButtonProps{Variant: "outline", Size: "sm"}) {
Outline
}
@button.Button(button.ButtonProps{Variant: "ghost", Size: "sm"}) {
Ghost
}
@button.Button(button.ButtonProps{Variant: "destructive", Size: "sm"}) {
Destructive
}
}
@group.Group(group.GroupProps{Class: "flex-wrap gap-2"}) {
@badge.Badge(badge.BadgeProps{Variant: "default"}) {
Badge
}
@badge.Badge(badge.BadgeProps{Variant: "secondary"}) {
Secondary
}
@badge.Badge(badge.BadgeProps{Variant: "outline"}) {
Outline
}
}
}
}
}
@grid.Grid(grid.GridProps{Cols: "1-3", Class: "gap-4"}) {
@card.Card(card.CardProps{Variant: "muted"}) {
@card.CardHeader(card.CardHeaderProps{}) {
@card.CardTitle(card.CardTitleProps{}) {
Spec-driven
}
}
@card.CardContent(card.CardContentProps{}) {
@text.Text(text.TextProps{Class: "text-sm text-muted-foreground"}) {
Brick definitions in a tiny expression IR — no hand-written drift across stacks.
}
}
}
@card.Card(card.CardProps{Variant: "muted"}) {
@card.CardHeader(card.CardHeaderProps{}) {
@card.CardTitle(card.CardTitleProps{}) {
Seven runtimes
}
}
@card.CardContent(card.CardContentProps{}) {
@text.Text(text.TextProps{Class: "text-sm text-muted-foreground"}) {
Go Templ, React 19, Svelte 5, Vue 3, Latte, Twig, and static HTML from the same source.
}
}
}
@card.Card(card.CardProps{Variant: "muted"}) {
@card.CardHeader(card.CardHeaderProps{}) {
@card.CardTitle(card.CardTitleProps{}) {
DOM parity
}
}
@card.CardContent(card.CardContentProps{}) {
@text.Text(text.TextProps{Class: "text-sm text-muted-foreground"}) {
The canonical renderer is the executable specification, verified by tests.
}
}
}
}
@box.Box(box.BoxProps{Class: "rounded-lg border border-border bg-card p-4"}) {
@stack.Stack(stack.StackProps{Class: "gap-3"}) {
@text.Text(text.TextProps{Class: "text-sm font-medium"}) {
Preview other runtimes
}
@group.Group(group.GroupProps{Class: "flex-wrap gap-3"}) {
@link.Link(link.LinkProps{Href: "http://127.0.0.1:8080", Variant: "default"}) {
Go Templ
}
@link.Link(link.LinkProps{Href: "http://127.0.0.1:5173", Variant: "default"}) {
React 19
}
@link.Link(link.LinkProps{Href: "http://127.0.0.1:5174", Variant: "default"}) {
Svelte 5
}
@link.Link(link.LinkProps{Href: "http://127.0.0.1:5175", Variant: "default"}) {
Vue 3
}
@link.Link(link.LinkProps{Href: "http://127.0.0.1:5176", Variant: "default"}) {
Latte
}
@link.Link(link.LinkProps{Href: "http://127.0.0.1:5177", Variant: "default"}) {
Twig
}
}
}
}
@text.Text(text.TextProps{Class: "text-center text-sm text-muted-foreground"}) {
Same shadcn tokens · generated ui/ primitives · @ui8kit/codegen
}
}
}
}
}