wally-ui 1.0.17 → 1.2.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/README.md +73 -4
- package/package.json +1 -1
- package/playground/showcase/src/app/app.routes.ts +4 -0
- package/playground/showcase/src/app/components/breadcrumb/breadcrumb.html +18 -0
- package/playground/showcase/src/app/components/breadcrumb/breadcrumb.ts +20 -0
- package/playground/showcase/src/app/components/button/button.html +6 -12
- package/playground/showcase/src/app/components/button/button.ts +7 -2
- package/playground/showcase/src/app/core/services/ai-prompt.service.ts +43 -0
- package/playground/showcase/src/app/pages/components/breadcrumb-docs/breadcrumb-docs.html +208 -0
- package/playground/showcase/src/app/pages/components/breadcrumb-docs/breadcrumb-docs.ts +43 -0
- package/playground/showcase/src/app/pages/components/button-docs/button-docs.css +0 -0
- package/playground/showcase/src/app/pages/components/button-docs/button-docs.html +455 -0
- package/playground/showcase/src/app/pages/components/{button/button.spec.ts → button-docs/button-docs.spec.ts} +5 -5
- package/playground/showcase/src/app/pages/components/button-docs/button-docs.ts +41 -0
- package/playground/showcase/src/app/pages/components/components.html +126 -9
- package/playground/showcase/src/app/pages/components/components.routes.ts +5 -1
- package/playground/showcase/src/app/pages/components/components.ts +6 -2
- package/playground/showcase/src/app/pages/home/home.html +16 -4
- package/playground/showcase/src/app/pages/mcp/mcp.css +1 -0
- package/playground/showcase/src/app/pages/mcp/mcp.html +196 -0
- package/playground/showcase/src/app/pages/mcp/mcp.spec.ts +23 -0
- package/playground/showcase/src/app/pages/mcp/mcp.ts +16 -0
- package/playground/showcase/src/app/pages/components/button/button.html +0 -192
- package/playground/showcase/src/app/pages/components/button/button.ts +0 -12
- /package/playground/showcase/src/app/pages/components/{button/button.css → breadcrumb-docs/breadcrumb-docs.css} +0 -0
|
@@ -0,0 +1,455 @@
|
|
|
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
|
+
Button
|
|
9
|
+
</h1>
|
|
10
|
+
<p class="text-gray-700 dark:text-gray-400 mb-4">
|
|
11
|
+
A versatile button component with loading states, notifications, and customizable text.
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<!-- AI Prompts -->
|
|
15
|
+
<div class="flex flex-wrap gap-2 mb-6">
|
|
16
|
+
<a [href]="claudeUrl" target="_blank"
|
|
17
|
+
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">
|
|
18
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="size-6" viewBox="0 0 24 24">
|
|
19
|
+
<path fill="currentColor"
|
|
20
|
+
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" />
|
|
21
|
+
</svg>
|
|
22
|
+
|
|
23
|
+
Open in Claude
|
|
24
|
+
</a>
|
|
25
|
+
|
|
26
|
+
<a [href]="chatGptUrl" target="_blank"
|
|
27
|
+
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">
|
|
28
|
+
<svg xmlns="http://www.w3.org/2000/svg" class="size-6" viewBox="0 0 48 48">
|
|
29
|
+
<path fill="none" stroke="currentColor" stroke-width="3" stroke-linejoin="round"
|
|
30
|
+
d="M18.38 27.94v-14.4l11.19-6.46c6.2-3.58 17.3 5.25 12.64 13.33" />
|
|
31
|
+
<path fill="none" stroke="currentColor" stroke-width="3" stroke-linejoin="round"
|
|
32
|
+
d="m18.38 20.94l12.47-7.2l11.19 6.46c6.2 3.58 4.1 17.61-5.23 17.61" />
|
|
33
|
+
<path fill="none" stroke="currentColor" stroke-width="3" stroke-linejoin="round"
|
|
34
|
+
d="m24.44 17.44l12.47 7.2v12.93c0 7.16-13.2 12.36-17.86 4.28" />
|
|
35
|
+
<path fill="none" stroke="currentColor" stroke-width="3" stroke-linejoin="round"
|
|
36
|
+
d="M30.5 21.2v14.14L19.31 41.8c-6.2 3.58-17.3-5.25-12.64-13.33" />
|
|
37
|
+
<path fill="none" stroke="currentColor" stroke-width="3" stroke-linejoin="round"
|
|
38
|
+
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" />
|
|
39
|
+
<path fill="none" stroke="currentColor" stroke-width="3" stroke-linejoin="round"
|
|
40
|
+
d="m24.44 31.44l-12.47-7.2V11.31c0-7.16 13.2-12.36 17.86-4.28" />
|
|
41
|
+
</svg>
|
|
42
|
+
|
|
43
|
+
Open in ChatGPT
|
|
44
|
+
</a>
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
<!-- Installation -->
|
|
48
|
+
<section class="mb-8">
|
|
49
|
+
<h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">Installation</h2>
|
|
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>
|
|
54
|
+
</div>
|
|
55
|
+
</section>
|
|
56
|
+
|
|
57
|
+
<!-- Preview -->
|
|
58
|
+
<section class="mb-8">
|
|
59
|
+
<h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">Preview</h2>
|
|
60
|
+
<div class="p-6 border rounded-lg bg-white dark:bg-[#121212] text-center">
|
|
61
|
+
<div class="flex flex-col gap-4">
|
|
62
|
+
<wally-button>Wally Button</wally-button>
|
|
63
|
+
<wally-button>
|
|
64
|
+
Send
|
|
65
|
+
<svg slot="icon-left" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2"
|
|
66
|
+
stroke="currentColor" class="size-5">
|
|
67
|
+
<path stroke-linecap="round" stroke-linejoin="round"
|
|
68
|
+
d="M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" />
|
|
69
|
+
</svg>
|
|
70
|
+
</wally-button>
|
|
71
|
+
<wally-button [disabled]="true">Disabled</wally-button>
|
|
72
|
+
<wally-button [loading]="true">
|
|
73
|
+
Loading
|
|
74
|
+
</wally-button>
|
|
75
|
+
|
|
76
|
+
<div class="w-full flex justify-center items-center gap-2">
|
|
77
|
+
<div class="w-full">
|
|
78
|
+
<wally-button [showNotification]="true">
|
|
79
|
+
Messages
|
|
80
|
+
</wally-button>
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<div class="flex justify-center">
|
|
84
|
+
<wally-button [showNotification]="true">
|
|
85
|
+
<svg slot="icon-left" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
|
86
|
+
stroke-width="1.5" stroke="currentColor" class="size-5">
|
|
87
|
+
<path stroke-linecap="round" stroke-linejoin="round"
|
|
88
|
+
d="M2.25 13.5h3.86a2.25 2.25 0 0 1 2.012 1.244l.256.512a2.25 2.25 0 0 0 2.013 1.244h3.218a2.25 2.25 0 0 0 2.013-1.244l.256-.512a2.25 2.25 0 0 1 2.013-1.244h3.859m-19.5.338V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18v-4.162c0-.224-.034-.447-.1-.661L19.24 5.338a2.25 2.25 0 0 0-2.15-1.588H6.911a2.25 2.25 0 0 0-2.15 1.588L2.35 13.177a2.25 2.25 0 0 0-.1.661Z" />
|
|
89
|
+
</svg>
|
|
90
|
+
</wally-button>
|
|
91
|
+
</div>
|
|
92
|
+
|
|
93
|
+
<div class="flex justify-center">
|
|
94
|
+
<wally-button [showNotification]="true">
|
|
95
|
+
<svg slot="icon-left" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
|
|
96
|
+
stroke-width="1.5" stroke="currentColor" class="size-5">
|
|
97
|
+
<path stroke-linecap="round" stroke-linejoin="round"
|
|
98
|
+
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" />
|
|
99
|
+
</svg>
|
|
100
|
+
</wally-button>
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
</section>
|
|
106
|
+
|
|
107
|
+
<!-- Import -->
|
|
108
|
+
<section class="mb-8">
|
|
109
|
+
<h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">Import</h2>
|
|
110
|
+
<div class="space-y-4">
|
|
111
|
+
<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>
|
|
115
|
+
</div>
|
|
116
|
+
|
|
117
|
+
<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>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
</section>
|
|
129
|
+
|
|
130
|
+
<!-- Basic Usage -->
|
|
131
|
+
<section class="mb-8">
|
|
132
|
+
<h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">
|
|
133
|
+
Basic Usage
|
|
134
|
+
</h2>
|
|
135
|
+
|
|
136
|
+
<div class="space-y-8">
|
|
137
|
+
<div>
|
|
138
|
+
<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>
|
|
142
|
+
</div>
|
|
143
|
+
<div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
|
|
144
|
+
<wally-button>Wally Button</wally-button>
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
</section>
|
|
149
|
+
|
|
150
|
+
<!-- States -->
|
|
151
|
+
<section class="mb-8">
|
|
152
|
+
<h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">
|
|
153
|
+
States
|
|
154
|
+
</h2>
|
|
155
|
+
|
|
156
|
+
<div class="space-y-8">
|
|
157
|
+
<!-- Disabled -->
|
|
158
|
+
<div>
|
|
159
|
+
<h3 class="text-md font-medium mb-3 text-[#0a0a0a] dark:text-white">
|
|
160
|
+
Disabled
|
|
161
|
+
</h3>
|
|
162
|
+
<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>
|
|
166
|
+
</div>
|
|
167
|
+
<div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
|
|
168
|
+
<wally-button [disabled]="true">Disabled</wally-button>
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
|
|
172
|
+
<!-- Loading -->
|
|
173
|
+
<div>
|
|
174
|
+
<h3 class="text-md font-medium mb-3 text-[#0a0a0a] dark:text-white">
|
|
175
|
+
Loading
|
|
176
|
+
</h3>
|
|
177
|
+
<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>
|
|
181
|
+
</div>
|
|
182
|
+
<div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
|
|
183
|
+
<wally-button [loading]="true">Loading</wally-button>
|
|
184
|
+
</div>
|
|
185
|
+
</div>
|
|
186
|
+
|
|
187
|
+
<!-- With Notification -->
|
|
188
|
+
<div>
|
|
189
|
+
<h3 class="text-md font-medium mb-3 text-[#0a0a0a] dark:text-white">
|
|
190
|
+
With Notification Badge
|
|
191
|
+
</h3>
|
|
192
|
+
<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>
|
|
196
|
+
</div>
|
|
197
|
+
<div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
|
|
198
|
+
<wally-button [showNotification]="true">Messages</wally-button>
|
|
199
|
+
</div>
|
|
200
|
+
</div>
|
|
201
|
+
</div>
|
|
202
|
+
</section>
|
|
203
|
+
|
|
204
|
+
<!-- Button Types -->
|
|
205
|
+
<section class="mb-8">
|
|
206
|
+
<h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">
|
|
207
|
+
Button Types
|
|
208
|
+
</h2>
|
|
209
|
+
|
|
210
|
+
<div class="space-y-8">
|
|
211
|
+
<div>
|
|
212
|
+
<h3 class="text-md font-medium mb-3 text-[#0a0a0a] dark:text-white">Submit Button</h3>
|
|
213
|
+
<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>
|
|
217
|
+
</div>
|
|
218
|
+
<div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
|
|
219
|
+
<wally-button type="submit">Submit Form</wally-button>
|
|
220
|
+
</div>
|
|
221
|
+
</div>
|
|
222
|
+
</div>
|
|
223
|
+
</section>
|
|
224
|
+
|
|
225
|
+
<!-- Click Events -->
|
|
226
|
+
<section class="mb-8">
|
|
227
|
+
<h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">
|
|
228
|
+
Click Events
|
|
229
|
+
</h2>
|
|
230
|
+
|
|
231
|
+
<div class="space-y-8">
|
|
232
|
+
<div>
|
|
233
|
+
<h3 class="text-md font-medium mb-3 text-[#0a0a0a] dark:text-white">Handling Click Events</h3>
|
|
234
|
+
<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
|
+
{{ '<' }}wally-button (click)="handleClick()"{{ '>' }}Click Me{{ '<' }}/wally-button{{ '>' }}<br><br>
|
|
237
|
+
handleClick() {{ '{' }}<br>
|
|
238
|
+
this.clickMessage.set('Button clicked!');<br>
|
|
239
|
+
{{ '}' }}
|
|
240
|
+
</code>
|
|
241
|
+
</div>
|
|
242
|
+
<div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
|
|
243
|
+
<div class="space-y-4 text-center">
|
|
244
|
+
<wally-button (click)="handleClick()">Click Me</wally-button>
|
|
245
|
+
@if (clickMessage()) {
|
|
246
|
+
<p class="text-sm text-green-600 dark:text-green-400 font-medium mt-4">
|
|
247
|
+
{{ clickMessage() }}
|
|
248
|
+
</p>
|
|
249
|
+
}
|
|
250
|
+
</div>
|
|
251
|
+
</div>
|
|
252
|
+
</div>
|
|
253
|
+
</div>
|
|
254
|
+
</section>
|
|
255
|
+
|
|
256
|
+
<!-- Button with Icons -->
|
|
257
|
+
<section class="mb-8">
|
|
258
|
+
<h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">
|
|
259
|
+
Button with Icons
|
|
260
|
+
</h2>
|
|
261
|
+
|
|
262
|
+
<div class="space-y-8">
|
|
263
|
+
<!-- Icon with Text -->
|
|
264
|
+
<div>
|
|
265
|
+
<h3 class="text-md font-medium mb-3 text-[#0a0a0a] dark:text-white">Icon with Text</h3>
|
|
266
|
+
<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>
|
|
277
|
+
</div>
|
|
278
|
+
<div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
|
|
279
|
+
<wally-button>
|
|
280
|
+
Save
|
|
281
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
|
|
282
|
+
stroke="currentColor" class="size-5">
|
|
283
|
+
<path stroke-linecap="round" stroke-linejoin="round"
|
|
284
|
+
d="M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" />
|
|
285
|
+
</svg>
|
|
286
|
+
</wally-button>
|
|
287
|
+
</div>
|
|
288
|
+
</div>
|
|
289
|
+
|
|
290
|
+
<!-- Icon Only -->
|
|
291
|
+
<div>
|
|
292
|
+
<h3 class="text-md font-medium mb-3 text-[#0a0a0a] dark:text-white">Icon Only</h3>
|
|
293
|
+
<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>
|
|
303
|
+
</div>
|
|
304
|
+
<div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
|
|
305
|
+
<wally-button>
|
|
306
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
|
|
307
|
+
stroke="currentColor" class="size-5">
|
|
308
|
+
<path stroke-linecap="round" stroke-linejoin="round"
|
|
309
|
+
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" />
|
|
310
|
+
</svg>
|
|
311
|
+
</wally-button>
|
|
312
|
+
</div>
|
|
313
|
+
</div>
|
|
314
|
+
</div>
|
|
315
|
+
</section>
|
|
316
|
+
|
|
317
|
+
<!-- Properties -->
|
|
318
|
+
<section class="mb-8">
|
|
319
|
+
<h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">Properties</h2>
|
|
320
|
+
|
|
321
|
+
<div class="space-y-4">
|
|
322
|
+
|
|
323
|
+
<div class="p-4 bg-gray-200 dark:bg-[#121212] rounded-lg">
|
|
324
|
+
<div class="font-mono text-sm mb-2">
|
|
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>
|
|
331
|
+
</div>
|
|
332
|
+
<p class="text-sm text-gray-700 dark:text-gray-400">HTML button type (button, submit, reset)</p>
|
|
333
|
+
</div>
|
|
334
|
+
|
|
335
|
+
<div class="p-4 bg-gray-200 dark:bg-[#121212] rounded-lg">
|
|
336
|
+
<div class="font-mono text-sm mb-2">
|
|
337
|
+
<span class="text-blue-600 dark:text-blue-400">disabled</span><span class="text-[#0a0a0a] dark:text-white">:
|
|
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>
|
|
343
|
+
</div>
|
|
344
|
+
<p class="text-sm text-gray-700 dark:text-gray-400">Whether the button is disabled</p>
|
|
345
|
+
</div>
|
|
346
|
+
|
|
347
|
+
<div class="p-4 bg-gray-200 dark:bg-[#121212] rounded-lg">
|
|
348
|
+
<div class="font-mono text-sm mb-2">
|
|
349
|
+
<span class="text-blue-600 dark:text-blue-400">loading</span><span class="text-[#0a0a0a] dark:text-white">:
|
|
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>
|
|
355
|
+
</div>
|
|
356
|
+
<p class="text-sm text-gray-700 dark:text-gray-400">Shows loading spinner when true</p>
|
|
357
|
+
</div>
|
|
358
|
+
|
|
359
|
+
<div class="p-4 bg-gray-200 dark:bg-[#121212] rounded-lg">
|
|
360
|
+
<div class="font-mono text-sm mb-2">
|
|
361
|
+
<span class="text-blue-600 dark:text-blue-400">showNotification</span><span
|
|
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>
|
|
367
|
+
</div>
|
|
368
|
+
<p class="text-sm text-gray-700 dark:text-gray-400">Shows notification badge when true</p>
|
|
369
|
+
</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
|
+
</div>
|
|
383
|
+
</section>
|
|
384
|
+
|
|
385
|
+
<!-- Under Construction -->
|
|
386
|
+
<section class="mb-8">
|
|
387
|
+
<h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">Under Construction</h2>
|
|
388
|
+
|
|
389
|
+
<div class="space-y-4">
|
|
390
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
|
|
391
|
+
<div class="flex items-center gap-2 mb-2">
|
|
392
|
+
<h3 class="text-md font-medium text-[#0a0a0a] dark:text-white">Button Variants</h3>
|
|
393
|
+
<span class="text-xs bg-yellow-500 text-black px-2 py-1 rounded">Under Construction</span>
|
|
394
|
+
</div>
|
|
395
|
+
<p class="text-sm text-gray-700 dark:text-gray-400">
|
|
396
|
+
Multiple button styles including outline, ghost, destructive, and secondary variants.
|
|
397
|
+
</p>
|
|
398
|
+
</div>
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
|
|
402
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
|
|
403
|
+
<div class="flex items-center gap-2 mb-2">
|
|
404
|
+
<h3 class="text-md font-medium text-[#0a0a0a] dark:text-white">Accessibility</h3>
|
|
405
|
+
<span class="text-xs bg-yellow-500 text-black px-2 py-1 rounded">Under Construction</span>
|
|
406
|
+
</div>
|
|
407
|
+
<p class="text-sm text-gray-700 dark:text-gray-400">
|
|
408
|
+
ARIA labels, keyboard navigation, and screen reader support for better accessibility.
|
|
409
|
+
</p>
|
|
410
|
+
</div>
|
|
411
|
+
|
|
412
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
|
|
413
|
+
<div class="flex items-center gap-2 mb-2">
|
|
414
|
+
<h3 class="text-md font-medium text-[#0a0a0a] dark:text-white">Ripple Effect</h3>
|
|
415
|
+
<span class="text-xs bg-yellow-500 text-black px-2 py-1 rounded">Under Construction</span>
|
|
416
|
+
</div>
|
|
417
|
+
<p class="text-sm text-gray-700 dark:text-gray-400">
|
|
418
|
+
Visual feedback with ripple animation on button press for enhanced user experience.
|
|
419
|
+
</p>
|
|
420
|
+
</div>
|
|
421
|
+
|
|
422
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
|
|
423
|
+
<div class="flex items-center gap-2 mb-2">
|
|
424
|
+
<h3 class="text-md font-medium text-[#0a0a0a] dark:text-white">Tooltip Support</h3>
|
|
425
|
+
<span class="text-xs bg-yellow-500 text-black px-2 py-1 rounded">Under Construction</span>
|
|
426
|
+
</div>
|
|
427
|
+
<p class="text-sm text-gray-700 dark:text-gray-400">
|
|
428
|
+
Built-in tooltip integration for providing additional context and information.
|
|
429
|
+
</p>
|
|
430
|
+
</div>
|
|
431
|
+
|
|
432
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
|
|
433
|
+
<div class="flex items-center gap-2 mb-2">
|
|
434
|
+
<h3 class="text-md font-medium text-[#0a0a0a] dark:text-white">Link Button</h3>
|
|
435
|
+
<span class="text-xs bg-yellow-500 text-black px-2 py-1 rounded">Under Construction</span>
|
|
436
|
+
</div>
|
|
437
|
+
<p class="text-sm text-gray-700 dark:text-gray-400">
|
|
438
|
+
Button that functions as a link with href support while maintaining button styling.
|
|
439
|
+
</p>
|
|
440
|
+
</div>
|
|
441
|
+
|
|
442
|
+
<div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
|
|
443
|
+
<div class="flex items-center gap-2 mb-2">
|
|
444
|
+
<h3 class="text-md font-medium text-[#0a0a0a] dark:text-white">Button Group</h3>
|
|
445
|
+
<span class="text-xs bg-yellow-500 text-black px-2 py-1 rounded">Under Construction</span>
|
|
446
|
+
</div>
|
|
447
|
+
<p class="text-sm text-gray-700 dark:text-gray-400">
|
|
448
|
+
Group multiple buttons together with proper spacing and border handling.
|
|
449
|
+
</p>
|
|
450
|
+
</div>
|
|
451
|
+
</div>
|
|
452
|
+
</section>
|
|
453
|
+
|
|
454
|
+
</div>
|
|
455
|
+
</div>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { ButtonDocs } from './button-docs';
|
|
4
4
|
|
|
5
5
|
describe('Button', () => {
|
|
6
|
-
let component:
|
|
7
|
-
let fixture: ComponentFixture<
|
|
6
|
+
let component: ButtonDocs;
|
|
7
|
+
let fixture: ComponentFixture<ButtonDocs>;
|
|
8
8
|
|
|
9
9
|
beforeEach(async () => {
|
|
10
10
|
await TestBed.configureTestingModule({
|
|
11
|
-
imports: [
|
|
11
|
+
imports: [ButtonDocs]
|
|
12
12
|
})
|
|
13
13
|
.compileComponents();
|
|
14
14
|
|
|
15
|
-
fixture = TestBed.createComponent(
|
|
15
|
+
fixture = TestBed.createComponent(ButtonDocs);
|
|
16
16
|
component = fixture.componentInstance;
|
|
17
17
|
fixture.detectChanges();
|
|
18
18
|
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Component, signal, WritableSignal } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
import { Breadcrumb, BreadcrumbItem } from '../../../components/breadcrumb/breadcrumb';
|
|
4
|
+
import { Button } from '../../../components/button/button';
|
|
5
|
+
|
|
6
|
+
import { AiPromptService } from '../../../core/services/ai-prompt.service';
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'app-button-docs',
|
|
10
|
+
imports: [
|
|
11
|
+
Button,
|
|
12
|
+
Breadcrumb
|
|
13
|
+
],
|
|
14
|
+
templateUrl: './button-docs.html',
|
|
15
|
+
styleUrl: './button-docs.css'
|
|
16
|
+
})
|
|
17
|
+
export class ButtonDocs {
|
|
18
|
+
breadcrumbItems: BreadcrumbItem[] = [
|
|
19
|
+
{ label: 'Home', url: '/' },
|
|
20
|
+
{ label: 'Components', url: '/components' },
|
|
21
|
+
{ label: 'Button' }
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
clickMessage: WritableSignal<string> = signal<string>('');
|
|
25
|
+
|
|
26
|
+
constructor(
|
|
27
|
+
private aiPromptService: AiPromptService
|
|
28
|
+
) {}
|
|
29
|
+
|
|
30
|
+
handleClick(): void {
|
|
31
|
+
this.clickMessage.set('Button clicked!');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
get claudeUrl(): string {
|
|
35
|
+
return this.aiPromptService.generateClaudeUrl();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
get chatGptUrl(): string {
|
|
39
|
+
return this.aiPromptService.generateChatGptUrl();
|
|
40
|
+
}
|
|
41
|
+
}
|