@mytechtoday/augment-extensions 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.
- package/AGENTS.md +33 -1
- package/README.md +3 -3
- package/augment-extensions/domain-rules/software-architecture/README.md +143 -0
- package/augment-extensions/domain-rules/software-architecture/examples/banking-layered.md +961 -0
- package/augment-extensions/domain-rules/software-architecture/examples/ecommerce-microservices.md +990 -0
- package/augment-extensions/domain-rules/software-architecture/examples/iot-eventdriven.md +882 -0
- package/augment-extensions/domain-rules/software-architecture/examples/monolith-to-microservices-migration.md +703 -0
- package/augment-extensions/domain-rules/software-architecture/examples/serverless-imageprocessing.md +957 -0
- package/augment-extensions/domain-rules/software-architecture/examples/trading-eventdriven.md +747 -0
- package/augment-extensions/domain-rules/software-architecture/module.json +119 -0
- package/augment-extensions/domain-rules/software-architecture/rules/challenges-solutions.md +763 -0
- package/augment-extensions/domain-rules/software-architecture/rules/definitions-terminology.md +409 -0
- package/augment-extensions/domain-rules/software-architecture/rules/design-principles.md +684 -0
- package/augment-extensions/domain-rules/software-architecture/rules/evaluation-testing.md +1381 -0
- package/augment-extensions/domain-rules/software-architecture/rules/event-driven-architecture.md +616 -0
- package/augment-extensions/domain-rules/software-architecture/rules/fundamentals.md +306 -0
- package/augment-extensions/domain-rules/software-architecture/rules/industry-architectures.md +554 -0
- package/augment-extensions/domain-rules/software-architecture/rules/layered-architecture.md +776 -0
- package/augment-extensions/domain-rules/software-architecture/rules/microservices-architecture.md +503 -0
- package/augment-extensions/domain-rules/software-architecture/rules/modeling-documentation.md +1199 -0
- package/augment-extensions/domain-rules/software-architecture/rules/monolithic-architecture.md +351 -0
- package/augment-extensions/domain-rules/software-architecture/rules/principles.md +556 -0
- package/augment-extensions/domain-rules/software-architecture/rules/quality-attributes.md +797 -0
- package/augment-extensions/domain-rules/software-architecture/rules/scalability-performance.md +1345 -0
- package/augment-extensions/domain-rules/software-architecture/rules/security-architecture.md +1039 -0
- package/augment-extensions/domain-rules/software-architecture/rules/serverless-architecture.md +711 -0
- package/augment-extensions/domain-rules/software-architecture/rules/skills-development.md +568 -0
- package/augment-extensions/domain-rules/software-architecture/rules/tools-methodologies.md +961 -0
- package/augment-extensions/visual-design/CHANGELOG.md +132 -0
- package/augment-extensions/visual-design/README.md +255 -0
- package/augment-extensions/visual-design/__tests__/README.md +119 -0
- package/augment-extensions/visual-design/__tests__/style-selector.test.ts +172 -0
- package/augment-extensions/visual-design/__tests__/vendor-styles.test.ts +214 -0
- package/augment-extensions/visual-design/domains/other/ai-prompt-helper.ts +157 -0
- package/augment-extensions/visual-design/domains/other/dotnet-application.ts +156 -0
- package/augment-extensions/visual-design/domains/other/linux-platform.ts +156 -0
- package/augment-extensions/visual-design/domains/other/mobile-application.ts +157 -0
- package/augment-extensions/visual-design/domains/other/motion-picture.ts +156 -0
- package/augment-extensions/visual-design/domains/other/os-application.ts +156 -0
- package/augment-extensions/visual-design/domains/other/print-campaigns.ts +158 -0
- package/augment-extensions/visual-design/domains/other/web-app.ts +157 -0
- package/augment-extensions/visual-design/domains/other/website.ts +161 -0
- package/augment-extensions/visual-design/domains/other/windows-platform.ts +156 -0
- package/augment-extensions/visual-design/domains/web-page-styles/amazon-cloudscape.ts +506 -0
- package/augment-extensions/visual-design/domains/web-page-styles/google-modern.ts +615 -0
- package/augment-extensions/visual-design/domains/web-page-styles/microsoft-fluent.ts +531 -0
- package/augment-extensions/visual-design/examples/README.md +97 -0
- package/augment-extensions/visual-design/examples/ai-prompt-generation.md +233 -0
- package/augment-extensions/visual-design/examples/basic-usage.md +216 -0
- package/augment-extensions/visual-design/examples/domain-workflows.md +257 -0
- package/augment-extensions/visual-design/examples/vendor-comparison.md +247 -0
- package/augment-extensions/visual-design/module.json +78 -0
- package/augment-extensions/visual-design/style-selector.ts +177 -0
- package/augment-extensions/visual-design/types.ts +302 -0
- package/augment-extensions/visual-design/visual-design-core.ts +469 -0
- package/augment-extensions/workflows/adr-support/README.md +227 -0
- package/augment-extensions/workflows/adr-support/__tests__/adr-validator.test.ts +203 -0
- package/augment-extensions/workflows/adr-support/adr-validator.ts +162 -0
- package/augment-extensions/workflows/adr-support/examples/complete-lifecycle-example.md +449 -0
- package/augment-extensions/workflows/adr-support/examples/integration-example.md +580 -0
- package/augment-extensions/workflows/adr-support/examples/superseding-example.md +436 -0
- package/augment-extensions/workflows/adr-support/module.json +112 -0
- package/augment-extensions/workflows/adr-support/rules/adr-creation.md +372 -0
- package/augment-extensions/workflows/adr-support/rules/beads-integration.md +443 -0
- package/augment-extensions/workflows/adr-support/rules/conflict-detection.md +486 -0
- package/augment-extensions/workflows/adr-support/rules/decision-detection.md +362 -0
- package/augment-extensions/workflows/adr-support/rules/lifecycle-management.md +427 -0
- package/augment-extensions/workflows/adr-support/rules/openspec-integration.md +465 -0
- package/augment-extensions/workflows/adr-support/rules/template-selection.md +405 -0
- package/augment-extensions/workflows/adr-support/rules/validation-rules.md +543 -0
- package/augment-extensions/workflows/adr-support/schemas/adr-config.json +191 -0
- package/augment-extensions/workflows/adr-support/schemas/adr-metadata.json +172 -0
- package/augment-extensions/workflows/adr-support/templates/business-case.md +235 -0
- package/augment-extensions/workflows/adr-support/templates/madr-elaborate.md +197 -0
- package/augment-extensions/workflows/adr-support/templates/madr-simple.md +68 -0
- package/augment-extensions/workflows/adr-support/templates/nygard.md +84 -0
- package/augment-extensions/workflows/beads/rules/workflow.md +1 -1
- package/cli/dist/utils/__tests__/adr-validator.example.d.ts +6 -0
- package/cli/dist/utils/__tests__/adr-validator.example.d.ts.map +1 -0
- package/cli/dist/utils/__tests__/adr-validator.example.js +148 -0
- package/cli/dist/utils/__tests__/adr-validator.example.js.map +1 -0
- package/cli/dist/utils/adr-validator.d.ts +65 -0
- package/cli/dist/utils/adr-validator.d.ts.map +1 -0
- package/cli/dist/utils/adr-validator.js +203 -0
- package/cli/dist/utils/adr-validator.js.map +1 -0
- package/modules.md +40 -3
- package/package.json +1 -1
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
# Vendor Style Comparison
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
This example compares the three major vendor design systems: Google Material 3 Expressive, Microsoft Fluent 2, and Amazon Cloudscape.
|
|
6
|
+
|
|
7
|
+
## Quick Comparison Table
|
|
8
|
+
|
|
9
|
+
| Aspect | Google Material 3 | Microsoft Fluent 2 | Amazon Cloudscape |
|
|
10
|
+
|--------|-------------------|-------------------|-------------------|
|
|
11
|
+
| **Primary Use** | Consumer apps, web | Enterprise, Windows | AWS dashboards, enterprise |
|
|
12
|
+
| **Color System** | Dynamic color theming | Adaptive tokens | Neutral with blue accents |
|
|
13
|
+
| **Typography** | Google Sans, Roboto | Segoe UI Variable | Amazon Ember |
|
|
14
|
+
| **Layout** | 12-column grid | Responsive grid | Component-heavy |
|
|
15
|
+
| **Motion** | Springy, expressive | Subtle, professional | Minimal, functional |
|
|
16
|
+
| **Elevation** | Subtle shadows | Layered depth | Flat with borders |
|
|
17
|
+
| **Best For** | Modern web apps | Windows apps, enterprise | Data dashboards, AWS tools |
|
|
18
|
+
|
|
19
|
+
## 1. Google Material 3 Expressive
|
|
20
|
+
|
|
21
|
+
### Characteristics
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import { GOOGLE_MODERN } from './domains/web-page-styles/google-modern';
|
|
25
|
+
|
|
26
|
+
// Key features:
|
|
27
|
+
// - Dynamic color theming with tonal palettes
|
|
28
|
+
// - Rounded corners (8px, 12px, 16px)
|
|
29
|
+
// - Springy motion (cubic-bezier(0.2, 0, 0, 1))
|
|
30
|
+
// - Subtle elevation shadows
|
|
31
|
+
// - Accessibility-first (WCAG AA)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### When to Use
|
|
35
|
+
|
|
36
|
+
- **Consumer-facing applications**: Mobile apps, web apps
|
|
37
|
+
- **Modern, expressive designs**: Colorful, dynamic interfaces
|
|
38
|
+
- **Google ecosystem**: Android, Chrome, Google Workspace
|
|
39
|
+
- **Accessibility priority**: WCAG AA/AAA compliance
|
|
40
|
+
|
|
41
|
+
### Example: Landing Page Hero
|
|
42
|
+
|
|
43
|
+
```css
|
|
44
|
+
.hero {
|
|
45
|
+
background: linear-gradient(135deg, #6750A4 0%, #EADDFF 100%);
|
|
46
|
+
border-radius: 16px;
|
|
47
|
+
padding: 48px;
|
|
48
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.hero h1 {
|
|
52
|
+
font-family: 'Google Sans', sans-serif;
|
|
53
|
+
font-size: 3.5rem;
|
|
54
|
+
font-weight: 700;
|
|
55
|
+
color: #FFFFFF;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.cta-button {
|
|
59
|
+
background: #6750A4;
|
|
60
|
+
color: #FFFFFF;
|
|
61
|
+
border-radius: 20px;
|
|
62
|
+
padding: 12px 24px;
|
|
63
|
+
transition: all 0.3s cubic-bezier(0.2, 0, 0, 1);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.cta-button:hover {
|
|
67
|
+
transform: scale(1.05);
|
|
68
|
+
box-shadow: 0 8px 16px rgba(103, 80, 164, 0.3);
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## 2. Microsoft Fluent 2
|
|
73
|
+
|
|
74
|
+
### Characteristics
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
import { MICROSOFT_FLUENT } from './domains/web-page-styles/microsoft-fluent';
|
|
78
|
+
|
|
79
|
+
// Key features:
|
|
80
|
+
// - Adaptive color tokens (light/dark mode)
|
|
81
|
+
// - Acrylic/Mica materials (transparency, blur)
|
|
82
|
+
// - Segoe UI Variable (variable font)
|
|
83
|
+
// - Layered elevation (depth)
|
|
84
|
+
// - Cross-platform consistency
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### When to Use
|
|
88
|
+
|
|
89
|
+
- **Enterprise applications**: Business tools, productivity apps
|
|
90
|
+
- **Windows ecosystem**: Windows 11, Microsoft 365
|
|
91
|
+
- **Professional interfaces**: Clean, corporate aesthetics
|
|
92
|
+
- **Cross-platform apps**: Windows, web, mobile
|
|
93
|
+
|
|
94
|
+
### Example: Dashboard Card
|
|
95
|
+
|
|
96
|
+
```css
|
|
97
|
+
.dashboard-card {
|
|
98
|
+
background: rgba(255, 255, 255, 0.7);
|
|
99
|
+
backdrop-filter: blur(30px); /* Acrylic material */
|
|
100
|
+
border: 1px solid rgba(0, 0, 0, 0.08);
|
|
101
|
+
border-radius: 8px;
|
|
102
|
+
padding: 24px;
|
|
103
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.dashboard-card h2 {
|
|
107
|
+
font-family: 'Segoe UI Variable', sans-serif;
|
|
108
|
+
font-size: 1.5rem;
|
|
109
|
+
font-weight: 600;
|
|
110
|
+
color: #242424;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.dashboard-card:hover {
|
|
114
|
+
background: rgba(255, 255, 255, 0.8);
|
|
115
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
|
116
|
+
transition: all 0.2s ease-out;
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## 3. Amazon Cloudscape
|
|
121
|
+
|
|
122
|
+
### Characteristics
|
|
123
|
+
|
|
124
|
+
```typescript
|
|
125
|
+
import { AMAZON_CLOUDSCAPE } from './domains/web-page-styles/amazon-cloudscape';
|
|
126
|
+
|
|
127
|
+
// Key features:
|
|
128
|
+
// - Neutral color palette (grays, blues)
|
|
129
|
+
// - Amazon Ember typography
|
|
130
|
+
// - Component-heavy patterns
|
|
131
|
+
// - Data-dense layouts
|
|
132
|
+
// - Enterprise dashboard focus
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### When to Use
|
|
136
|
+
|
|
137
|
+
- **AWS dashboards**: Cloud management interfaces
|
|
138
|
+
- **Data-heavy applications**: Tables, charts, analytics
|
|
139
|
+
- **Enterprise tools**: B2B SaaS, admin panels
|
|
140
|
+
- **Amazon ecosystem**: AWS, Amazon services
|
|
141
|
+
|
|
142
|
+
### Example: Data Table
|
|
143
|
+
|
|
144
|
+
```css
|
|
145
|
+
.data-table {
|
|
146
|
+
background: #FFFFFF;
|
|
147
|
+
border: 1px solid #D5DBDB;
|
|
148
|
+
border-radius: 4px;
|
|
149
|
+
overflow: hidden;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.data-table th {
|
|
153
|
+
font-family: 'Amazon Ember', sans-serif;
|
|
154
|
+
font-size: 0.875rem;
|
|
155
|
+
font-weight: 700;
|
|
156
|
+
color: #16191F;
|
|
157
|
+
background: #FAFAFA;
|
|
158
|
+
padding: 12px 16px;
|
|
159
|
+
text-align: left;
|
|
160
|
+
border-bottom: 2px solid #D5DBDB;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.data-table td {
|
|
164
|
+
font-family: 'Amazon Ember', sans-serif;
|
|
165
|
+
font-size: 0.875rem;
|
|
166
|
+
color: #16191F;
|
|
167
|
+
padding: 12px 16px;
|
|
168
|
+
border-bottom: 1px solid #EAEDED;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.data-table tr:hover {
|
|
172
|
+
background: #F9F9F9;
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Side-by-Side Comparison
|
|
177
|
+
|
|
178
|
+
### Button Styles
|
|
179
|
+
|
|
180
|
+
**Google Material 3**:
|
|
181
|
+
```css
|
|
182
|
+
.button-google {
|
|
183
|
+
background: #6750A4;
|
|
184
|
+
color: #FFFFFF;
|
|
185
|
+
border-radius: 20px;
|
|
186
|
+
padding: 12px 24px;
|
|
187
|
+
font-weight: 500;
|
|
188
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
**Microsoft Fluent 2**:
|
|
193
|
+
```css
|
|
194
|
+
.button-microsoft {
|
|
195
|
+
background: #0078D4;
|
|
196
|
+
color: #FFFFFF;
|
|
197
|
+
border-radius: 4px;
|
|
198
|
+
padding: 10px 20px;
|
|
199
|
+
font-weight: 600;
|
|
200
|
+
border: 1px solid transparent;
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
**Amazon Cloudscape**:
|
|
205
|
+
```css
|
|
206
|
+
.button-amazon {
|
|
207
|
+
background: #0972D3;
|
|
208
|
+
color: #FFFFFF;
|
|
209
|
+
border-radius: 4px;
|
|
210
|
+
padding: 8px 16px;
|
|
211
|
+
font-weight: 700;
|
|
212
|
+
border: none;
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## Choosing the Right Vendor
|
|
217
|
+
|
|
218
|
+
### Decision Tree
|
|
219
|
+
|
|
220
|
+
1. **Building for AWS/enterprise dashboards?** → Amazon Cloudscape
|
|
221
|
+
2. **Building for Windows/Microsoft ecosystem?** → Microsoft Fluent 2
|
|
222
|
+
3. **Building consumer apps or modern web?** → Google Material 3
|
|
223
|
+
|
|
224
|
+
### Hybrid Approach
|
|
225
|
+
|
|
226
|
+
You can mix vendor styles for different parts of your application:
|
|
227
|
+
|
|
228
|
+
```typescript
|
|
229
|
+
import { createStyleSelector } from './style-selector';
|
|
230
|
+
|
|
231
|
+
// Use Google for public-facing pages
|
|
232
|
+
const publicSelector = createStyleSelector(['google']);
|
|
233
|
+
|
|
234
|
+
// Use Amazon for admin dashboard
|
|
235
|
+
const adminSelector = createStyleSelector(['amazon']);
|
|
236
|
+
|
|
237
|
+
// Use Microsoft for Windows desktop app
|
|
238
|
+
const desktopSelector = createStyleSelector(['microsoft']);
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## Next Steps
|
|
242
|
+
|
|
243
|
+
- Explore detailed vendor documentation
|
|
244
|
+
- Try each vendor style with your use case
|
|
245
|
+
- Customize vendor styles with your brand colors
|
|
246
|
+
- Test accessibility across all vendors
|
|
247
|
+
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "visual-design",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"displayName": "Visual Design System",
|
|
5
|
+
"description": "Comprehensive visual design module with vendor-specific design systems (Google Material 3, Microsoft Fluent 2, Amazon Cloudscape) and domain-specific styles (Website, Web-app, Mobile, .NET, Linux, Windows, Motion Picture, AI Prompt Helper, Print Campaigns). Provides design elements, principles, and skills for AI-driven design generation.",
|
|
6
|
+
"type": "domain-rules",
|
|
7
|
+
"tags": [
|
|
8
|
+
"visual-design",
|
|
9
|
+
"design-systems",
|
|
10
|
+
"material-design",
|
|
11
|
+
"fluent-design",
|
|
12
|
+
"cloudscape",
|
|
13
|
+
"typography",
|
|
14
|
+
"color-theory",
|
|
15
|
+
"layout",
|
|
16
|
+
"ui-ux"
|
|
17
|
+
],
|
|
18
|
+
"augment": {
|
|
19
|
+
"inject": "on-demand",
|
|
20
|
+
"priority": "medium",
|
|
21
|
+
"contexts": [
|
|
22
|
+
"design",
|
|
23
|
+
"ui",
|
|
24
|
+
"ux",
|
|
25
|
+
"frontend",
|
|
26
|
+
"web-development",
|
|
27
|
+
"visual-identity"
|
|
28
|
+
]
|
|
29
|
+
},
|
|
30
|
+
"characterCount": 85000,
|
|
31
|
+
"contents": {
|
|
32
|
+
"core": [
|
|
33
|
+
"visual-design-core.ts",
|
|
34
|
+
"types.ts",
|
|
35
|
+
"style-selector.ts"
|
|
36
|
+
],
|
|
37
|
+
"vendors": {
|
|
38
|
+
"web-page-styles": [
|
|
39
|
+
"google-modern.ts",
|
|
40
|
+
"microsoft-fluent.ts",
|
|
41
|
+
"amazon-cloudscape.ts"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
"domains": {
|
|
45
|
+
"other": [
|
|
46
|
+
"website.ts",
|
|
47
|
+
"web-app.ts",
|
|
48
|
+
"mobile-application.ts",
|
|
49
|
+
"dotnet-application.ts",
|
|
50
|
+
"linux-platform.ts",
|
|
51
|
+
"windows-platform.ts",
|
|
52
|
+
"motion-picture.ts",
|
|
53
|
+
"ai-prompt-helper.ts",
|
|
54
|
+
"print-campaigns.ts",
|
|
55
|
+
"os-application.ts"
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
"tests": [
|
|
59
|
+
"__tests__/"
|
|
60
|
+
],
|
|
61
|
+
"examples": [
|
|
62
|
+
"examples/"
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
"vendorPriority": [
|
|
66
|
+
"google",
|
|
67
|
+
"microsoft",
|
|
68
|
+
"amazon"
|
|
69
|
+
],
|
|
70
|
+
"installation": {
|
|
71
|
+
"steps": [
|
|
72
|
+
"Run: augx link visual-design",
|
|
73
|
+
"Configure vendor preference in .augment/extensions.json (optional)",
|
|
74
|
+
"Use: augx show visual-design to view module content"
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Style Selector - Vendor Priority and Fallback Logic
|
|
3
|
+
*
|
|
4
|
+
* This module implements the default fallback chain for vendor style selection:
|
|
5
|
+
* 1. Google Modern (Material 3 Expressive) - Primary
|
|
6
|
+
* 2. Microsoft Fluent 2 - Secondary
|
|
7
|
+
* 3. Amazon Cloudscape - Tertiary
|
|
8
|
+
*
|
|
9
|
+
* The priority chain can be overridden via .augment/extensions.json configuration.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { VendorStyle, DomainStyle, StylePreferences, StyleSelector } from './types';
|
|
13
|
+
import { GOOGLE_MODERN } from './domains/web-page-styles/google-modern';
|
|
14
|
+
import { MICROSOFT_FLUENT } from './domains/web-page-styles/microsoft-fluent';
|
|
15
|
+
import { AMAZON_CLOUDSCAPE } from './domains/web-page-styles/amazon-cloudscape';
|
|
16
|
+
|
|
17
|
+
// ============================================================================
|
|
18
|
+
// Default Vendor Priority Chain
|
|
19
|
+
// ============================================================================
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Default vendor priority order:
|
|
23
|
+
* 1. Google (Material 3 Expressive)
|
|
24
|
+
* 2. Microsoft (Fluent 2)
|
|
25
|
+
* 3. Amazon (Cloudscape)
|
|
26
|
+
*/
|
|
27
|
+
export const DEFAULT_VENDOR_PRIORITY: string[] = ['google', 'microsoft', 'amazon'];
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Vendor style registry
|
|
31
|
+
* Maps vendor names to their corresponding VendorStyle implementations
|
|
32
|
+
*/
|
|
33
|
+
const VENDOR_STYLES: Record<string, VendorStyle> = {
|
|
34
|
+
google: GOOGLE_MODERN,
|
|
35
|
+
microsoft: MICROSOFT_FLUENT,
|
|
36
|
+
amazon: AMAZON_CLOUDSCAPE
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// ============================================================================
|
|
40
|
+
// Style Selector Implementation
|
|
41
|
+
// ============================================================================
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Creates a style selector with configurable vendor priority
|
|
45
|
+
*
|
|
46
|
+
* @param vendorPriority - Optional custom vendor priority order
|
|
47
|
+
* @returns StyleSelector instance
|
|
48
|
+
*/
|
|
49
|
+
export function createStyleSelector(
|
|
50
|
+
vendorPriority: string[] = DEFAULT_VENDOR_PRIORITY
|
|
51
|
+
): StyleSelector {
|
|
52
|
+
return {
|
|
53
|
+
vendorPriority,
|
|
54
|
+
fallbackChain: vendorPriority,
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Selects a vendor style based on preferences and fallback chain
|
|
58
|
+
*
|
|
59
|
+
* @param preferences - Optional style preferences
|
|
60
|
+
* @returns Selected VendorStyle or DomainStyle
|
|
61
|
+
*/
|
|
62
|
+
selectStyle(preferences?: StylePreferences): VendorStyle | DomainStyle {
|
|
63
|
+
// If vendor preference is specified, try to use it
|
|
64
|
+
if (preferences?.vendor) {
|
|
65
|
+
const preferredStyle = VENDOR_STYLES[preferences.vendor.toLowerCase()];
|
|
66
|
+
if (preferredStyle) {
|
|
67
|
+
return preferredStyle;
|
|
68
|
+
}
|
|
69
|
+
console.warn(
|
|
70
|
+
`Vendor "${preferences.vendor}" not found. Falling back to priority chain.`
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Use fallback chain to select vendor
|
|
75
|
+
for (const vendor of this.fallbackChain) {
|
|
76
|
+
const style = VENDOR_STYLES[vendor.toLowerCase()];
|
|
77
|
+
if (style) {
|
|
78
|
+
return style;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
// Ultimate fallback: return Google Modern
|
|
83
|
+
console.warn('No vendor found in fallback chain. Using Google Modern as default.');
|
|
84
|
+
return GOOGLE_MODERN;
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Default style selector instance
|
|
91
|
+
* Uses the default vendor priority: google → microsoft → amazon
|
|
92
|
+
*/
|
|
93
|
+
export const defaultStyleSelector = createStyleSelector();
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Selects a vendor style using the default priority chain
|
|
97
|
+
*
|
|
98
|
+
* @param preferences - Optional style preferences
|
|
99
|
+
* @returns Selected VendorStyle
|
|
100
|
+
*/
|
|
101
|
+
export function selectVendorStyle(preferences?: StylePreferences): VendorStyle {
|
|
102
|
+
return defaultStyleSelector.selectStyle(preferences) as VendorStyle;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Gets a specific vendor style by name
|
|
107
|
+
*
|
|
108
|
+
* @param vendor - Vendor name ('google', 'microsoft', or 'amazon')
|
|
109
|
+
* @returns VendorStyle or undefined if not found
|
|
110
|
+
*/
|
|
111
|
+
export function getVendorStyle(vendor: string): VendorStyle | undefined {
|
|
112
|
+
return VENDOR_STYLES[vendor.toLowerCase()];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Gets all available vendor styles
|
|
117
|
+
*
|
|
118
|
+
* @returns Array of all VendorStyle implementations
|
|
119
|
+
*/
|
|
120
|
+
export function getAllVendorStyles(): VendorStyle[] {
|
|
121
|
+
return Object.values(VENDOR_STYLES);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Checks if a vendor style exists
|
|
126
|
+
*
|
|
127
|
+
* @param vendor - Vendor name to check
|
|
128
|
+
* @returns true if vendor exists, false otherwise
|
|
129
|
+
*/
|
|
130
|
+
export function hasVendorStyle(vendor: string): boolean {
|
|
131
|
+
return vendor.toLowerCase() in VENDOR_STYLES;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// ============================================================================
|
|
135
|
+
// Usage Examples for AI Agents
|
|
136
|
+
// ============================================================================
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* EXAMPLE 1: Use default priority chain
|
|
140
|
+
*
|
|
141
|
+
* ```typescript
|
|
142
|
+
* import { selectVendorStyle } from './style-selector';
|
|
143
|
+
*
|
|
144
|
+
* const style = selectVendorStyle();
|
|
145
|
+
* // Returns GOOGLE_MODERN (first in priority chain)
|
|
146
|
+
* ```
|
|
147
|
+
*
|
|
148
|
+
* EXAMPLE 2: Specify vendor preference
|
|
149
|
+
*
|
|
150
|
+
* ```typescript
|
|
151
|
+
* import { selectVendorStyle } from './style-selector';
|
|
152
|
+
*
|
|
153
|
+
* const style = selectVendorStyle({ vendor: 'microsoft' });
|
|
154
|
+
* // Returns MICROSOFT_FLUENT
|
|
155
|
+
* ```
|
|
156
|
+
*
|
|
157
|
+
* EXAMPLE 3: Custom priority chain
|
|
158
|
+
*
|
|
159
|
+
* ```typescript
|
|
160
|
+
* import { createStyleSelector } from './style-selector';
|
|
161
|
+
*
|
|
162
|
+
* const selector = createStyleSelector(['amazon', 'microsoft', 'google']);
|
|
163
|
+
* const style = selector.selectStyle();
|
|
164
|
+
* // Returns AMAZON_CLOUDSCAPE (first in custom chain)
|
|
165
|
+
* ```
|
|
166
|
+
*/
|
|
167
|
+
|
|
168
|
+
export default {
|
|
169
|
+
createStyleSelector,
|
|
170
|
+
defaultStyleSelector,
|
|
171
|
+
selectVendorStyle,
|
|
172
|
+
getVendorStyle,
|
|
173
|
+
getAllVendorStyles,
|
|
174
|
+
hasVendorStyle,
|
|
175
|
+
DEFAULT_VENDOR_PRIORITY
|
|
176
|
+
};
|
|
177
|
+
|