wally-ui 1.2.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/playground/showcase/package-lock.json +18 -0
- package/playground/showcase/package.json +2 -0
- package/playground/showcase/public/_headers +7 -0
- package/playground/showcase/public/robots.txt +14 -0
- package/playground/showcase/src/app/app.routes.server.ts +14 -2
- package/playground/showcase/src/app/app.routes.ts +5 -1
- package/playground/showcase/src/app/components/breadcrumb/breadcrumb.ts +1 -0
- package/playground/showcase/src/app/components/input/input.html +70 -0
- package/playground/showcase/src/app/{pages/components/button-docs/button-docs.spec.ts → components/input/input.spec.ts} +6 -6
- package/playground/showcase/src/app/components/input/input.ts +98 -0
- package/playground/showcase/src/app/core/services/ai-prompt.service.ts +2 -2
- package/playground/showcase/src/app/core/utils/prism.ts +14 -0
- package/playground/showcase/src/app/pages/documentation/components/breadcrumb-docs/breadcrumb-docs.examples.ts +71 -0
- package/playground/showcase/src/app/pages/{components → documentation/components}/breadcrumb-docs/breadcrumb-docs.html +13 -43
- package/playground/showcase/src/app/pages/documentation/components/breadcrumb-docs/breadcrumb-docs.ts +63 -0
- package/playground/showcase/src/app/pages/documentation/components/button-docs/button-docs.examples.ts +55 -0
- package/playground/showcase/src/app/pages/{components → documentation/components}/button-docs/button-docs.html +26 -101
- package/playground/showcase/src/app/pages/documentation/components/button-docs/button-docs.ts +64 -0
- package/playground/showcase/src/app/pages/documentation/components/components.html +73 -0
- package/playground/showcase/src/app/pages/{components → documentation/components}/components.routes.ts +4 -0
- package/playground/showcase/src/app/pages/{components → documentation/components}/components.ts +3 -1
- package/playground/showcase/src/app/pages/documentation/components/input-docs/input-docs.css +13 -0
- package/playground/showcase/src/app/pages/documentation/components/input-docs/input-docs.examples.ts +88 -0
- package/playground/showcase/src/app/pages/documentation/components/input-docs/input-docs.html +357 -0
- package/playground/showcase/src/app/pages/documentation/components/input-docs/input-docs.ts +105 -0
- package/playground/showcase/src/app/pages/documentation/documentation.css +0 -0
- package/playground/showcase/src/app/pages/{components/components.html → documentation/documentation.html} +70 -43
- package/playground/showcase/src/app/pages/documentation/documentation.routes.ts +12 -0
- package/playground/showcase/src/app/pages/documentation/documentation.ts +16 -0
- package/playground/showcase/src/app/pages/home/home.html +9 -4
- package/playground/showcase/src/app/pages/home/home.ts +1 -3
- package/playground/showcase/src/app/pages/mcp/mcp.html +1 -1
- package/playground/showcase/src/index.html +7 -1
- package/playground/showcase/src/styles.css +547 -1
- package/playground/showcase/src/app/pages/components/breadcrumb-docs/breadcrumb-docs.ts +0 -43
- package/playground/showcase/src/app/pages/components/button-docs/button-docs.ts +0 -41
- package/playground/showcase/src/app/pages/components/components.spec.ts +0 -23
- /package/playground/showcase/src/app/pages/{components → documentation/components}/breadcrumb-docs/breadcrumb-docs.css +0 -0
- /package/playground/showcase/src/app/pages/{components → documentation/components}/button-docs/button-docs.css +0 -0
- /package/playground/showcase/src/app/pages/{components → documentation/components}/components.css +0 -0
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
<div class="font-mono">
|
|
2
|
+
<div class="max-w-4xl mx-auto p-6">
|
|
3
|
+
<div class="mb-4">
|
|
4
|
+
<wally-breadcrumb [items]="breadcrumbItems"></wally-breadcrumb>
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
<h1 class="text-2xl font-bold mb-4 text-[#0a0a0a] dark:text-white">
|
|
8
|
+
Input
|
|
9
|
+
</h1>
|
|
10
|
+
<p class="text-gray-700 dark:text-gray-400 mb-4">
|
|
11
|
+
A fully-featured input component with label support, loading states, validation styling, and complete FormGroup integration.
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<!-- Under Construction Badge -->
|
|
15
|
+
<div class="mb-6">
|
|
16
|
+
<span class="text-xs bg-yellow-500 text-black px-3 py-1 rounded-full font-medium">Under Construction</span>
|
|
17
|
+
<p class="text-sm text-gray-600 dark:text-gray-400 mt-2">
|
|
18
|
+
This component is actively being developed. More features and improvements coming soon!
|
|
19
|
+
</p>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<!-- AI Prompts -->
|
|
23
|
+
<div class="flex flex-wrap gap-2 mb-6">
|
|
24
|
+
<a [href]="claudeUrl" target="_blank"
|
|
25
|
+
class="inline-flex items-center gap-2 px-3 py-1.5 text-xs bg-gray-200 dark:bg-[#121212] text-gray-600 dark:text-gray-300 rounded-lg hover:bg-gray-300 dark:hover:bg-[#1a1a1a] hover:text-[#0a0a0a] dark:hover:text-white transition-colors">
|
|
26
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="size-6" viewBox="0 0 24 24">
|
|
27
|
+
<path fill="currentColor"
|
|
28
|
+
d="m4.714 15.956l4.718-2.648l.079-.23l-.08-.128h-.23l-.79-.048l-2.695-.073l-2.337-.097l-2.265-.122l-.57-.121l-.535-.704l.055-.353l.48-.321l.685.06l1.518.104l2.277.157l1.651.098l2.447.255h.389l.054-.158l-.133-.097l-.103-.098l-2.356-1.596l-2.55-1.688l-1.336-.972l-.722-.491L2 6.223l-.158-1.008l.656-.722l.88.06l.224.061l.893.686l1.906 1.476l2.49 1.833l.364.304l.146-.104l.018-.072l-.164-.274l-1.354-2.446l-1.445-2.49l-.644-1.032l-.17-.619a3 3 0 0 1-.103-.729L6.287.133L6.7 0l.995.134l.42.364l.619 1.415L9.735 4.14l1.555 3.03l.455.898l.243.832l.09.255h.159V9.01l.127-1.706l.237-2.095l.23-2.695l.08-.76l.376-.91l.747-.492l.583.28l.48.685l-.067.444l-.286 1.851l-.558 2.903l-.365 1.942h.213l.243-.242l.983-1.306l1.652-2.064l.728-.82l.85-.904l.547-.431h1.032l.759 1.129l-.34 1.166l-1.063 1.347l-.88 1.142l-1.263 1.7l-.79 1.36l.074.11l.188-.02l2.853-.606l1.542-.28l1.84-.315l.832.388l.09.395l-.327.807l-1.967.486l-2.307.462l-3.436.813l-.043.03l.049.061l1.548.146l.662.036h1.62l3.018.225l.79.522l.473.638l-.08.485l-1.213.62l-1.64-.389l-3.825-.91l-1.31-.329h-.183v.11l1.093 1.068l2.003 1.81l2.508 2.33l.127.578l-.321.455l-.34-.049l-2.204-1.657l-.85-.747l-1.925-1.62h-.127v.17l.443.649l2.343 3.521l.122 1.08l-.17.353l-.607.213l-.668-.122l-1.372-1.924l-1.415-2.168l-1.141-1.943l-.14.08l-.674 7.254l-.316.37l-.728.28l-.607-.461l-.322-.747l.322-1.476l.388-1.924l.316-1.53l.285-1.9l.17-.632l-.012-.042l-.14.018l-1.432 1.967l-2.18 2.945l-1.724 1.845l-.413.164l-.716-.37l.066-.662l.401-.589l2.386-3.036l1.439-1.882l.929-1.086l-.006-.158h-.055L4.138 18.56l-1.13.146l-.485-.456l.06-.746l.231-.243l1.907-1.312Z" />
|
|
29
|
+
</svg>
|
|
30
|
+
Open in Claude
|
|
31
|
+
</a>
|
|
32
|
+
|
|
33
|
+
<a [href]="chatGptUrl" target="_blank"
|
|
34
|
+
class="inline-flex items-center gap-2 px-3 py-1.5 text-xs bg-gray-200 dark:bg-[#121212] text-gray-600 dark:text-gray-300 rounded-lg hover:bg-gray-300 dark:hover:bg-[#1a1a1a] hover:text-[#0a0a0a] dark:hover:text-white transition-colors">
|
|
35
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="size-6" viewBox="0 0 48 48">
|
|
36
|
+
<path fill="none" stroke="currentColor" stroke-width="3" stroke-linejoin="round"
|
|
37
|
+
d="M18.38 27.94v-14.4l11.19-6.46c6.2-3.58 17.3 5.25 12.64 13.33" />
|
|
38
|
+
<path fill="none" stroke="currentColor" stroke-width="3" stroke-linejoin="round"
|
|
39
|
+
d="m18.38 20.94l12.47-7.2l11.19 6.46c6.2 3.58 4.1 17.61-5.23 17.61" />
|
|
40
|
+
<path fill="none" stroke="currentColor" stroke-width="3" stroke-linejoin="round"
|
|
41
|
+
d="m24.44 17.44l12.47 7.2v12.93c0 7.16-13.2 12.36-17.86 4.28" />
|
|
42
|
+
<path fill="none" stroke="currentColor" stroke-width="3" stroke-linejoin="round"
|
|
43
|
+
d="M30.5 21.2v14.14L19.31 41.8c-6.2 3.58-17.3-5.25-12.64-13.33" />
|
|
44
|
+
<path fill="none" stroke="currentColor" stroke-width="3" stroke-linejoin="round"
|
|
45
|
+
d="m30.5 27.94l-12.47 7.2l-11.19-6.46c-6.21-3.59-4.11-17.61 5.22-17.61" />
|
|
46
|
+
<path fill="none" stroke="currentColor" stroke-width="3" stroke-linejoin="round"
|
|
47
|
+
d="m24.44 31.44l-12.47-7.2V11.31c0-7.16 13.2-12.36 17.86-4.28" />
|
|
48
|
+
</svg>
|
|
49
|
+
Open in ChatGPT
|
|
50
|
+
</a>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<!-- Installation -->
|
|
54
|
+
<section class="mb-8">
|
|
55
|
+
<h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">Installation</h2>
|
|
56
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
|
|
57
|
+
<pre><code [innerHTML]="installationCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
58
|
+
</div>
|
|
59
|
+
</section>
|
|
60
|
+
|
|
61
|
+
<!-- Preview -->
|
|
62
|
+
<section class="mb-8">
|
|
63
|
+
<h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">Preview</h2>
|
|
64
|
+
<div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
|
|
65
|
+
<form>
|
|
66
|
+
<div class="flex flex-col gap-4 w-full">
|
|
67
|
+
<wally-input label="Full Name" placeholder="Enter your name"></wally-input>
|
|
68
|
+
<wally-input label="Email Address" type="email" placeholder="Enter your email"></wally-input>
|
|
69
|
+
<wally-input label="Password" type="password" placeholder="Enter password"></wally-input>
|
|
70
|
+
</div>
|
|
71
|
+
</form>
|
|
72
|
+
</div>
|
|
73
|
+
</section>
|
|
74
|
+
|
|
75
|
+
<!-- Import -->
|
|
76
|
+
<section class="mb-8">
|
|
77
|
+
<h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">Import</h2>
|
|
78
|
+
<div class="space-y-4">
|
|
79
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
|
|
80
|
+
<pre><code [innerHTML]="importCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
|
|
84
|
+
<pre><code [innerHTML]="componentImportCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
</section>
|
|
88
|
+
|
|
89
|
+
<!-- FormGroup Usage (HIGHLIGHTED SECTION) -->
|
|
90
|
+
<section class="mb-8">
|
|
91
|
+
<div class="bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-700 p-4 rounded-lg mb-4">
|
|
92
|
+
<h2 class="text-lg font-semibold mb-2 text-blue-800 dark:text-blue-200">
|
|
93
|
+
FormGroup & ReactiveFormsModule Support
|
|
94
|
+
</h2>
|
|
95
|
+
<p class="text-sm text-blue-700 dark:text-blue-300">
|
|
96
|
+
This input component is fully compatible with Angular's FormGroup and ReactiveFormsModule!
|
|
97
|
+
Use <span class="bg-blue-100 dark:bg-blue-800 px-1 py-0.5 rounded text-xs">formControlName</span> for seamless form integration.
|
|
98
|
+
</p>
|
|
99
|
+
</div>
|
|
100
|
+
|
|
101
|
+
<div class="space-y-8">
|
|
102
|
+
<div>
|
|
103
|
+
<h3 class="text-md font-medium mb-3 text-[#0a0a0a] dark:text-white">Template Setup</h3>
|
|
104
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg mb-4">
|
|
105
|
+
<pre><code [innerHTML]="formGroupTemplateCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
|
|
109
|
+
<div>
|
|
110
|
+
<h3 class="text-md font-medium mb-3 text-[#0a0a0a] dark:text-white">Component Setup</h3>
|
|
111
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg mb-4">
|
|
112
|
+
<pre><code [innerHTML]="formGroupSetupCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
113
|
+
</div>
|
|
114
|
+
</div>
|
|
115
|
+
|
|
116
|
+
<div>
|
|
117
|
+
<h3 class="text-md font-medium mb-3 text-[#0a0a0a] dark:text-white">Live Example</h3>
|
|
118
|
+
<form [formGroup]="basicForm" (ngSubmit)="onBasicSubmit()" class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
|
|
119
|
+
<div class="flex flex-col gap-2 w-full">
|
|
120
|
+
<div>
|
|
121
|
+
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">Name</label>
|
|
122
|
+
<wally-input formControlName="name" placeholder="Enter your name"></wally-input>
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
<div>
|
|
126
|
+
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">Email</label>
|
|
127
|
+
<wally-input formControlName="email" type="email" placeholder="Enter your email"></wally-input>
|
|
128
|
+
</div>
|
|
129
|
+
|
|
130
|
+
<wally-button type="submit" class="w-full">
|
|
131
|
+
Submit (Check Console)
|
|
132
|
+
</wally-button>
|
|
133
|
+
|
|
134
|
+
<div class="text-sm text-gray-600 dark:text-gray-400 mt-4">
|
|
135
|
+
Form Value: {{ basicForm.value | json }}
|
|
136
|
+
</div>
|
|
137
|
+
</div>
|
|
138
|
+
</form>
|
|
139
|
+
</div>
|
|
140
|
+
</div>
|
|
141
|
+
</section>
|
|
142
|
+
|
|
143
|
+
<!-- Basic Usage -->
|
|
144
|
+
<section class="mb-8">
|
|
145
|
+
<h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">Basic Usage</h2>
|
|
146
|
+
|
|
147
|
+
<div class="space-y-8">
|
|
148
|
+
<div>
|
|
149
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg mb-4">
|
|
150
|
+
<pre><code [innerHTML]="basicSetupCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
151
|
+
</div>
|
|
152
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg mb-4">
|
|
153
|
+
<pre><code [innerHTML]="basicUsageCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
154
|
+
</div>
|
|
155
|
+
<div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
|
|
156
|
+
<wally-input placeholder="Enter text"></wally-input>
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
</section>
|
|
161
|
+
|
|
162
|
+
<!-- Input Features -->
|
|
163
|
+
<section class="mb-8">
|
|
164
|
+
<h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">Input Features</h2>
|
|
165
|
+
|
|
166
|
+
<div class="space-y-8">
|
|
167
|
+
<!-- Labels -->
|
|
168
|
+
<div>
|
|
169
|
+
<h3 class="text-md font-medium mb-3 text-[#0a0a0a] dark:text-white">With Labels</h3>
|
|
170
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg mb-4">
|
|
171
|
+
<pre><code [innerHTML]="labelCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
172
|
+
</div>
|
|
173
|
+
<div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
|
|
174
|
+
<div class="flex flex-col gap-4">
|
|
175
|
+
<wally-input label="Full Name" placeholder="Enter your name"></wally-input>
|
|
176
|
+
<wally-input label="Email Address" type="email" placeholder="Enter your email"></wally-input>
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
|
|
181
|
+
<!-- Loading State -->
|
|
182
|
+
<div>
|
|
183
|
+
<h3 class="text-md font-medium mb-3 text-[#0a0a0a] dark:text-white">Loading State</h3>
|
|
184
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg mb-4">
|
|
185
|
+
<pre><code [innerHTML]="loadingCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
186
|
+
</div>
|
|
187
|
+
<div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
|
|
188
|
+
<wally-input label="Processing..." [loading]="true" placeholder="Loading example"></wally-input>
|
|
189
|
+
</div>
|
|
190
|
+
</div>
|
|
191
|
+
|
|
192
|
+
<!-- Valid State -->
|
|
193
|
+
<div>
|
|
194
|
+
<h3 class="text-md font-medium mb-3 text-[#0a0a0a] dark:text-white">Valid State</h3>
|
|
195
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg mb-4">
|
|
196
|
+
<pre><code [innerHTML]="validCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
197
|
+
</div>
|
|
198
|
+
<div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
|
|
199
|
+
<wally-input label="Username" [valid]="true" placeholder="Valid input example"></wally-input>
|
|
200
|
+
</div>
|
|
201
|
+
</div>
|
|
202
|
+
|
|
203
|
+
<!-- Error State -->
|
|
204
|
+
<div>
|
|
205
|
+
<h3 class="text-md font-medium mb-3 text-[#0a0a0a] dark:text-white">Error State</h3>
|
|
206
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg mb-4">
|
|
207
|
+
<pre><code [innerHTML]="errorCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
208
|
+
</div>
|
|
209
|
+
<div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
|
|
210
|
+
<wally-input label="Email" errorMessage="Please enter a valid email address" placeholder="Enter email"></wally-input>
|
|
211
|
+
</div>
|
|
212
|
+
</div>
|
|
213
|
+
|
|
214
|
+
<!-- Password with Toggle -->
|
|
215
|
+
<div>
|
|
216
|
+
<h3 class="text-md font-medium mb-3 text-[#0a0a0a] dark:text-white">Password with Toggle</h3>
|
|
217
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg mb-4">
|
|
218
|
+
<pre><code [innerHTML]="passwordCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
219
|
+
</div>
|
|
220
|
+
<div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
|
|
221
|
+
<form>
|
|
222
|
+
<wally-input label="Password" type="password" placeholder="Enter secure password"></wally-input>
|
|
223
|
+
</form>
|
|
224
|
+
</div>
|
|
225
|
+
</div>
|
|
226
|
+
</div>
|
|
227
|
+
</section>
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
<!-- Form Validation -->
|
|
231
|
+
<section class="mb-8">
|
|
232
|
+
<h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">Form Validation</h2>
|
|
233
|
+
|
|
234
|
+
<div class="space-y-8">
|
|
235
|
+
<div>
|
|
236
|
+
<h3 class="text-md font-medium mb-3 text-[#0a0a0a] dark:text-white">Validation Setup</h3>
|
|
237
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg mb-4">
|
|
238
|
+
<pre><code [innerHTML]="validationSetupCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
239
|
+
</div>
|
|
240
|
+
</div>
|
|
241
|
+
|
|
242
|
+
<div>
|
|
243
|
+
<h3 class="text-md font-medium mb-3 text-[#0a0a0a] dark:text-white">Template with Validation</h3>
|
|
244
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg mb-4">
|
|
245
|
+
<pre><code [innerHTML]="validationTemplateCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
246
|
+
</div>
|
|
247
|
+
</div>
|
|
248
|
+
|
|
249
|
+
<div>
|
|
250
|
+
<h3 class="text-md font-medium mb-3 text-[#0a0a0a] dark:text-white">Live Validation Example</h3>
|
|
251
|
+
<form [formGroup]="validationForm" (ngSubmit)="onValidationSubmit()" class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
|
|
252
|
+
<div class="flex flex-col gap-2 w-full">
|
|
253
|
+
<div>
|
|
254
|
+
<label class="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2">Username (min 3 chars)</label>
|
|
255
|
+
<wally-input formControlName="username" placeholder="Enter username"></wally-input>
|
|
256
|
+
|
|
257
|
+
@if (validationForm.get('username')?.invalid && validationForm.get('username')?.touched) {
|
|
258
|
+
<div class="mt-2">
|
|
259
|
+
<span class="text-red-500 text-sm">
|
|
260
|
+
@if (validationForm.get('username')?.errors?.['required']) {
|
|
261
|
+
<span>Username is required</span>
|
|
262
|
+
}
|
|
263
|
+
@if (validationForm.get('username')?.errors?.['minlength']) {
|
|
264
|
+
<span>Username must be at least 3 characters</span>
|
|
265
|
+
}
|
|
266
|
+
</span>
|
|
267
|
+
</div>
|
|
268
|
+
}
|
|
269
|
+
</div>
|
|
270
|
+
|
|
271
|
+
<wally-button type="submit" [disabled]="validationForm.invalid" class="w-full">
|
|
272
|
+
Submit ({{ validationForm.valid ? 'Valid' : 'Invalid' }})
|
|
273
|
+
</wally-button>
|
|
274
|
+
</div>
|
|
275
|
+
</form>
|
|
276
|
+
</div>
|
|
277
|
+
</div>
|
|
278
|
+
</section>
|
|
279
|
+
|
|
280
|
+
<!-- Properties -->
|
|
281
|
+
<section class="mb-8">
|
|
282
|
+
<h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">Properties</h2>
|
|
283
|
+
|
|
284
|
+
<div class="space-y-4">
|
|
285
|
+
<div class="space-y-2">
|
|
286
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
|
|
287
|
+
<pre><code [innerHTML]="propertyLabelCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
288
|
+
</div>
|
|
289
|
+
<p class="text-sm text-gray-700 dark:text-gray-400">Optional label text displayed above the input</p>
|
|
290
|
+
</div>
|
|
291
|
+
|
|
292
|
+
<div class="space-y-2">
|
|
293
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
|
|
294
|
+
<pre><code [innerHTML]="propertyTypeCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
295
|
+
</div>
|
|
296
|
+
<p class="text-sm text-gray-700 dark:text-gray-400">HTML input type (text, email, password, etc.)</p>
|
|
297
|
+
</div>
|
|
298
|
+
|
|
299
|
+
<div class="space-y-2">
|
|
300
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
|
|
301
|
+
<pre><code [innerHTML]="propertyPlaceholderCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
302
|
+
</div>
|
|
303
|
+
<p class="text-sm text-gray-700 dark:text-gray-400">Placeholder text for the input</p>
|
|
304
|
+
</div>
|
|
305
|
+
|
|
306
|
+
<div class="space-y-2">
|
|
307
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
|
|
308
|
+
<pre><code [innerHTML]="propertyLoadingCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
309
|
+
</div>
|
|
310
|
+
<p class="text-sm text-gray-700 dark:text-gray-400">Shows loading spinner and disables input when true</p>
|
|
311
|
+
</div>
|
|
312
|
+
|
|
313
|
+
<div class="space-y-2">
|
|
314
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
|
|
315
|
+
<pre><code [innerHTML]="propertyValidCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
316
|
+
</div>
|
|
317
|
+
<p class="text-sm text-gray-700 dark:text-gray-400">Shows green styling when input is valid</p>
|
|
318
|
+
</div>
|
|
319
|
+
|
|
320
|
+
<div class="space-y-2">
|
|
321
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
|
|
322
|
+
<pre><code [innerHTML]="propertyErrorCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
323
|
+
</div>
|
|
324
|
+
<p class="text-sm text-gray-700 dark:text-gray-400">Error message text - shows red styling and displays error below input</p>
|
|
325
|
+
</div>
|
|
326
|
+
</div>
|
|
327
|
+
</section>
|
|
328
|
+
|
|
329
|
+
<!-- Future Features -->
|
|
330
|
+
<section class="mb-8">
|
|
331
|
+
<h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">Future Features</h2>
|
|
332
|
+
|
|
333
|
+
<div class="space-y-4">
|
|
334
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
|
|
335
|
+
<div class="flex items-center gap-2 mb-2">
|
|
336
|
+
<h3 class="text-md font-medium text-[#0a0a0a] dark:text-white">Input Icons</h3>
|
|
337
|
+
<span class="text-xs bg-blue-500 text-white px-2 py-1 rounded">Coming Soon</span>
|
|
338
|
+
</div>
|
|
339
|
+
<p class="text-sm text-gray-700 dark:text-gray-400">
|
|
340
|
+
Support for custom icons on the left and right sides of the input.
|
|
341
|
+
</p>
|
|
342
|
+
</div>
|
|
343
|
+
|
|
344
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
|
|
345
|
+
<div class="flex items-center gap-2 mb-2">
|
|
346
|
+
<h3 class="text-md font-medium text-[#0a0a0a] dark:text-white">Input Sizes</h3>
|
|
347
|
+
<span class="text-xs bg-blue-500 text-white px-2 py-1 rounded">Coming Soon</span>
|
|
348
|
+
</div>
|
|
349
|
+
<p class="text-sm text-gray-700 dark:text-gray-400">
|
|
350
|
+
Different input sizes: small, medium, large for various layouts.
|
|
351
|
+
</p>
|
|
352
|
+
</div>
|
|
353
|
+
</div>
|
|
354
|
+
</section>
|
|
355
|
+
|
|
356
|
+
</div>
|
|
357
|
+
</div>
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
|
|
3
|
+
|
|
4
|
+
import { Breadcrumb, BreadcrumbItem } from '../../../../components/breadcrumb/breadcrumb';
|
|
5
|
+
import { Input } from '../../../../components/input/input';
|
|
6
|
+
import { Button } from '../../../../components/button/button';
|
|
7
|
+
|
|
8
|
+
import { AiPromptService } from '../../../../core/services/ai-prompt.service';
|
|
9
|
+
import { InputCodeExamples } from './input-docs.examples';
|
|
10
|
+
import { getFormattedCode } from '../../../../core/utils/prism';
|
|
11
|
+
import { JsonPipe } from '@angular/common';
|
|
12
|
+
|
|
13
|
+
@Component({
|
|
14
|
+
selector: 'app-input-docs',
|
|
15
|
+
imports: [
|
|
16
|
+
Input,
|
|
17
|
+
Breadcrumb,
|
|
18
|
+
Button,
|
|
19
|
+
ReactiveFormsModule,
|
|
20
|
+
JsonPipe
|
|
21
|
+
],
|
|
22
|
+
templateUrl: './input-docs.html',
|
|
23
|
+
styleUrl: './input-docs.css'
|
|
24
|
+
})
|
|
25
|
+
export class InputDocs {
|
|
26
|
+
breadcrumbItems: BreadcrumbItem[] = [
|
|
27
|
+
{ label: 'Home', url: '/' },
|
|
28
|
+
{ label: 'Documentation', url: '/documentation' },
|
|
29
|
+
{ label: 'Components', url: '/documentation/components' },
|
|
30
|
+
{ label: 'Input' }
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
// Form examples
|
|
34
|
+
basicForm: FormGroup;
|
|
35
|
+
validationForm: FormGroup;
|
|
36
|
+
|
|
37
|
+
// Code examples with highlighting
|
|
38
|
+
installationCode = getFormattedCode(InputCodeExamples.installation, 'bash');
|
|
39
|
+
importCode = getFormattedCode(InputCodeExamples.import, 'typescript');
|
|
40
|
+
componentImportCode = getFormattedCode(InputCodeExamples.componentImport, 'typescript');
|
|
41
|
+
basicUsageCode = getFormattedCode(InputCodeExamples.basicUsage, 'html');
|
|
42
|
+
basicSetupCode = getFormattedCode(InputCodeExamples.basicSetup, 'typescript');
|
|
43
|
+
|
|
44
|
+
// FormGroup examples (highlighted!)
|
|
45
|
+
formGroupTemplateCode = getFormattedCode(InputCodeExamples.formGroupTemplate, 'html');
|
|
46
|
+
formGroupSetupCode = getFormattedCode(InputCodeExamples.formGroupSetup, 'typescript');
|
|
47
|
+
|
|
48
|
+
// States
|
|
49
|
+
withValueCode = getFormattedCode(InputCodeExamples.withValue, 'html');
|
|
50
|
+
|
|
51
|
+
// Types
|
|
52
|
+
emailTypeCode = getFormattedCode(InputCodeExamples.emailType, 'html');
|
|
53
|
+
passwordTypeCode = getFormattedCode(InputCodeExamples.passwordType, 'html');
|
|
54
|
+
|
|
55
|
+
// Validation
|
|
56
|
+
validationTemplateCode = getFormattedCode(InputCodeExamples.validationTemplate, 'html');
|
|
57
|
+
validationSetupCode = getFormattedCode(InputCodeExamples.validationSetup, 'typescript');
|
|
58
|
+
|
|
59
|
+
// New Features
|
|
60
|
+
labelCode = getFormattedCode(InputCodeExamples.withLabel, 'html');
|
|
61
|
+
loadingCode = getFormattedCode(InputCodeExamples.loadingState, 'html');
|
|
62
|
+
validCode = getFormattedCode(InputCodeExamples.validState, 'html');
|
|
63
|
+
errorCode = getFormattedCode(InputCodeExamples.errorState, 'html');
|
|
64
|
+
passwordCode = getFormattedCode(InputCodeExamples.passwordWithToggle, 'html');
|
|
65
|
+
|
|
66
|
+
// Properties
|
|
67
|
+
propertyLabelCode = getFormattedCode(InputCodeExamples.propertyLabel, 'typescript');
|
|
68
|
+
propertyTypeCode = getFormattedCode(InputCodeExamples.propertyType, 'typescript');
|
|
69
|
+
propertyPlaceholderCode = getFormattedCode(InputCodeExamples.propertyPlaceholder, 'typescript');
|
|
70
|
+
propertyLoadingCode = getFormattedCode(InputCodeExamples.propertyLoading, 'typescript');
|
|
71
|
+
propertyValidCode = getFormattedCode(InputCodeExamples.propertyValid, 'typescript');
|
|
72
|
+
propertyErrorCode = getFormattedCode(InputCodeExamples.propertyError, 'typescript');
|
|
73
|
+
|
|
74
|
+
constructor(
|
|
75
|
+
private aiPromptService: AiPromptService,
|
|
76
|
+
private fb: FormBuilder
|
|
77
|
+
) {
|
|
78
|
+
this.basicForm = this.fb.group({
|
|
79
|
+
name: [''],
|
|
80
|
+
email: ['']
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
this.validationForm = this.fb.group({
|
|
84
|
+
username: ['', [Validators.required, Validators.minLength(3)]]
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
get claudeUrl(): string {
|
|
89
|
+
return this.aiPromptService.generateClaudeUrl();
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
get chatGptUrl(): string {
|
|
93
|
+
return this.aiPromptService.generateChatGptUrl();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
onBasicSubmit() {
|
|
97
|
+
console.log('Basic Form:', this.basicForm.value);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
onValidationSubmit() {
|
|
101
|
+
if (this.validationForm.valid) {
|
|
102
|
+
console.log('Validation Form:', this.validationForm.value);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
File without changes
|
|
@@ -4,12 +4,73 @@
|
|
|
4
4
|
</div>
|
|
5
5
|
|
|
6
6
|
<h1 class="text-2xl font-bold text-[#0a0a0a] dark:text-white mb-4">
|
|
7
|
-
|
|
7
|
+
Documentation
|
|
8
8
|
</h1>
|
|
9
9
|
<p class="text-gray-700 dark:text-gray-400 mb-6">
|
|
10
|
-
|
|
10
|
+
Welcome to Wally UI documentation. Learn how to get started and explore our component library.
|
|
11
11
|
</p>
|
|
12
12
|
|
|
13
|
+
<!-- Philosophy & Approach -->
|
|
14
|
+
<div id="philosophy" class="mb-8">
|
|
15
|
+
<h2 class="text-lg font-semibold text-[#0a0a0a] dark:text-white mb-4">
|
|
16
|
+
A Modern Approach to Angular UI Components
|
|
17
|
+
</h2>
|
|
18
|
+
<p class="text-gray-700 dark:text-gray-400 mb-4">
|
|
19
|
+
Wally UI is a modern approach to building Angular interfaces, inspired by the success of shadcn/ui in React.
|
|
20
|
+
Unlike traditional libraries, it doesn't add heavy dependencies to your project: each component is generated
|
|
21
|
+
via npx and becomes your code, ready to edit, customize, and evolve as needed.
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
<div class="grid gap-3 md:grid-cols-2 mb-6">
|
|
25
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-3 rounded-lg">
|
|
26
|
+
<h3 class="text-sm font-semibold text-[#0a0a0a] dark:text-white mb-2">No External Dependencies</h3>
|
|
27
|
+
<p class="text-sm text-gray-700 dark:text-gray-400">
|
|
28
|
+
You control the code, without being tied to third-party updates.
|
|
29
|
+
</p>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-3 rounded-lg">
|
|
33
|
+
<h3 class="text-sm font-semibold text-[#0a0a0a] dark:text-white mb-2">Total Customization</h3>
|
|
34
|
+
<p class="text-sm text-gray-700 dark:text-gray-400">
|
|
35
|
+
Since the component is yours, it can be adapted to any design system or business rules.
|
|
36
|
+
</p>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-3 rounded-lg">
|
|
40
|
+
<h3 class="text-sm font-semibold text-[#0a0a0a] dark:text-white mb-2">Lightweight</h3>
|
|
41
|
+
<p class="text-sm text-gray-700 dark:text-gray-400">
|
|
42
|
+
Only what you actually add goes into the bundle, without loading dozens of unused components.
|
|
43
|
+
</p>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-3 rounded-lg">
|
|
47
|
+
<h3 class="text-sm font-semibold text-[#0a0a0a] dark:text-white mb-2">Tailwind Integrated</h3>
|
|
48
|
+
<p class="text-sm text-gray-700 dark:text-gray-400">
|
|
49
|
+
Modern, responsive, and consistent styles with the power of Tailwind CSS.
|
|
50
|
+
</p>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-3 rounded-lg">
|
|
54
|
+
<h3 class="text-sm font-semibold text-[#0a0a0a] dark:text-white mb-2">Learning & Clarity</h3>
|
|
55
|
+
<p class="text-sm text-gray-700 dark:text-gray-400">
|
|
56
|
+
Each component serves as a practical example of Angular best practices.
|
|
57
|
+
</p>
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-3 rounded-lg">
|
|
61
|
+
<h3 class="text-sm font-semibold text-[#0a0a0a] dark:text-white mb-2">Standalone Components</h3>
|
|
62
|
+
<p class="text-sm text-gray-700 dark:text-gray-400">
|
|
63
|
+
Leverages Angular's latest features, reducing complexity and improving modularity.
|
|
64
|
+
</p>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
<p class="text-gray-700 dark:text-gray-400">
|
|
69
|
+
With Wally UI, you gain agility to start projects, flexibility to shape your UI without limitations,
|
|
70
|
+
and simplicity to maintain code long-term. It's the most practical and modern way to build Angular interfaces.
|
|
71
|
+
</p>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
13
74
|
<!-- Requirements -->
|
|
14
75
|
<div id="requirements" class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg mb-6">
|
|
15
76
|
<h3 class="text-sm font-semibold text-[#0a0a0a] dark:text-white mb-3">Requirements</h3>
|
|
@@ -82,52 +143,18 @@
|
|
|
82
143
|
</div>
|
|
83
144
|
</div>
|
|
84
145
|
|
|
85
|
-
<!--
|
|
86
|
-
<div
|
|
87
|
-
<h3 class="text-lg font-semibold text-[#0a0a0a] dark:text-white mb-4">
|
|
88
|
-
|
|
89
|
-
<div class="bg-gray-200 dark:bg-[#121212] rounded-lg p-4 mb-4">
|
|
90
|
-
<p class="text-sm text-gray-700 dark:text-gray-400">
|
|
91
|
-
More components are being built and will be added soon. Stay tuned for updates!
|
|
92
|
-
</p>
|
|
93
|
-
</div>
|
|
94
|
-
|
|
95
|
-
<div class="bg-gray-200 dark:bg-[#121212] rounded-lg p-4">
|
|
96
|
-
<div class="flex items-center gap-2 mb-2">
|
|
97
|
-
<h4 class="text-md font-semibold text-[#0a0a0a] dark:text-white">Button</h4>
|
|
98
|
-
<span class="text-xs bg-yellow-500 text-black px-2 py-1 rounded">Under Construction</span>
|
|
99
|
-
</div>
|
|
100
|
-
<p class="text-sm text-gray-700 dark:text-gray-400 mb-3">
|
|
101
|
-
A versatile button component with loading states, notifications, and customizable text. Currently being refined
|
|
102
|
-
and improved.
|
|
103
|
-
</p>
|
|
104
|
-
<a href="/components/button" class="text-blue-500 underline hover:text-blue-700 text-sm">
|
|
105
|
-
View Documentation
|
|
106
|
-
</a>
|
|
107
|
-
</div>
|
|
146
|
+
<!-- Navigation to Components -->
|
|
147
|
+
<div class="space-y-4">
|
|
148
|
+
<h3 class="text-lg font-semibold text-[#0a0a0a] dark:text-white mb-4">Explore</h3>
|
|
108
149
|
|
|
109
150
|
<div class="bg-gray-200 dark:bg-[#121212] rounded-lg p-4">
|
|
110
|
-
<
|
|
111
|
-
<h4 class="text-md font-semibold text-[#0a0a0a] dark:text-white">Breadcrumb</h4>
|
|
112
|
-
<span class="text-xs bg-yellow-500 text-black px-2 py-1 rounded">Under Construction</span>
|
|
113
|
-
</div>
|
|
151
|
+
<h4 class="text-md font-semibold text-[#0a0a0a] dark:text-white mb-2">Components</h4>
|
|
114
152
|
<p class="text-sm text-gray-700 dark:text-gray-400 mb-3">
|
|
115
|
-
|
|
153
|
+
Browse our collection of reusable Angular components with examples and documentation.
|
|
116
154
|
</p>
|
|
117
|
-
<a href="/components
|
|
118
|
-
View
|
|
155
|
+
<a href="/documentation/components" class="text-blue-500 underline hover:text-blue-700 text-sm">
|
|
156
|
+
View Components →
|
|
119
157
|
</a>
|
|
120
158
|
</div>
|
|
121
|
-
|
|
122
|
-
<div class="bg-gray-200 dark:bg-[#121212] rounded-lg p-4 opacity-60">
|
|
123
|
-
<div class="flex items-center gap-2 mb-2">
|
|
124
|
-
<h4 class="text-md font-semibold text-[#0a0a0a] dark:text-white">Input Text</h4>
|
|
125
|
-
<span class="text-xs bg-blue-500 text-white px-2 py-1 rounded">Coming Soon</span>
|
|
126
|
-
</div>
|
|
127
|
-
<p class="text-sm text-gray-700 dark:text-gray-400">
|
|
128
|
-
A flexible input component with validation, placeholder support, and various styling options. Next in
|
|
129
|
-
development.
|
|
130
|
-
</p>
|
|
131
|
-
</div>
|
|
132
159
|
</div>
|
|
133
160
|
</div>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Routes } from '@angular/router';
|
|
2
|
+
|
|
3
|
+
export const documentationRoutes: Routes = [
|
|
4
|
+
{
|
|
5
|
+
path: '',
|
|
6
|
+
loadComponent: () => import('./documentation').then(m => m.Documentation)
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
path: 'components',
|
|
10
|
+
loadChildren: () => import('./components/components.routes').then(m => m.componentsRoutes)
|
|
11
|
+
}
|
|
12
|
+
];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
import { Breadcrumb, BreadcrumbItem } from '../../components/breadcrumb/breadcrumb';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'wally-documentation',
|
|
7
|
+
imports: [Breadcrumb],
|
|
8
|
+
templateUrl: './documentation.html',
|
|
9
|
+
styleUrl: './documentation.css'
|
|
10
|
+
})
|
|
11
|
+
export class Documentation {
|
|
12
|
+
breadcrumbItems: BreadcrumbItem[] = [
|
|
13
|
+
{ label: 'Home', url: '/' },
|
|
14
|
+
{ label: 'Documentation' }
|
|
15
|
+
];
|
|
16
|
+
}
|