wally-ui 1.2.1 → 1.3.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.
Files changed (41) hide show
  1. package/package.json +1 -1
  2. package/playground/showcase/package-lock.json +18 -0
  3. package/playground/showcase/package.json +2 -0
  4. package/playground/showcase/public/_headers +7 -0
  5. package/playground/showcase/public/robots.txt +14 -0
  6. package/playground/showcase/src/app/app.routes.server.ts +14 -2
  7. package/playground/showcase/src/app/app.routes.ts +5 -1
  8. package/playground/showcase/src/app/components/input/input.html +27 -0
  9. package/playground/showcase/src/app/{pages/components/button-docs/button-docs.spec.ts → components/input/input.spec.ts} +6 -6
  10. package/playground/showcase/src/app/components/input/input.ts +78 -0
  11. package/playground/showcase/src/app/core/services/ai-prompt.service.ts +2 -2
  12. package/playground/showcase/src/app/core/utils/prism.ts +14 -0
  13. package/playground/showcase/src/app/pages/documentation/components/breadcrumb-docs/breadcrumb-docs.examples.ts +71 -0
  14. package/playground/showcase/src/app/pages/{components → documentation/components}/breadcrumb-docs/breadcrumb-docs.html +13 -43
  15. package/playground/showcase/src/app/pages/documentation/components/breadcrumb-docs/breadcrumb-docs.ts +63 -0
  16. package/playground/showcase/src/app/pages/documentation/components/button-docs/button-docs.examples.ts +55 -0
  17. package/playground/showcase/src/app/pages/{components → documentation/components}/button-docs/button-docs.html +26 -101
  18. package/playground/showcase/src/app/pages/documentation/components/button-docs/button-docs.ts +64 -0
  19. package/playground/showcase/src/app/pages/documentation/components/components.css +0 -0
  20. package/playground/showcase/src/app/pages/documentation/components/components.html +63 -0
  21. package/playground/showcase/src/app/pages/{components → documentation/components}/components.routes.ts +4 -0
  22. package/playground/showcase/src/app/pages/{components → documentation/components}/components.ts +3 -1
  23. package/playground/showcase/src/app/pages/documentation/components/input-docs/input-docs.css +13 -0
  24. package/playground/showcase/src/app/pages/documentation/components/input-docs/input-docs.examples.ts +78 -0
  25. package/playground/showcase/src/app/pages/documentation/components/input-docs/input-docs.html +315 -0
  26. package/playground/showcase/src/app/pages/documentation/components/input-docs/input-docs.ts +95 -0
  27. package/playground/showcase/src/app/pages/documentation/documentation.css +0 -0
  28. package/playground/showcase/src/app/pages/{components/components.html → documentation/documentation.html} +70 -43
  29. package/playground/showcase/src/app/pages/documentation/documentation.routes.ts +12 -0
  30. package/playground/showcase/src/app/pages/documentation/documentation.ts +16 -0
  31. package/playground/showcase/src/app/pages/home/home.html +9 -4
  32. package/playground/showcase/src/app/pages/home/home.ts +1 -3
  33. package/playground/showcase/src/app/pages/mcp/mcp.html +1 -1
  34. package/playground/showcase/src/index.html +4 -1
  35. package/playground/showcase/src/styles.css +547 -1
  36. package/playground/showcase/src/app/pages/components/breadcrumb-docs/breadcrumb-docs.ts +0 -43
  37. package/playground/showcase/src/app/pages/components/button-docs/button-docs.ts +0 -41
  38. package/playground/showcase/src/app/pages/components/components.spec.ts +0 -23
  39. /package/playground/showcase/src/app/{pages/components/breadcrumb-docs/breadcrumb-docs.css → components/input/input.css} +0 -0
  40. /package/playground/showcase/src/app/pages/{components/button-docs/button-docs.css → documentation/components/breadcrumb-docs/breadcrumb-docs.css} +0 -0
  41. /package/playground/showcase/src/app/pages/{components/components.css → documentation/components/button-docs/button-docs.css} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wally-ui",
3
- "version": "1.2.1",
3
+ "version": "1.3.0",
4
4
  "description": "About Where’s Wally? Right here — bringing you ready-to-use Angular components with Wally-UI. Stop searching, start building.",
5
5
  "bin": {
6
6
  "wally": "dist/cli.js"
@@ -19,6 +19,7 @@
19
19
  "@tailwindcss/postcss": "^4.1.13",
20
20
  "express": "^5.1.0",
21
21
  "postcss": "^8.5.6",
22
+ "prismjs": "^1.30.0",
22
23
  "rxjs": "~7.8.0",
23
24
  "tailwindcss": "^4.1.13",
24
25
  "tslib": "^2.3.0",
@@ -31,6 +32,7 @@
31
32
  "@types/express": "^5.0.1",
32
33
  "@types/jasmine": "~5.1.0",
33
34
  "@types/node": "^20.17.19",
35
+ "@types/prismjs": "^1.26.5",
34
36
  "jasmine-core": "~5.7.0",
35
37
  "karma": "~6.4.0",
36
38
  "karma-chrome-launcher": "~3.2.0",
@@ -4252,6 +4254,13 @@
4252
4254
  "undici-types": "~6.21.0"
4253
4255
  }
4254
4256
  },
4257
+ "node_modules/@types/prismjs": {
4258
+ "version": "1.26.5",
4259
+ "resolved": "https://registry.npmjs.org/@types/prismjs/-/prismjs-1.26.5.tgz",
4260
+ "integrity": "sha512-AUZTa7hQ2KY5L7AmtSiqxlhWxb4ina0yd8hNbl4TWuqnv/pFP0nDMb3YrfSBf4hJVGLh2YEIBfKaBW/9UEl6IQ==",
4261
+ "dev": true,
4262
+ "license": "MIT"
4263
+ },
4255
4264
  "node_modules/@types/qs": {
4256
4265
  "version": "6.14.0",
4257
4266
  "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.14.0.tgz",
@@ -8815,6 +8824,15 @@
8815
8824
  "dev": true,
8816
8825
  "license": "MIT"
8817
8826
  },
8827
+ "node_modules/prismjs": {
8828
+ "version": "1.30.0",
8829
+ "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.30.0.tgz",
8830
+ "integrity": "sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw==",
8831
+ "license": "MIT",
8832
+ "engines": {
8833
+ "node": ">=6"
8834
+ }
8835
+ },
8818
8836
  "node_modules/proc-log": {
8819
8837
  "version": "5.0.0",
8820
8838
  "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-5.0.0.tgz",
@@ -32,6 +32,7 @@
32
32
  "@tailwindcss/postcss": "^4.1.13",
33
33
  "express": "^5.1.0",
34
34
  "postcss": "^8.5.6",
35
+ "prismjs": "^1.30.0",
35
36
  "rxjs": "~7.8.0",
36
37
  "tailwindcss": "^4.1.13",
37
38
  "tslib": "^2.3.0",
@@ -44,6 +45,7 @@
44
45
  "@types/express": "^5.0.1",
45
46
  "@types/jasmine": "~5.1.0",
46
47
  "@types/node": "^20.17.19",
48
+ "@types/prismjs": "^1.26.5",
47
49
  "jasmine-core": "~5.7.0",
48
50
  "karma": "~6.4.0",
49
51
  "karma-chrome-launcher": "~3.2.0",
@@ -0,0 +1,7 @@
1
+ /*
2
+ X-Robots-Tag: index, follow
3
+ X-Frame-Options: DENY
4
+ X-Content-Type-Options: nosniff
5
+
6
+ /robots.txt
7
+ Cache-Control: public, max-age=3600
@@ -0,0 +1,14 @@
1
+ User-agent: *
2
+ Allow: /
3
+
4
+ User-agent: Googlebot
5
+ Allow: /
6
+
7
+ User-agent: Bingbot
8
+ Allow: /
9
+
10
+ User-agent: claudebot
11
+ Allow: /
12
+
13
+ User-agent: ChatGPT-User
14
+ Allow: /
@@ -6,11 +6,23 @@ export const serverRoutes: ServerRoute[] = [
6
6
  renderMode: RenderMode.Prerender
7
7
  },
8
8
  {
9
- path: 'components',
9
+ path: 'documentation',
10
+ renderMode: RenderMode.Prerender,
11
+ },
12
+ {
13
+ path: 'documentation/components',
10
14
  renderMode: RenderMode.Prerender,
11
15
  },
12
16
  {
13
- path: 'components/button',
17
+ path: 'documentation/components/button',
18
+ renderMode: RenderMode.Prerender,
19
+ },
20
+ {
21
+ path: 'documentation/components/breadcrumb',
22
+ renderMode: RenderMode.Prerender,
23
+ },
24
+ {
25
+ path: 'components',
14
26
  renderMode: RenderMode.Prerender,
15
27
  },
16
28
  {
@@ -5,9 +5,13 @@ export const routes: Routes = [
5
5
  path: '',
6
6
  loadComponent: () => import('./pages/home/home').then(m => m.Home)
7
7
  },
8
+ {
9
+ path: 'documentation',
10
+ loadChildren: () => import('./pages/documentation/documentation.routes').then(m => m.documentationRoutes)
11
+ },
8
12
  {
9
13
  path: 'components',
10
- loadChildren: () => import('./pages/components/components.routes').then(m => m.componentsRoutes)
14
+ redirectTo: '/documentation/components'
11
15
  },
12
16
  {
13
17
  path: 'mcp',
@@ -0,0 +1,27 @@
1
+ <div class="relative">
2
+ <!--
3
+ ps-11 pe-9 - add padding when there is an icon
4
+ -->
5
+ <input [type]="type()" [value]="value()" [disabled]="disabled" [placeholder]="placeholder()" class="
6
+ font-semibold
7
+ block
8
+ w-full
9
+ bg-gray-100
10
+ rounded-lg
11
+ text-base md:text-sm
12
+ focus:outline-none focus:ring-2 focus:ring-gray-300
13
+ dark:bg-[#191919] dark:text-white dark:placeholder:text-gray-400 dark:focus:ring-gray-400
14
+ disabled:opacity-85 disabled:pointer-events-none
15
+ py-4 px-4
16
+ ">
17
+
18
+ <!-- <div
19
+ class="absolute inset-y-0 start-0 flex items-center pointer-events-none ps-4 peer-disabled:opacity-50 peer-disabled:pointer-events-none">
20
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"
21
+ class="flex-shrink-0 size-4 text-gray-500">
22
+ <path fill-rule="evenodd"
23
+ d="M1.5 4.5a3 3 0 0 1 3-3h1.372c.86 0 1.61.586 1.819 1.42l1.105 4.423a1.875 1.875 0 0 1-.694 1.955l-1.293.97c-.135.101-.164.249-.126.352a11.285 11.285 0 0 0 6.697 6.697c.103.038.25.009.352-.126l.97-1.293a1.875 1.875 0 0 1 1.955-.694l4.423 1.105c.834.209 1.42.959 1.42 1.82V19.5a3 3 0 0 1-3 3h-2.25C8.552 22.5 1.5 15.448 1.5 6.75V4.5Z"
24
+ clip-rule="evenodd" />
25
+ </svg>
26
+ </div> -->
27
+ </div>
@@ -1,18 +1,18 @@
1
1
  import { ComponentFixture, TestBed } from '@angular/core/testing';
2
2
 
3
- import { ButtonDocs } from './button-docs';
3
+ import { Input } from './input';
4
4
 
5
- describe('Button', () => {
6
- let component: ButtonDocs;
7
- let fixture: ComponentFixture<ButtonDocs>;
5
+ describe('Input', () => {
6
+ let component: Input;
7
+ let fixture: ComponentFixture<Input>;
8
8
 
9
9
  beforeEach(async () => {
10
10
  await TestBed.configureTestingModule({
11
- imports: [ButtonDocs]
11
+ imports: [Input]
12
12
  })
13
13
  .compileComponents();
14
14
 
15
- fixture = TestBed.createComponent(ButtonDocs);
15
+ fixture = TestBed.createComponent(Input);
16
16
  component = fixture.componentInstance;
17
17
  fixture.detectChanges();
18
18
  });
@@ -0,0 +1,78 @@
1
+ import { Component, effect, forwardRef, HostListener, input, InputSignal, model, signal, untracked, WritableSignal } from '@angular/core';
2
+
3
+ import {
4
+ ControlValueAccessor,
5
+ NG_VALUE_ACCESSOR
6
+ } from '@angular/forms';
7
+
8
+ @Component({
9
+ selector: 'wally-input',
10
+ imports: [],
11
+ templateUrl: './input.html',
12
+ styleUrl: './input.css',
13
+ providers: [
14
+ {
15
+ provide: NG_VALUE_ACCESSOR,
16
+ useExisting: Input,
17
+ multi: true
18
+ }
19
+ ]
20
+ })
21
+ export class Input implements ControlValueAccessor {
22
+ type: WritableSignal<string> = signal<string>('text');
23
+ // disabled: WritableSignal<boolean> = signal<boolean>(false);
24
+ disabled = false;
25
+ loading: WritableSignal<boolean> = signal<boolean>(false);
26
+
27
+ placeholder: InputSignal<string> = input<string>('');
28
+
29
+ value = signal<string>('');
30
+
31
+ private touched = signal<boolean>(false);
32
+
33
+ private onChange = (value: any) => { };
34
+ private onTouched = () => { };
35
+
36
+ constructor() {
37
+ effect(() => {
38
+ const currentValue = this.value();
39
+ this.onChange(currentValue)
40
+ });
41
+ }
42
+
43
+ writeValue(obj: any): void {
44
+ untracked(() => {
45
+ this.value.set(obj || '');
46
+ })
47
+ }
48
+
49
+ registerOnChange(fn: any): void {
50
+ this.onChange = fn;
51
+ }
52
+
53
+ registerOnTouched(fn: any): void {
54
+ this.onTouched = fn;
55
+ }
56
+
57
+ setDisabledState?(isDisabled: boolean): void {
58
+ this.disabled = isDisabled;
59
+ }
60
+
61
+ @HostListener('input', ['$event'])
62
+ onInputChange(event: Event): void {
63
+ const target = event.target as HTMLInputElement;
64
+ this.value.set(target.value);
65
+ }
66
+
67
+ @HostListener('blur')
68
+ onInputBlur(): void {
69
+ if (!this.touched()) {
70
+ this.touched.set(true);
71
+ this.onTouched();
72
+ }
73
+ }
74
+
75
+ onInputFocus(): void {
76
+
77
+ }
78
+ }
@@ -26,8 +26,8 @@ export class AiPromptService {
26
26
  if (isPlatformBrowser(this.platformId)) {
27
27
  return window.location.href;
28
28
  }
29
- // Fallback for SSR - you can customize this
30
- return 'https://wally-ui.com/components/button';
29
+
30
+ return 'https://wally-ui.com/documentation/components/button';
31
31
  }
32
32
 
33
33
  generateCustomPromptUrl(aiService: 'claude' | 'chatgpt', customPrompt: string, pageUrl?: string): string {
@@ -0,0 +1,14 @@
1
+ import * as Prism from 'prismjs';
2
+ import 'prismjs/components/prism-typescript';
3
+ import 'prismjs/components/prism-javascript';
4
+ import 'prismjs/components/prism-bash';
5
+ import 'prismjs/components/prism-markup';
6
+
7
+ export function highlightCode(code: string, language: string = 'typescript'): string {
8
+ return Prism.highlight(code, Prism.languages[language], language);
9
+ }
10
+
11
+ export function getFormattedCode(code: string, language: string = 'html'): string {
12
+ const cleanCode = code.trim();
13
+ return highlightCode(cleanCode, language);
14
+ }
@@ -0,0 +1,71 @@
1
+ // Breadcrumb documentation code examples
2
+ export const BreadcrumbCodeExamples = {
3
+ // Installation
4
+ installation: `npx wally-ui add breadcrumb`,
5
+
6
+ // Import examples
7
+ import: `import { Breadcrumb, BreadcrumbItem } from './components/wally-ui/breadcrumb/breadcrumb';`,
8
+ componentImport: `@Component({
9
+ selector: 'app-example',
10
+ imports: [Breadcrumb],
11
+ templateUrl: './example.html',
12
+ styleUrl: './example.css'
13
+ })`,
14
+
15
+ // Basic usage
16
+ basicUsage: `<wally-breadcrumb [items]="breadcrumbItems"></wally-breadcrumb>`,
17
+
18
+ // Component setup
19
+ componentSetup: `export class ExampleComponent {
20
+ breadcrumbItems: BreadcrumbItem[] = [
21
+ { label: 'Home', url: '/' },
22
+ { label: 'Products', url: '/products' },
23
+ { label: 'Category' }
24
+ ];
25
+ }`,
26
+
27
+ // Basic setup for simple example
28
+ basicSetup: `breadcrumbItems: BreadcrumbItem[] = [
29
+ { label: 'Components' }
30
+ ];`,
31
+
32
+ // Specific examples
33
+ multiLevelSetup: `breadcrumbItems: BreadcrumbItem[] = [
34
+ { label: 'Home', url: '/' },
35
+ { label: 'Documentation', url: '/documentation' },
36
+ { label: 'Components', url: '/documentation/components' },
37
+ { label: 'Breadcrumb' }
38
+ ];`,
39
+
40
+ singleItemSetup: `breadcrumbItems: BreadcrumbItem[] = [
41
+ { label: 'Components' }
42
+ ];`,
43
+
44
+ // Interface
45
+ interface: `interface BreadcrumbItem {
46
+ label: string;
47
+ url?: string;
48
+ }`,
49
+
50
+ // Advanced examples
51
+ withIcons: `<wally-breadcrumb [items]="breadcrumbItemsWithIcons"></wally-breadcrumb>`,
52
+
53
+ withIconsSetup: `breadcrumbItemsWithIcons: BreadcrumbItem[] = [
54
+ {
55
+ label: 'Home',
56
+ url: '/',
57
+ icon: '<svg>...</svg>'
58
+ },
59
+ {
60
+ label: 'Settings',
61
+ url: '/settings',
62
+ icon: '<svg>...</svg>'
63
+ },
64
+ { label: 'Profile' }
65
+ ];`,
66
+
67
+ // Properties
68
+ propertyItems: `items: BreadcrumbItem[] = [];`,
69
+ propertySeparator: `separator?: string = '/';`,
70
+ propertyMaxItems: `maxItems?: number;`
71
+ };
@@ -47,9 +47,7 @@
47
47
  <section class="mb-8">
48
48
  <h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">Installation</h2>
49
49
  <div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
50
- <code class="text-sm text-[#0a0a0a] dark:text-white">
51
- npx wally-ui add breadcrumb
52
- </code>
50
+ <pre><code [innerHTML]="installationCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
53
51
  </div>
54
52
  </section>
55
53
 
@@ -70,20 +68,11 @@
70
68
  <h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">Import</h2>
71
69
  <div class="space-y-4">
72
70
  <div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
73
- <code class="text-sm text-[#0a0a0a] dark:text-white">
74
- import {{ '{' }} Breadcrumb, BreadcrumbItem {{ '}' }} from './components/wally-ui/breadcrumb/breadcrumb';
75
- </code>
71
+ <pre><code [innerHTML]="importCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
76
72
  </div>
77
73
 
78
74
  <div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
79
- <code class="text-sm text-[#0a0a0a] dark:text-white">
80
- &#64;Component({{ '{' }}<br>
81
- &nbsp;&nbsp;selector: 'app-example',<br>
82
- &nbsp;&nbsp;imports: [Breadcrumb],<br>
83
- &nbsp;&nbsp;templateUrl: './example.html',<br>
84
- &nbsp;&nbsp;styleUrl: './example.css'<br>
85
- {{ '}' }})
86
- </code>
75
+ <pre><code [innerHTML]="componentImportCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
87
76
  </div>
88
77
  </div>
89
78
  </section>
@@ -95,9 +84,10 @@
95
84
  <div class="space-y-8">
96
85
  <div>
97
86
  <div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg mb-4">
98
- <code class="text-sm text-[#0a0a0a] dark:text-white">
99
- {{ '<' }}wally-breadcrumb [items]="breadcrumbItems"{{ '>' }}{{ '<' }}/wally-breadcrumb{{ '>' }}
100
- </code>
87
+ <pre><code [innerHTML]="basicSetupCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
88
+ </div>
89
+ <div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg mb-4">
90
+ <pre><code [innerHTML]="basicUsageCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
101
91
  </div>
102
92
  <div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
103
93
  <wally-breadcrumb [items]="simpleBreadcrumbs"></wally-breadcrumb>
@@ -115,13 +105,7 @@
115
105
  <div>
116
106
  <h3 class="text-md font-medium mb-3 text-[#0a0a0a] dark:text-white">Multi-level Navigation</h3>
117
107
  <div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg mb-4">
118
- <code class="text-sm text-[#0a0a0a] dark:text-white">
119
- breadcrumbItems: BreadcrumbItem[] = [<br>
120
- &nbsp;&nbsp;{{ '{' }} label: 'Home', url: '/' {{ '}' }},<br>
121
- &nbsp;&nbsp;{{ '{' }} label: 'Components', url: '/components' {{ '}' }},<br>
122
- &nbsp;&nbsp;{{ '{' }} label: 'Button' {{ '}' }}<br>
123
- ];
124
- </code>
108
+ <pre><code [innerHTML]="multiLevelSetupCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
125
109
  </div>
126
110
  <div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
127
111
  <wally-breadcrumb [items]="exampleBreadcrumbs"></wally-breadcrumb>
@@ -132,11 +116,7 @@
132
116
  <div>
133
117
  <h3 class="text-md font-medium mb-3 text-[#0a0a0a] dark:text-white">Single Item</h3>
134
118
  <div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg mb-4">
135
- <code class="text-sm text-[#0a0a0a] dark:text-white">
136
- breadcrumbItems: BreadcrumbItem[] = [<br>
137
- &nbsp;&nbsp;{{ '{' }} label: 'Components' {{ '}' }}<br>
138
- ];
139
- </code>
119
+ <pre><code [innerHTML]="singleItemSetupCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
140
120
  </div>
141
121
  <div class="p-6 border rounded-lg bg-white dark:bg-[#121212]">
142
122
  <wally-breadcrumb [items]="simpleBreadcrumbs"></wally-breadcrumb>
@@ -150,14 +130,9 @@
150
130
  <h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">Properties</h2>
151
131
 
152
132
  <div class="space-y-4">
153
- <div class="p-4 bg-gray-200 dark:bg-[#121212] rounded-lg">
154
- <div class="font-mono text-sm mb-2">
155
- <span class="text-blue-600 dark:text-blue-400">items</span><span class="text-[#0a0a0a] dark:text-white">:
156
- </span>
157
- <span class="text-purple-600 dark:text-purple-400">BreadcrumbItem[]</span> <span
158
- class="text-[#0a0a0a] dark:text-white"> = </span>
159
- <span class="text-green-600 dark:text-green-400">[]</span>
160
- <span class="text-[#0a0a0a] dark:text-white">;</span>
133
+ <div class="space-y-2">
134
+ <div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
135
+ <pre><code [innerHTML]="propertyItemsCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
161
136
  </div>
162
137
  <p class="text-sm text-gray-700 dark:text-gray-400">Array of breadcrumb items to display</p>
163
138
  </div>
@@ -169,12 +144,7 @@
169
144
  <h2 class="text-lg font-semibold mb-4 text-[#0a0a0a] dark:text-white">Interface</h2>
170
145
 
171
146
  <div class="bg-gray-200 dark:bg-[#121212] p-4 rounded-lg">
172
- <code class="text-sm text-[#0a0a0a] dark:text-white">
173
- interface BreadcrumbItem {{ '{' }}<br>
174
- &nbsp;&nbsp;label: string;<br>
175
- &nbsp;&nbsp;url?: string;<br>
176
- {{ '}' }}
177
- </code>
147
+ <pre><code [innerHTML]="interfaceCode" class="text-sm text-[#0a0a0a] dark:text-white"></code></pre>
178
148
  </div>
179
149
  </section>
180
150
 
@@ -0,0 +1,63 @@
1
+ import { Component } from '@angular/core';
2
+
3
+ import { Breadcrumb, BreadcrumbItem } from '../../../../components/breadcrumb/breadcrumb';
4
+
5
+ import { AiPromptService } from '../../../../core/services/ai-prompt.service';
6
+ import { getFormattedCode } from '../../../../core/utils/prism';
7
+
8
+ import { BreadcrumbCodeExamples } from './breadcrumb-docs.examples';
9
+
10
+ @Component({
11
+ selector: 'app-breadcrumb-docs',
12
+ imports: [
13
+ Breadcrumb
14
+ ],
15
+ templateUrl: './breadcrumb-docs.html',
16
+ styleUrl: './breadcrumb-docs.css'
17
+ })
18
+ export class BreadcrumbDocs {
19
+ breadcrumbItems: BreadcrumbItem[] = [
20
+ { label: 'Home', url: '/' },
21
+ { label: 'Documentation', url: '/documentation' },
22
+ { label: 'Components', url: '/documentation/components' },
23
+ { label: 'Breadcrumb' }
24
+ ];
25
+
26
+ exampleBreadcrumbs: BreadcrumbItem[] = [
27
+ { label: 'Home', url: '/' },
28
+ { label: 'Documentation', url: '/documentation' },
29
+ { label: 'Components', url: '/documentation/components' },
30
+ { label: 'Breadcrumb' }
31
+ ];
32
+
33
+ simpleBreadcrumbs: BreadcrumbItem[] = [
34
+ { label: 'Components' }
35
+ ];
36
+
37
+ installationCode = getFormattedCode(BreadcrumbCodeExamples.installation, 'bash');
38
+ importCode = getFormattedCode(BreadcrumbCodeExamples.import, 'typescript');
39
+ componentImportCode = getFormattedCode(BreadcrumbCodeExamples.componentImport, 'typescript');
40
+ basicUsageCode = getFormattedCode(BreadcrumbCodeExamples.basicUsage, 'html');
41
+ componentSetupCode = getFormattedCode(BreadcrumbCodeExamples.componentSetup, 'typescript');
42
+ basicSetupCode = getFormattedCode(BreadcrumbCodeExamples.basicSetup, 'typescript');
43
+ multiLevelSetupCode = getFormattedCode(BreadcrumbCodeExamples.multiLevelSetup, 'typescript');
44
+ singleItemSetupCode = getFormattedCode(BreadcrumbCodeExamples.singleItemSetup, 'typescript');
45
+ interfaceCode = getFormattedCode(BreadcrumbCodeExamples.interface, 'typescript');
46
+ withIconsCode = getFormattedCode(BreadcrumbCodeExamples.withIcons, 'html');
47
+ withIconsSetupCode = getFormattedCode(BreadcrumbCodeExamples.withIconsSetup, 'typescript');
48
+ propertyItemsCode = getFormattedCode(BreadcrumbCodeExamples.propertyItems, 'typescript');
49
+ propertySeparatorCode = getFormattedCode(BreadcrumbCodeExamples.propertySeparator, 'typescript');
50
+ propertyMaxItemsCode = getFormattedCode(BreadcrumbCodeExamples.propertyMaxItems, 'typescript');
51
+
52
+ constructor(
53
+ private aiPromptService: AiPromptService
54
+ ) { }
55
+
56
+ get claudeUrl(): string {
57
+ return this.aiPromptService.generateClaudeUrl();
58
+ }
59
+
60
+ get chatGptUrl(): string {
61
+ return this.aiPromptService.generateChatGptUrl();
62
+ }
63
+ }
@@ -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
+ };