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,55 @@
|
|
|
1
|
+
// Button documentation code examples
|
|
2
|
+
export const ButtonCodeExamples = {
|
|
3
|
+
// Installation
|
|
4
|
+
installation: `npx wally-ui add button`,
|
|
5
|
+
|
|
6
|
+
// Import examples
|
|
7
|
+
import: `import { Button } from './components/wally-ui/button/button';`,
|
|
8
|
+
componentImport: `@Component({
|
|
9
|
+
selector: 'app-example',
|
|
10
|
+
imports: [Button],
|
|
11
|
+
templateUrl: './example.html',
|
|
12
|
+
styleUrl: './example.css'
|
|
13
|
+
})`,
|
|
14
|
+
|
|
15
|
+
// Basic usage
|
|
16
|
+
basicUsage: `<wally-button>Wally Button</wally-button>`,
|
|
17
|
+
|
|
18
|
+
// States
|
|
19
|
+
disabled: `<wally-button [disabled]="true">Disabled</wally-button>`,
|
|
20
|
+
loading: `<wally-button [loading]="true">Loading</wally-button>`,
|
|
21
|
+
notification: `<wally-button [showNotification]="true">Messages</wally-button>`,
|
|
22
|
+
|
|
23
|
+
// Types
|
|
24
|
+
submit: `<wally-button type="submit">Submit Form</wally-button>`,
|
|
25
|
+
|
|
26
|
+
// Events
|
|
27
|
+
clickTemplate: `<wally-button (click)="handleClick()">Click Me</wally-button>`,
|
|
28
|
+
clickMethod: `handleClick(): void {
|
|
29
|
+
this.clickMessage.set('Button clicked!');
|
|
30
|
+
}`,
|
|
31
|
+
|
|
32
|
+
// Icons
|
|
33
|
+
iconWithText: `<wally-button>
|
|
34
|
+
Save
|
|
35
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
|
36
|
+
stroke-width="1.5" stroke="currentColor" class="size-5">
|
|
37
|
+
<path stroke-linecap="round" stroke-linejoin="round"
|
|
38
|
+
d="M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" />
|
|
39
|
+
</svg>
|
|
40
|
+
</wally-button>`,
|
|
41
|
+
|
|
42
|
+
iconOnly: `<wally-button>
|
|
43
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
|
44
|
+
stroke-width="1.5" stroke="currentColor" class="size-5">
|
|
45
|
+
<path stroke-linecap="round" stroke-linejoin="round"
|
|
46
|
+
d="M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0M3.124 7.5A8.969 8.969 0 0 1 5.292 3m13.416 0a8.969 8.969 0 0 1 2.168 4.5" />
|
|
47
|
+
</svg>
|
|
48
|
+
</wally-button>`,
|
|
49
|
+
|
|
50
|
+
// Properties
|
|
51
|
+
propertyType: `type: string = 'button';`,
|
|
52
|
+
propertyDisabled: `disabled: boolean = false;`,
|
|
53
|
+
propertyLoading: `loading: boolean = false;`,
|
|
54
|
+
propertyShowNotification: `showNotification: boolean = false;`,
|
|
55
|
+
};
|
|
@@ -48,9 +48,7 @@
|
|
|
48
48
|
<section class="mb-8">
|
|
49
49
|
<h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">Installation</h2>
|
|
50
50
|
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
|
|
51
|
-
<code class="text-sm text-[#0a0a0a] dark:text-white">
|
|
52
|
-
npx wally-ui add button
|
|
53
|
-
</code>
|
|
51
|
+
<pre><code [innerHTML]="basicUsageCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
54
52
|
</div>
|
|
55
53
|
</section>
|
|
56
54
|
|
|
@@ -109,20 +107,11 @@
|
|
|
109
107
|
<h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">Import</h2>
|
|
110
108
|
<div class="space-y-4">
|
|
111
109
|
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
|
|
112
|
-
<code class="text-sm text-[#0a0a0a] dark:text-white">
|
|
113
|
-
import {{ '{' }} Button {{ '}' }} from './components/wally-ui/button/button';
|
|
114
|
-
</code>
|
|
110
|
+
<pre><code [innerHTML]="importCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
115
111
|
</div>
|
|
116
112
|
|
|
117
113
|
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
|
|
118
|
-
<code class="text-sm text-[#0a0a0a] dark:text-white">
|
|
119
|
-
@Component({{ '{' }}<br>
|
|
120
|
-
selector: 'app-example',<br>
|
|
121
|
-
imports: [Button],<br>
|
|
122
|
-
templateUrl: './example.html',<br>
|
|
123
|
-
styleUrl: './example.css'<br>
|
|
124
|
-
{{ '}' }})
|
|
125
|
-
</code>
|
|
114
|
+
<pre><code [innerHTML]="componentImportCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
126
115
|
</div>
|
|
127
116
|
</div>
|
|
128
117
|
</section>
|
|
@@ -136,9 +125,7 @@
|
|
|
136
125
|
<div class="space-y-8">
|
|
137
126
|
<div>
|
|
138
127
|
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg mb-4">
|
|
139
|
-
<code class="text-sm text-[#0a0a0a] dark:text-white">
|
|
140
|
-
{{ '<' }}wally-button{{ '>' }}Wally Button{{ '<' }}/wally-button{{ '>' }}
|
|
141
|
-
</code>
|
|
128
|
+
<pre><code [innerHTML]="basicUsageTemplateCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
142
129
|
</div>
|
|
143
130
|
<div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
|
|
144
131
|
<wally-button>Wally Button</wally-button>
|
|
@@ -160,9 +147,7 @@
|
|
|
160
147
|
Disabled
|
|
161
148
|
</h3>
|
|
162
149
|
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg mb-4">
|
|
163
|
-
<code class="text-sm text-[#0a0a0a] dark:text-white">
|
|
164
|
-
{{ '<' }}wally-button [disabled]="true"{{ '>' }}Disabled{{ '<' }}/wally-button{{ '>' }}
|
|
165
|
-
</code>
|
|
150
|
+
<pre><code [innerHTML]="disabledCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
166
151
|
</div>
|
|
167
152
|
<div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
|
|
168
153
|
<wally-button [disabled]="true">Disabled</wally-button>
|
|
@@ -175,9 +160,7 @@
|
|
|
175
160
|
Loading
|
|
176
161
|
</h3>
|
|
177
162
|
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg mb-4">
|
|
178
|
-
<code class="text-sm text-[#0a0a0a] dark:text-white">
|
|
179
|
-
{{ '<' }}wally-button [loading]="true"{{ '>' }}Loading{{ '<' }}/wally-button{{ '>' }}
|
|
180
|
-
</code>
|
|
163
|
+
<pre><code [innerHTML]="loadingCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
181
164
|
</div>
|
|
182
165
|
<div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
|
|
183
166
|
<wally-button [loading]="true">Loading</wally-button>
|
|
@@ -190,9 +173,7 @@
|
|
|
190
173
|
With Notification Badge
|
|
191
174
|
</h3>
|
|
192
175
|
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg mb-4">
|
|
193
|
-
<code class="text-sm text-[#0a0a0a] dark:text-white">
|
|
194
|
-
{{ '<' }}wally-button [showNotification]="true"{{ '>' }}Messages{{ '<' }}/wally-button{{ '>' }}
|
|
195
|
-
</code>
|
|
176
|
+
<pre><code [innerHTML]="notificationCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
196
177
|
</div>
|
|
197
178
|
<div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
|
|
198
179
|
<wally-button [showNotification]="true">Messages</wally-button>
|
|
@@ -211,9 +192,7 @@
|
|
|
211
192
|
<div>
|
|
212
193
|
<h3 class="text-md font-medium mb-3 text-[#0a0a0a] dark:text-white">Submit Button</h3>
|
|
213
194
|
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg mb-4">
|
|
214
|
-
<code class="text-sm text-[#0a0a0a] dark:text-white">
|
|
215
|
-
{{ '<' }}wally-button type="submit"{{ '>' }}Submit Form{{ '<' }}/wally-button{{ '>' }}
|
|
216
|
-
</code>
|
|
195
|
+
<pre><code [innerHTML]="submitCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
217
196
|
</div>
|
|
218
197
|
<div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
|
|
219
198
|
<wally-button type="submit">Submit Form</wally-button>
|
|
@@ -232,12 +211,10 @@
|
|
|
232
211
|
<div>
|
|
233
212
|
<h3 class="text-md font-medium mb-3 text-[#0a0a0a] dark:text-white">Handling Click Events</h3>
|
|
234
213
|
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg mb-4">
|
|
235
|
-
<code class="text-sm text-[#0a0a0a] dark:text-white">
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
{{ '}' }}
|
|
240
|
-
</code>
|
|
214
|
+
<pre><code [innerHTML]="clickCodeHTML" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
215
|
+
</div>
|
|
216
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg mb-4">
|
|
217
|
+
<pre><code [innerHTML]="clickCodeTs" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
241
218
|
</div>
|
|
242
219
|
<div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
|
|
243
220
|
<div class="space-y-4 text-center">
|
|
@@ -264,16 +241,7 @@
|
|
|
264
241
|
<div>
|
|
265
242
|
<h3 class="text-md font-medium mb-3 text-[#0a0a0a] dark:text-white">Icon with Text</h3>
|
|
266
243
|
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg mb-4">
|
|
267
|
-
<code class="text-sm text-[#0a0a0a] dark:text-white">
|
|
268
|
-
{{ '<' }}wally-button{{ '>' }}<br>
|
|
269
|
-
Save<br>
|
|
270
|
-
{{ '<' }}svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"<br>
|
|
271
|
-
stroke-width="1.5" stroke="currentColor" class="size-5"{{ '>' }}<br>
|
|
272
|
-
{{ '<' }}path stroke-linecap="round" stroke-linejoin="round"<br>
|
|
273
|
-
d="M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" /{{ '>' }}<br>
|
|
274
|
-
{{ '<' }}/svg{{ '>' }}<br>
|
|
275
|
-
{{ '<' }}/wally-button{{ '>' }}
|
|
276
|
-
</code>
|
|
244
|
+
<pre><code [innerHTML]="iconCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
277
245
|
</div>
|
|
278
246
|
<div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
|
|
279
247
|
<wally-button>
|
|
@@ -291,15 +259,7 @@
|
|
|
291
259
|
<div>
|
|
292
260
|
<h3 class="text-md font-medium mb-3 text-[#0a0a0a] dark:text-white">Icon Only</h3>
|
|
293
261
|
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg mb-4">
|
|
294
|
-
<code class="text-sm text-[#0a0a0a] dark:text-white">
|
|
295
|
-
{{ '<' }}wally-button{{ '>' }}<br>
|
|
296
|
-
{{ '<' }}svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"<br>
|
|
297
|
-
stroke-width="1.5" stroke="currentColor" class="size-5"{{ '>' }}<br>
|
|
298
|
-
{{ '<' }}path stroke-linecap="round" stroke-linejoin="round"<br>
|
|
299
|
-
d="M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0M3.124 7.5A8.969 8.969 0 0 1 5.292 3m13.416 0a8.969 8.969 0 0 1 2.168 4.5" /{{ '>' }}<br>
|
|
300
|
-
{{ '<' }}/svg{{ '>' }}<br>
|
|
301
|
-
{{ '<' }}/wally-button{{ '>' }}
|
|
302
|
-
</code>
|
|
262
|
+
<pre><code [innerHTML]="iconNotificationCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
303
263
|
</div>
|
|
304
264
|
<div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
|
|
305
265
|
<wally-button>
|
|
@@ -319,66 +279,33 @@
|
|
|
319
279
|
<h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">Properties</h2>
|
|
320
280
|
|
|
321
281
|
<div class="space-y-4">
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
<span class="text-blue-600 dark:text-blue-400">type</span><span class="text-[#0a0a0a] dark:text-white">:
|
|
326
|
-
</span>
|
|
327
|
-
<span class="text-purple-600 dark:text-purple-400">string</span> <span
|
|
328
|
-
class="text-[#0a0a0a] dark:text-white"> = </span>
|
|
329
|
-
<span class="text-green-600 dark:text-green-400">'button'</span>
|
|
330
|
-
<span class="text-[#0a0a0a] dark:text-white">;</span>
|
|
282
|
+
<div class="space-y-2">
|
|
283
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
|
|
284
|
+
<pre><code [innerHTML]="propertyTypeCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
331
285
|
</div>
|
|
332
286
|
<p class="text-sm text-gray-700 dark:text-gray-400">HTML button type (button, submit, reset)</p>
|
|
333
287
|
</div>
|
|
334
288
|
|
|
335
|
-
<div class="
|
|
336
|
-
<div class="
|
|
337
|
-
<
|
|
338
|
-
</span>
|
|
339
|
-
<span class="text-purple-600 dark:text-purple-400">boolean</span> <span
|
|
340
|
-
class="text-[#0a0a0a] dark:text-white"> = </span>
|
|
341
|
-
<span class="text-green-600 dark:text-green-400">false</span>
|
|
342
|
-
<span class="text-[#0a0a0a] dark:text-white">;</span>
|
|
289
|
+
<div class="space-y-2">
|
|
290
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
|
|
291
|
+
<pre><code [innerHTML]="propertyDisabledCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
343
292
|
</div>
|
|
344
293
|
<p class="text-sm text-gray-700 dark:text-gray-400">Whether the button is disabled</p>
|
|
345
294
|
</div>
|
|
346
295
|
|
|
347
|
-
<div class="
|
|
348
|
-
<div class="
|
|
349
|
-
<
|
|
350
|
-
</span>
|
|
351
|
-
<span class="text-purple-600 dark:text-purple-400">boolean</span> <span
|
|
352
|
-
class="text-[#0a0a0a] dark:text-white"> = </span>
|
|
353
|
-
<span class="text-green-600 dark:text-green-400">false</span>
|
|
354
|
-
<span class="text-[#0a0a0a] dark:text-white">;</span>
|
|
296
|
+
<div class="space-y-2">
|
|
297
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
|
|
298
|
+
<pre><code [innerHTML]="propertyLoadingCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
355
299
|
</div>
|
|
356
300
|
<p class="text-sm text-gray-700 dark:text-gray-400">Shows loading spinner when true</p>
|
|
357
301
|
</div>
|
|
358
302
|
|
|
359
|
-
<div class="
|
|
360
|
-
<div class="
|
|
361
|
-
<
|
|
362
|
-
class="text-[#0a0a0a] dark:text-white">: </span>
|
|
363
|
-
<span class="text-purple-600 dark:text-purple-400">boolean</span> <span
|
|
364
|
-
class="text-[#0a0a0a] dark:text-white"> = </span>
|
|
365
|
-
<span class="text-green-600 dark:text-green-400">false</span>
|
|
366
|
-
<span class="text-[#0a0a0a] dark:text-white">;</span>
|
|
303
|
+
<div class="space-y-2">
|
|
304
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
|
|
305
|
+
<pre><code [innerHTML]="propertyShowNotificationCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
|
|
367
306
|
</div>
|
|
368
307
|
<p class="text-sm text-gray-700 dark:text-gray-400">Shows notification badge when true</p>
|
|
369
308
|
</div>
|
|
370
|
-
|
|
371
|
-
<div class="p-4 bg-gray-200 dark:bg-[#121212] rounded-lg">
|
|
372
|
-
<div class="font-mono text-sm mb-2">
|
|
373
|
-
<span class="text-blue-600 dark:text-blue-400">icon</span><span class="text-[#0a0a0a] dark:text-white">:
|
|
374
|
-
</span>
|
|
375
|
-
<span class="text-purple-600 dark:text-purple-400">'left' | 'right' | 'none'</span> <span
|
|
376
|
-
class="text-[#0a0a0a] dark:text-white"> = </span>
|
|
377
|
-
<span class="text-green-600 dark:text-green-400">'none'</span>
|
|
378
|
-
<span class="text-[#0a0a0a] dark:text-white">;</span>
|
|
379
|
-
</div>
|
|
380
|
-
<p class="text-sm text-gray-700 dark:text-gray-400">Position of the icon content (left, right, or none)</p>
|
|
381
|
-
</div>
|
|
382
309
|
</div>
|
|
383
310
|
</section>
|
|
384
311
|
|
|
@@ -397,8 +324,6 @@
|
|
|
397
324
|
</p>
|
|
398
325
|
</div>
|
|
399
326
|
|
|
400
|
-
|
|
401
|
-
|
|
402
327
|
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
|
|
403
328
|
<div class="flex items-center gap-2 mb-2">
|
|
404
329
|
<h3 class="text-md font-medium text-[#0a0a0a] dark:text-white">Accessibility</h3>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Component, signal, WritableSignal } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
import { AiPromptService } from '../../../../core/services/ai-prompt.service';
|
|
4
|
+
import { getFormattedCode } from '../../../../core/utils/prism';
|
|
5
|
+
|
|
6
|
+
import { ButtonCodeExamples } from './button-docs.examples';
|
|
7
|
+
|
|
8
|
+
import { Breadcrumb, BreadcrumbItem } from '../../../../components/breadcrumb/breadcrumb';
|
|
9
|
+
import { Button } from '../../../../components/button/button';
|
|
10
|
+
|
|
11
|
+
@Component({
|
|
12
|
+
selector: 'app-button-docs',
|
|
13
|
+
imports: [
|
|
14
|
+
Button,
|
|
15
|
+
Breadcrumb
|
|
16
|
+
],
|
|
17
|
+
templateUrl: './button-docs.html',
|
|
18
|
+
styleUrl: './button-docs.css'
|
|
19
|
+
})
|
|
20
|
+
export class ButtonDocs {
|
|
21
|
+
breadcrumbItems: BreadcrumbItem[] = [
|
|
22
|
+
{ label: 'Home', url: '/' },
|
|
23
|
+
{ label: 'Documentation', url: '/documentation' },
|
|
24
|
+
{ label: 'Components', url: '/documentation/components' },
|
|
25
|
+
{ label: 'Button' }
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
basicUsageCode = getFormattedCode(ButtonCodeExamples.installation, 'bash');
|
|
29
|
+
importCode = getFormattedCode(ButtonCodeExamples.import, 'typescript');
|
|
30
|
+
componentImportCode = getFormattedCode(ButtonCodeExamples.componentImport, 'typescript');
|
|
31
|
+
basicUsageTemplateCode = getFormattedCode(ButtonCodeExamples.basicUsage, 'html');
|
|
32
|
+
disabledCode = getFormattedCode(ButtonCodeExamples.disabled, 'html');
|
|
33
|
+
loadingCode = getFormattedCode(ButtonCodeExamples.loading, 'html');
|
|
34
|
+
notificationCode = getFormattedCode(ButtonCodeExamples.notification, 'html');
|
|
35
|
+
submitCode = getFormattedCode(ButtonCodeExamples.submit, 'html');
|
|
36
|
+
clickCodeHTML = getFormattedCode(ButtonCodeExamples.clickTemplate, 'html');
|
|
37
|
+
clickCodeTs = getFormattedCode(ButtonCodeExamples.clickMethod, 'typescript');
|
|
38
|
+
iconCode = getFormattedCode(ButtonCodeExamples.iconWithText, 'html');
|
|
39
|
+
iconNotificationCode = getFormattedCode(ButtonCodeExamples.iconOnly, 'html');
|
|
40
|
+
|
|
41
|
+
// Properties
|
|
42
|
+
propertyTypeCode = getFormattedCode(ButtonCodeExamples.propertyType, 'typescript');
|
|
43
|
+
propertyDisabledCode = getFormattedCode(ButtonCodeExamples.propertyDisabled, 'typescript');
|
|
44
|
+
propertyLoadingCode = getFormattedCode(ButtonCodeExamples.propertyLoading, 'typescript');
|
|
45
|
+
propertyShowNotificationCode = getFormattedCode(ButtonCodeExamples.propertyShowNotification, 'typescript');
|
|
46
|
+
|
|
47
|
+
clickMessage: WritableSignal<string> = signal<string>('');
|
|
48
|
+
|
|
49
|
+
constructor(
|
|
50
|
+
private aiPromptService: AiPromptService
|
|
51
|
+
) { }
|
|
52
|
+
|
|
53
|
+
handleClick(): void {
|
|
54
|
+
this.clickMessage.set('Button clicked!');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
get claudeUrl(): string {
|
|
58
|
+
return this.aiPromptService.generateClaudeUrl();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
get chatGptUrl(): string {
|
|
62
|
+
return this.aiPromptService.generateChatGptUrl();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<div class="max-w-4xl mx-auto p-6 font-mono">
|
|
2
|
+
<div class="mb-4">
|
|
3
|
+
<wally-breadcrumb [items]="breadcrumbItems"></wally-breadcrumb>
|
|
4
|
+
</div>
|
|
5
|
+
|
|
6
|
+
<h1 class="text-2xl font-bold text-[#0a0a0a] dark:text-white mb-4">
|
|
7
|
+
Components
|
|
8
|
+
</h1>
|
|
9
|
+
<p class="text-gray-700 dark:text-gray-400 mb-6">
|
|
10
|
+
Explore our collection of reusable Angular components.
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
<!-- Available Components -->
|
|
14
|
+
<div id="available-components" class="space-y-4">
|
|
15
|
+
<h3 class="text-lg font-semibold text-[#0a0a0a] dark:text-white mb-4">Available Components</h3>
|
|
16
|
+
|
|
17
|
+
<div class="bg-gray-200 dark:bg-[#121212] rounded-lg p-4 mb-4">
|
|
18
|
+
<p class="text-sm text-gray-700 dark:text-gray-400">
|
|
19
|
+
More components are being built and will be added soon. Stay tuned for updates!
|
|
20
|
+
</p>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<div class="bg-gray-200 dark:bg-[#121212] rounded-lg p-4">
|
|
24
|
+
<div class="flex items-center gap-2 mb-2">
|
|
25
|
+
<h4 class="text-md font-semibold text-[#0a0a0a] dark:text-white">Button</h4>
|
|
26
|
+
<span class="text-xs bg-yellow-500 text-black px-2 py-1 rounded">Under Construction</span>
|
|
27
|
+
</div>
|
|
28
|
+
<p class="text-sm text-gray-700 dark:text-gray-400 mb-3">
|
|
29
|
+
A versatile button component with loading states, notifications, and customizable text. Currently being refined
|
|
30
|
+
and improved.
|
|
31
|
+
</p>
|
|
32
|
+
<a href="/documentation/components/button" class="text-blue-500 underline hover:text-blue-700 text-sm">
|
|
33
|
+
View Documentation
|
|
34
|
+
</a>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div class="bg-gray-200 dark:bg-[#121212] rounded-lg p-4">
|
|
38
|
+
<div class="flex items-center gap-2 mb-2">
|
|
39
|
+
<h4 class="text-md font-semibold text-[#0a0a0a] dark:text-white">Breadcrumb</h4>
|
|
40
|
+
<span class="text-xs bg-yellow-500 text-black px-2 py-1 rounded">Under Construction</span>
|
|
41
|
+
</div>
|
|
42
|
+
<p class="text-sm text-gray-700 dark:text-gray-400 mb-3">
|
|
43
|
+
A navigation component that shows the current page location within a hierarchy.
|
|
44
|
+
</p>
|
|
45
|
+
<a href="/documentation/components/breadcrumb" class="text-blue-500 underline hover:text-blue-700 text-sm">
|
|
46
|
+
View Documentation
|
|
47
|
+
</a>
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
<div class="bg-gray-200 dark:bg-[#121212] rounded-lg p-4">
|
|
51
|
+
<div class="flex items-center gap-2 mb-2">
|
|
52
|
+
<h4 class="text-md font-semibold text-[#0a0a0a] dark:text-white">Input</h4>
|
|
53
|
+
<span class="text-xs bg-yellow-500 text-black px-2 py-1 rounded">Under Construction</span>
|
|
54
|
+
</div>
|
|
55
|
+
<p class="text-sm text-gray-700 dark:text-gray-400 mb-3">
|
|
56
|
+
A versatile input component with full FormGroup support, perfect for forms and data entry.
|
|
57
|
+
</p>
|
|
58
|
+
<a href="/documentation/components/input" class="text-blue-500 underline hover:text-blue-700 text-sm">
|
|
59
|
+
View Documentation
|
|
60
|
+
</a>
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
<div class="w-auto h-auto">
|
|
64
|
+
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4944285767597175"
|
|
65
|
+
crossorigin="anonymous"></script>
|
|
66
|
+
<ins class="adsbygoogle" style="display:block" data-ad-format="fluid" data-ad-layout-key="-gw-3+1f-3d+2z"
|
|
67
|
+
data-ad-client="ca-pub-4944285767597175" data-ad-slot="4427496130"></ins>
|
|
68
|
+
<script>
|
|
69
|
+
(adsbygoogle = window.adsbygoogle || []).push({});
|
|
70
|
+
</script>
|
|
71
|
+
</div>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
@@ -12,5 +12,9 @@ export const componentsRoutes: Routes = [
|
|
|
12
12
|
{
|
|
13
13
|
path: 'breadcrumb',
|
|
14
14
|
loadComponent: () => import('./breadcrumb-docs/breadcrumb-docs').then(m => m.BreadcrumbDocs)
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
path: 'input',
|
|
18
|
+
loadComponent: () => import('./input-docs/input-docs').then(m => m.InputDocs)
|
|
15
19
|
}
|
|
16
20
|
];
|
package/playground/showcase/src/app/pages/{components → documentation/components}/components.ts
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Component } from '@angular/core';
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import { Breadcrumb, BreadcrumbItem } from '../../../components/breadcrumb/breadcrumb';
|
|
3
4
|
|
|
4
5
|
@Component({
|
|
5
6
|
selector: 'wally-components',
|
|
@@ -10,6 +11,7 @@ import { Breadcrumb, BreadcrumbItem } from '../../components/breadcrumb/breadcru
|
|
|
10
11
|
export class Components {
|
|
11
12
|
breadcrumbItems: BreadcrumbItem[] = [
|
|
12
13
|
{ label: 'Home', url: '/' },
|
|
14
|
+
{ label: 'Documentation', url: '/documentation' },
|
|
13
15
|
{ label: 'Components' }
|
|
14
16
|
];
|
|
15
17
|
}
|
package/playground/showcase/src/app/pages/documentation/components/input-docs/input-docs.examples.ts
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// Input documentation code examples
|
|
2
|
+
export const InputCodeExamples = {
|
|
3
|
+
// Installation
|
|
4
|
+
installation: `npx wally-ui add input`,
|
|
5
|
+
|
|
6
|
+
// Import examples
|
|
7
|
+
import: `import { Input } from './components/wally-ui/input/input';`,
|
|
8
|
+
componentImport: `@Component({
|
|
9
|
+
selector: 'app-example',
|
|
10
|
+
imports: [Input, ReactiveFormsModule],
|
|
11
|
+
templateUrl: './example.html',
|
|
12
|
+
styleUrl: './example.css'
|
|
13
|
+
})`,
|
|
14
|
+
|
|
15
|
+
// Basic usage
|
|
16
|
+
basicUsage: `<wally-input placeholder="Enter text"></wally-input>`,
|
|
17
|
+
basicSetup: `placeholder: string = 'Enter your name';`,
|
|
18
|
+
|
|
19
|
+
// FormGroup usage (most important!)
|
|
20
|
+
formGroupTemplate: `<form [formGroup]="userForm" (ngSubmit)="onSubmit()">
|
|
21
|
+
<wally-input
|
|
22
|
+
formControlName="name"
|
|
23
|
+
placeholder="Enter your name">
|
|
24
|
+
</wally-input>
|
|
25
|
+
|
|
26
|
+
<wally-input
|
|
27
|
+
formControlName="email"
|
|
28
|
+
placeholder="Enter your email">
|
|
29
|
+
</wally-input>
|
|
30
|
+
</form>`,
|
|
31
|
+
|
|
32
|
+
formGroupSetup: `import { FormBuilder, FormGroup, Validators, ReactiveFormsModule } from '@angular/forms';
|
|
33
|
+
|
|
34
|
+
userForm: FormGroup;
|
|
35
|
+
|
|
36
|
+
constructor(private fb: FormBuilder) {
|
|
37
|
+
this.userForm = this.fb.group({
|
|
38
|
+
name: ['', Validators.required],
|
|
39
|
+
email: ['', [Validators.required, Validators.email]]
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
onSubmit() {
|
|
44
|
+
if (this.userForm.valid) {
|
|
45
|
+
console.log(this.userForm.value);
|
|
46
|
+
}
|
|
47
|
+
}`,
|
|
48
|
+
|
|
49
|
+
// States
|
|
50
|
+
withValue: `<wally-input value="Pre-filled text" placeholder="Enter text"></wally-input>`,
|
|
51
|
+
|
|
52
|
+
// Types
|
|
53
|
+
emailType: `<wally-input type="email" placeholder="Enter your email"></wally-input>`,
|
|
54
|
+
passwordType: `<wally-input type="password" placeholder="Enter password"></wally-input>`,
|
|
55
|
+
|
|
56
|
+
// Form validation example
|
|
57
|
+
validationTemplate: `<form [formGroup]="validationForm">
|
|
58
|
+
<wally-input
|
|
59
|
+
formControlName="username"
|
|
60
|
+
placeholder="Username (required)">
|
|
61
|
+
</wally-input>
|
|
62
|
+
|
|
63
|
+
@if (validationForm.get('username')?.invalid && validationForm.get('username')?.touched) {
|
|
64
|
+
<div>
|
|
65
|
+
<span class="text-red-500 text-sm">Username is required</span>
|
|
66
|
+
</div>
|
|
67
|
+
}
|
|
68
|
+
</form>`,
|
|
69
|
+
|
|
70
|
+
validationSetup: `validationForm = this.fb.group({
|
|
71
|
+
username: ['', [Validators.required, Validators.minLength(3)]]
|
|
72
|
+
});`,
|
|
73
|
+
|
|
74
|
+
// New Features Examples
|
|
75
|
+
withLabel: `<wally-input label="Full Name" placeholder="Enter your name"></wally-input>`,
|
|
76
|
+
loadingState: `<wally-input [loading]="true" placeholder="Loading..."></wally-input>`,
|
|
77
|
+
validState: `<wally-input [valid]="true" placeholder="Valid input"></wally-input>`,
|
|
78
|
+
errorState: `<wally-input errorMessage="This field is required" placeholder="Enter value"></wally-input>`,
|
|
79
|
+
passwordWithToggle: `<wally-input type="password" label="Password" placeholder="Enter secure password"></wally-input>`,
|
|
80
|
+
|
|
81
|
+
// Properties
|
|
82
|
+
propertyLabel: `label: string = '';`,
|
|
83
|
+
propertyType: `type: string = 'text';`,
|
|
84
|
+
propertyPlaceholder: `placeholder: string = '';`,
|
|
85
|
+
propertyLoading: `loading: boolean = false;`,
|
|
86
|
+
propertyValid: `valid: boolean = false;`,
|
|
87
|
+
propertyError: `errorMessage: string = '';`
|
|
88
|
+
};
|