wally-ui 1.8.0 → 1.10.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.
@@ -70,6 +70,10 @@
70
70
  <wally-button [loading]="true">
71
71
  Loading
72
72
  </wally-button>
73
+ <wally-button variant="primary">Primary Button</wally-button>
74
+ <wally-button variant="secondary">Secondary Button</wally-button>
75
+ <wally-button variant="secondary" [disabled]="true">Secondary Disabled</wally-button>
76
+ <wally-button variant="secondary" [loading]="true">Secondary Loading</wally-button>
73
77
 
74
78
  <div class="w-full flex justify-center items-center gap-2">
75
79
  <div class="w-full">
@@ -134,6 +138,45 @@
134
138
  </div>
135
139
  </section>
136
140
 
141
+ <!-- Button Variants -->
142
+ <section class="mb-8">
143
+ <h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">
144
+ Button Variants
145
+ </h2>
146
+
147
+ <div class="space-y-8">
148
+ <!-- Primary Variant -->
149
+ <div>
150
+ <h3 class="text-md font-medium mb-3 text-[#0a0a0a] dark:text-white">
151
+ Primary (Default)
152
+ </h3>
153
+ <div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg mb-4">
154
+ <pre><code [innerHTML]="primaryVariantCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
155
+ </div>
156
+ <div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
157
+ <wally-button variant="primary">Primary Button</wally-button>
158
+ </div>
159
+ </div>
160
+
161
+ <!-- Secondary Variant -->
162
+ <div>
163
+ <h3 class="text-md font-medium mb-3 text-[#0a0a0a] dark:text-white">
164
+ Secondary
165
+ </h3>
166
+ <div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg mb-4">
167
+ <pre><code [innerHTML]="secondaryVariantCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
168
+ </div>
169
+ <div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
170
+ <div class="flex flex-col gap-2">
171
+ <wally-button variant="secondary">Secondary Button</wally-button>
172
+ <wally-button variant="secondary" [disabled]="true">Secondary Disabled</wally-button>
173
+ <wally-button variant="secondary" [loading]="true">Secondary Loading</wally-button>
174
+ </div>
175
+ </div>
176
+ </div>
177
+ </div>
178
+ </section>
179
+
137
180
  <!-- States -->
138
181
  <section class="mb-8">
139
182
  <h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">
@@ -287,8 +330,10 @@
287
330
  </div>
288
331
  <div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
289
332
  <wally-button ariaLabel="Save document">
290
- <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-5">
291
- <path stroke-linecap="round" stroke-linejoin="round" d="M17.593 3.322c1.1.128 1.907 1.077 1.907 2.185V21L12 17.25 4.5 21V5.507c0-1.108.806-2.057 1.907-2.185a48.507 48.507 0 0111.186 0z" />
333
+ <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
334
+ stroke="currentColor" class="size-5">
335
+ <path stroke-linecap="round" stroke-linejoin="round"
336
+ d="M17.593 3.322c1.1.128 1.907 1.077 1.907 2.185V21L12 17.25 4.5 21V5.507c0-1.108.806-2.057 1.907-2.185a48.507 48.507 0 0111.186 0z" />
292
337
  </svg>
293
338
  </wally-button>
294
339
  </div>
@@ -318,65 +363,101 @@
318
363
  Processing...
319
364
  </wally-button>
320
365
  </div>
321
- <p class="text-sm text-gray-600 dark:text-gray-400 mt-2">
322
- Automatically sets <code class="bg-gray-200 dark:bg-[#121212] px-1 py-0.5 rounded text-xs">aria-busy="true"</code> when loading
323
- </p>
324
366
  </div>
325
367
  </div>
326
368
  </section>
327
369
 
328
- <!-- Properties -->
370
+ <!-- API Reference -->
329
371
  <section class="mb-8">
330
- <h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">Properties</h2>
331
-
332
- <div class="space-y-4">
333
- <div class="space-y-2">
334
- <div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
335
- <pre><code [innerHTML]="propertyTypeCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
336
- </div>
337
- <p class="text-sm text-gray-700 dark:text-gray-400">HTML button type (button, submit, reset)</p>
338
- </div>
339
-
340
- <div class="space-y-2">
341
- <div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
342
- <pre><code [innerHTML]="propertyDisabledCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
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="space-y-2">
348
- <div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
349
- <pre><code [innerHTML]="propertyLoadingCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
350
- </div>
351
- <p class="text-sm text-gray-700 dark:text-gray-400">Shows loading spinner when true</p>
352
- </div>
353
-
354
- <div class="space-y-2">
355
- <div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
356
- <pre><code [innerHTML]="propertyShowNotificationCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
357
- </div>
358
- <p class="text-sm text-gray-700 dark:text-gray-400">Shows notification badge when true</p>
359
- </div>
360
-
361
- <div class="space-y-2">
362
- <div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
363
- <pre><code [innerHTML]="propertyAriaLabelCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
364
- </div>
365
- <p class="text-sm text-gray-700 dark:text-gray-400">Accessible label for screen readers (essential for icon-only buttons)</p>
366
- </div>
367
-
368
- <div class="space-y-2">
369
- <div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
370
- <pre><code [innerHTML]="propertyAriaPressedCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
371
- </div>
372
- <p class="text-sm text-gray-700 dark:text-gray-400">Indicates pressed state for toggle buttons</p>
372
+ <h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">API Reference</h2>
373
+
374
+ <div class="bg-white dark:bg-[#0f0f0f] border border-gray-200 dark:border-gray-800 rounded-lg overflow-hidden">
375
+ <div class="overflow-x-auto">
376
+ <table class="w-full text-sm">
377
+ <thead class="bg-gray-50 dark:bg-gray-900">
378
+ <tr>
379
+ <th class="text-left p-4 font-medium text-gray-900 dark:text-gray-100">Property</th>
380
+ <th class="text-left p-4 font-medium text-gray-900 dark:text-gray-100">Type</th>
381
+ <th class="text-left p-4 font-medium text-gray-900 dark:text-gray-100">Default</th>
382
+ <th class="text-left p-4 font-medium text-gray-900 dark:text-gray-100">Description</th>
383
+ </tr>
384
+ </thead>
385
+ <tbody class="divide-y divide-gray-200 dark:divide-gray-700">
386
+ <tr>
387
+ <td class="p-4 font-mono text-blue-600 dark:text-blue-400">type</td>
388
+ <td class="p-4 font-mono text-purple-600 dark:text-purple-400">string</td>
389
+ <td class="p-4 font-mono text-green-600 dark:text-green-400">'button'</td>
390
+ <td class="p-4 text-gray-700 dark:text-gray-300">HTML button type (button, submit, reset)</td>
391
+ </tr>
392
+ <tr>
393
+ <td class="p-4 font-mono text-blue-600 dark:text-blue-400">variant</td>
394
+ <td class="p-4 font-mono text-purple-600 dark:text-purple-400">'primary' | 'secondary'</td>
395
+ <td class="p-4 font-mono text-green-600 dark:text-green-400">'primary'</td>
396
+ <td class="p-4 text-gray-700 dark:text-gray-300">Button visual style variant</td>
397
+ </tr>
398
+ <tr>
399
+ <td class="p-4 font-mono text-blue-600 dark:text-blue-400">disabled</td>
400
+ <td class="p-4 font-mono text-purple-600 dark:text-purple-400">boolean</td>
401
+ <td class="p-4 font-mono text-green-600 dark:text-green-400">false</td>
402
+ <td class="p-4 text-gray-700 dark:text-gray-300">Whether the button is disabled</td>
403
+ </tr>
404
+ <tr>
405
+ <td class="p-4 font-mono text-blue-600 dark:text-blue-400">loading</td>
406
+ <td class="p-4 font-mono text-purple-600 dark:text-purple-400">boolean</td>
407
+ <td class="p-4 font-mono text-green-600 dark:text-green-400">false</td>
408
+ <td class="p-4 text-gray-700 dark:text-gray-300">Shows loading spinner and disables button</td>
409
+ </tr>
410
+ <tr>
411
+ <td class="p-4 font-mono text-blue-600 dark:text-blue-400">showNotification</td>
412
+ <td class="p-4 font-mono text-purple-600 dark:text-purple-400">boolean</td>
413
+ <td class="p-4 font-mono text-green-600 dark:text-green-400">false</td>
414
+ <td class="p-4 text-gray-700 dark:text-gray-300">Shows notification badge indicator</td>
415
+ </tr>
416
+ <tr>
417
+ <td class="p-4 font-mono text-blue-600 dark:text-blue-400">ariaLabel</td>
418
+ <td class="p-4 font-mono text-purple-600 dark:text-purple-400">string</td>
419
+ <td class="p-4 font-mono text-green-600 dark:text-green-400">''</td>
420
+ <td class="p-4 text-gray-700 dark:text-gray-300">Accessible label for screen readers (essential for icon-only buttons)</td>
421
+ </tr>
422
+ <tr>
423
+ <td class="p-4 font-mono text-blue-600 dark:text-blue-400">ariaPressed</td>
424
+ <td class="p-4 font-mono text-purple-600 dark:text-purple-400">boolean | undefined</td>
425
+ <td class="p-4 font-mono text-green-600 dark:text-green-400">undefined</td>
426
+ <td class="p-4 text-gray-700 dark:text-gray-300">Indicates pressed state for toggle buttons</td>
427
+ </tr>
428
+ <tr>
429
+ <td class="p-4 font-mono text-blue-600 dark:text-blue-400">ariaDescribedBy</td>
430
+ <td class="p-4 font-mono text-purple-600 dark:text-purple-400">string</td>
431
+ <td class="p-4 font-mono text-green-600 dark:text-green-400">''</td>
432
+ <td class="p-4 text-gray-700 dark:text-gray-300">References element(s) that describe the button</td>
433
+ </tr>
434
+ </tbody>
435
+ </table>
373
436
  </div>
437
+ </div>
374
438
 
375
- <div class="space-y-2">
376
- <div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
377
- <pre><code [innerHTML]="propertyAriaDescribedByCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
439
+ <!-- Events Table -->
440
+ <div class="mt-6">
441
+ <h3 class="text-md font-medium mb-4 text-[#0a0a0a] dark:text-white">Events</h3>
442
+ <div class="bg-white dark:bg-[#0f0f0f] border border-gray-200 dark:border-gray-800 rounded-lg overflow-hidden">
443
+ <div class="overflow-x-auto">
444
+ <table class="w-full text-sm">
445
+ <thead class="bg-gray-50 dark:bg-gray-900">
446
+ <tr>
447
+ <th class="text-left p-4 font-medium text-gray-900 dark:text-gray-100">Event</th>
448
+ <th class="text-left p-4 font-medium text-gray-900 dark:text-gray-100">Payload</th>
449
+ <th class="text-left p-4 font-medium text-gray-900 dark:text-gray-100">Description</th>
450
+ </tr>
451
+ </thead>
452
+ <tbody>
453
+ <tr>
454
+ <td class="p-4 font-mono text-blue-600 dark:text-blue-400">click</td>
455
+ <td class="p-4 font-mono text-purple-600 dark:text-purple-400">void</td>
456
+ <td class="p-4 text-gray-700 dark:text-gray-300">Emitted when button is clicked</td>
457
+ </tr>
458
+ </tbody>
459
+ </table>
378
460
  </div>
379
- <p class="text-sm text-gray-700 dark:text-gray-400">References element(s) that describe the button</p>
380
461
  </div>
381
462
  </div>
382
463
  </section>
@@ -388,11 +469,11 @@
388
469
  <div class="space-y-4">
389
470
  <div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
390
471
  <div class="flex items-center gap-2 mb-2">
391
- <h3 class="text-md font-medium text-[#0a0a0a] dark:text-white">Button Variants</h3>
472
+ <h3 class="text-md font-medium text-[#0a0a0a] dark:text-white">Additional Button Variants</h3>
392
473
  <span class="text-xs bg-yellow-500 text-black px-2 py-1 rounded">Under Construction</span>
393
474
  </div>
394
475
  <p class="text-sm text-gray-700 dark:text-gray-400">
395
- Multiple button styles including outline, ghost, destructive, and secondary variants.
476
+ Additional button styles including outline, ghost, and destructive variants.
396
477
  </p>
397
478
  </div>
398
479
 
@@ -29,6 +29,10 @@ export class ButtonDocs {
29
29
  importCode = getFormattedCode(ButtonCodeExamples.import, 'typescript');
30
30
  componentImportCode = getFormattedCode(ButtonCodeExamples.componentImport, 'typescript');
31
31
  basicUsageTemplateCode = getFormattedCode(ButtonCodeExamples.basicUsage, 'html');
32
+
33
+ // Variants
34
+ primaryVariantCode = getFormattedCode(ButtonCodeExamples.primaryVariant, 'html');
35
+ secondaryVariantCode = getFormattedCode(ButtonCodeExamples.secondaryVariant, 'html');
32
36
  disabledCode = getFormattedCode(ButtonCodeExamples.disabled, 'html');
33
37
  loadingCode = getFormattedCode(ButtonCodeExamples.loading, 'html');
34
38
  notificationCode = getFormattedCode(ButtonCodeExamples.notification, 'html');
@@ -18,6 +18,45 @@ export const CarouselCodeExamples = {
18
18
  <div>Item 2</div>
19
19
  </wally-carousel>`,
20
20
 
21
+ // With navigation indicators
22
+ withNavigationIndicators: `<wally-carousel [isNavigationIndicator]="true">
23
+ <div>Item 1</div>
24
+ <div>Item 2</div>
25
+ </wally-carousel>`,
26
+
27
+ // Image carousel
28
+ imageCarousel: `<div class="w-full h-80">
29
+ <wally-carousel>
30
+ <div class="w-full h-full">
31
+ <img src="/api/placeholder/600/320" alt="Image 1" class="w-full h-full object-cover">
32
+ </div>
33
+ <div class="w-full h-full">
34
+ <img src="/api/placeholder/600/320" alt="Image 2" class="w-full h-full object-cover">
35
+ </div>
36
+ <div class="w-full h-full">
37
+ <img src="/api/placeholder/600/320" alt="Image 3" class="w-full h-full object-cover">
38
+ </div>
39
+ </wally-carousel>
40
+ </div>`,
41
+
42
+ // Product showcase
43
+ productShowcase: `<div class="w-full h-96">
44
+ <wally-carousel>
45
+ <div class="w-full h-full bg-white border-2 border-gray-200 rounded-lg p-6 flex flex-col items-center justify-center">
46
+ <div class="w-20 h-20 bg-blue-500 rounded-lg mb-4"></div>
47
+ <h3 class="text-lg font-semibold text-gray-900">Product A</h3>
48
+ <p class="text-gray-600 text-center">Amazing features and benefits</p>
49
+ <span class="text-xl font-bold text-blue-600 mt-2">$99</span>
50
+ </div>
51
+ <div class="w-full h-full bg-white border-2 border-gray-200 rounded-lg p-6 flex flex-col items-center justify-center">
52
+ <div class="w-20 h-20 bg-green-500 rounded-lg mb-4"></div>
53
+ <h3 class="text-lg font-semibold text-gray-900">Product B</h3>
54
+ <p class="text-gray-600 text-center">Premium quality guaranteed</p>
55
+ <span class="text-xl font-bold text-green-600 mt-2">$149</span>
56
+ </div>
57
+ </wally-carousel>
58
+ </div>`,
59
+
21
60
  // Custom content example
22
61
  customContent: `<wally-carousel>
23
62
  <div class="w-full h-full bg-gradient-to-r from-blue-500 to-purple-600 text-white flex flex-col items-center justify-center p-6">
@@ -30,19 +69,64 @@ export const CarouselCodeExamples = {
30
69
  </div>
31
70
  </wally-carousel>`,
32
71
 
33
- // Properties
34
- properties: `// Component properties
35
- // The carousel automatically detects child elements and creates navigation
36
- // Currently no input properties - content projection only
37
-
38
- // Available interactions:
39
- // Click navigation buttons (Previous/Next)
40
- // Click dot indicators for direct navigation
41
- // • Touch/swipe gestures on mobile and desktop
42
- // • Keyboard navigation (Arrow keys, Home, End)
43
-
44
- // Auto-detected features:
45
- totalItemsCount: number; // Automatically set based on child elements
46
- currentVisibleItemIndex: number; // Currently visible slide index (0-based)
47
- navigationDotsArray: any[]; // Auto-generated dot indicators`
72
+ // Responsive design example
73
+ responsiveExample: `<!-- Different sizes for different use cases -->
74
+
75
+ <!-- Hero carousel - full width, tall -->
76
+ <div class="w-full h-96">
77
+ <wally-carousel>
78
+ <div>Hero slide 1</div>
79
+ <div>Hero slide 2</div>
80
+ </wally-carousel>
81
+ </div>
82
+
83
+ <!-- Product gallery - square aspect ratio -->
84
+ <div class="w-full aspect-square max-w-md">
85
+ <wally-carousel>
86
+ <div>Product image 1</div>
87
+ <div>Product image 2</div>
88
+ </wally-carousel>
89
+ </div>
90
+
91
+ <!-- Mobile testimonials - compact -->
92
+ <div class="w-full h-48 sm:h-64">
93
+ <wally-carousel>
94
+ <div>Testimonial 1</div>
95
+ <div>Testimonial 2</div>
96
+ </wally-carousel>
97
+ </div>`,
98
+
99
+ // Individual properties
100
+ propertyIsNavigationIndicator: `isNavigationIndicator: InputSignal<boolean> = input<boolean>(false);`,
101
+ propertyTotalItemsCount: `totalItemsCount: number (read-only);`,
102
+ propertyCurrentVisibleItemIndex: `currentVisibleItemIndex: number (read-only);`,
103
+ propertyNavigationIndicatorsArray: `navigationIndicatorsArray: any[] (read-only);`,
104
+
105
+ // API Methods
106
+ apiMethods: `// Public navigation methods
107
+ navigateToNextItem(): void; // Go to next slide
108
+ navigateToPreviousItem(): void; // Go to previous slide
109
+ navigateToSpecificItem(index: number): void; // Jump to specific slide
110
+
111
+ // Public calculation methods
112
+ calculateNextItemIndex(current: number): number; // Get next index
113
+ calculatePreviousItemIndex(current: number): number; // Get previous index
114
+
115
+ // Public positioning methods
116
+ updateItemElementPosition(element: HTMLElement, index: number): void;
117
+ updateAllItemElementPositions(): void;`,
118
+
119
+ // Keyboard shortcuts
120
+ keyboardShortcuts: `// Keyboard navigation (when carousel is focused)
121
+ ArrowLeft → Previous slide
122
+ ArrowRight → Next slide
123
+ Home → First slide
124
+ End → Last slide`,
125
+
126
+ // Touch gestures
127
+ touchGestures: `// Touch and mouse gestures
128
+ Swipe Left → Next slide
129
+ Swipe Right → Previous slide
130
+ Click Dots → Jump to specific slide
131
+ Drag → Same as swipe (desktop)`
48
132
  };