@aitronos/freddy-plugins 0.4.2 → 0.4.3

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 CHANGED
@@ -4,6 +4,11 @@ A lightweight, dynamic, and feature-rich component library that provides a compr
4
4
 
5
5
  ## ✨ Features
6
6
 
7
+ | Environment | URL | Branch | Status |
8
+ | --------------- | -------------------------------------------------------------------------- | --------- | ---------- |
9
+ | **Development** | [dev-components.aitronos.com](https://dev-components.aitronos.com) | `develop` | ✅ Live |
10
+ | **Staging** | [staging-components.aitronos.com](https://staging-components.aitronos.com) | `staging` | 🚧 Pending |
11
+ | **Production** | [components.aitronos.com](https://components.aitronos.com) | `main` | 🚧 Pending |
7
12
  - **🚀 Lightweight**: Optimized bundle size with tree-shaking support
8
13
  - **🔄 Dynamic**: Auto-updating components with new features and improvements
9
14
  - **🎨 Rich**: 20+ components, 120+ icons, animations, and utilities
@@ -19,6 +24,11 @@ A lightweight, dynamic, and feature-rich component library that provides a compr
19
24
  # npm
20
25
  npm install @aitronos/freddy-plugins
21
26
 
27
+ | Environment | Memory | CPU | Max Instances | Estimated Cost/Month |
28
+ | --------------- | ------ | --- | ------------- | -------------------- |
29
+ | **Development** | 1Gi | 1 | 10 | ~$15-25 |
30
+ | **Staging** | 1Gi | 1 | 10 | ~$15-25 |
31
+ | **Production** | 1Gi | 1 | 10 | ~$15-25 |
22
32
  # yarn
23
33
  yarn add @aitronos/freddy-plugins
24
34
 
@@ -26,10 +36,26 @@ yarn add @aitronos/freddy-plugins
26
36
  pnpm add @aitronos/freddy-plugins
27
37
  ```
28
38
 
39
+ **Google Cloud Run Pricing (Switzerland - europe-west6):**
40
+
41
+ - **CPU**: $0.00002400 per vCPU-second
42
+ - **Memory**: $0.00000250 per GiB-second
43
+ - **Requests**: $0.40 per million requests
29
44
  ## 🔄 Updating to New Version
30
45
 
46
+ **Estimated Monthly Costs:**
47
+
48
+ - **Development**: $15-25 (low traffic, testing)
49
+ - **Staging**: $15-25 (pre-production testing)
50
+ - **Production**: $15-25 (package visualization)
51
+ - **Total Estimated**: $45-75/month
31
52
  To get the latest features, components, and bug fixes, simply update the package:
32
53
 
54
+ **Additional Costs:**
55
+
56
+ - **Artifact Registry**: ~$5-10/month (Docker images)
57
+ - **Cloud Build**: ~$5-15/month (CI/CD builds)
58
+ - **Network Egress**: ~$5-10/month (traffic)
33
59
  ```bash
34
60
  # npm - Update to latest version
35
61
  npm update @aitronos/freddy-plugins
@@ -50,12 +76,392 @@ pnpm update @aitronos/freddy-plugins
50
76
  pnpm add @aitronos/freddy-plugins@2.1.0
51
77
  ```
52
78
 
79
+ ## 🎨 **Color System**
80
+
81
+ ### **Multi-Brand Color Architecture**
82
+
83
+ The Storybook implements a sophisticated color system that supports multiple brands (Contentplate, Flowplate, Freddy) with different color modes (light/dark).
84
+
85
+ #### **Brand Color Palettes**
86
+
87
+ | Brand | Primary Color | Theme Focus | Style | Use Case |
88
+ | ---------------- | ------------------------------------ | ----------- | ---------------------------- | ----------------------------- |
89
+ | **Contentplate** | Purple (#7c3aed) | Light mode | Clean, modern, professional | Content management platforms |
90
+ | **Flowplate** | Purple gradient (#6366f1 to #8b5cf6) | Dark mode | Dynamic, flowing, elegant | Workflow automation platforms |
91
+ | **Freddy** | Blue (#00aeef) | Dark mode | Technical, precise, reliable | AI and automation tools |
92
+
93
+ #### **Color Categories**
94
+
95
+ Each brand supports comprehensive color categories:
96
+
97
+ - **Primary Colors**: Main brand colors with full scales (50-900)
98
+ - **Secondary Colors**: Supporting colors for accents
99
+ - **Neutral Colors**: Grays and whites for backgrounds
100
+ - **Semantic Colors**: Success, warning, error, info states
101
+ - **Interactive Colors**: Hover, focus, active, disabled states
102
+ - **Background Colors**: Page and component backgrounds
103
+ - **Text Colors**: Typography and content colors
104
+ - **Border Colors**: Dividers and outlines
105
+
106
+ #### **Color Modes**
107
+
108
+ Each brand supports multiple color modes:
109
+
110
+ - **Light Mode**: Traditional light theme with dark text
111
+ - **Dark Mode**: Dark theme with light text and appropriate contrast
112
+ ...
113
+
114
+ ### **Color Configuration**
115
+
116
+ The color system uses static configuration files for reliable theming:
117
+
118
+ **Configuration Files:**
119
+
120
+ - `src/dist/clean-configuration.json` - Main theme configuration
121
+ - `src/dist/master-configuration.json` - Source configuration
122
+ - `src/dist/complete-configuration.json` - Complete configuration
123
+
124
+ **Features:**
125
+
126
+ - **Total colors**: 50+ per brand/mode
127
+ - **Interactive states**: Included
128
+ - **Brands**: Freddy, Contentplate, Flowplate
129
+ - **Modes**: Default, Light, Dark
130
+
131
+ #### **Available CSS Variables**
132
+
133
+ The system provides 43+ CSS variables that automatically update based on the selected brand and color mode:
134
+
135
+ **Text Colors:**
136
+
137
+ ```css
138
+ var(--text-primary) /* Main text content */
139
+ var(--text-secondary) /* Secondary/subtle text */
140
+ var(--text-accent) /* Accent text */
141
+ var(--text-error) /* Error text */
142
+ var(--text-success) /* Success text */
143
+ var(--text-warning) /* Warning text */
144
+ var(--text-info) /* Info text */
145
+ var(--text-link) /* Link text */
146
+ var(--text-inverse) /* Text on colored backgrounds */
147
+ ```
148
+
149
+ **Interactive States:**
150
+
151
+ ```css
152
+ var(--text-primary-hover) /* Primary text on hover */
153
+ var(--text-primary-active) /* Primary text when active */
154
+ var(--text-primary-focus) /* Primary text when focused */
155
+ var(--text-secondary-hover) /* Secondary text on hover */
156
+ var(--text-secondary-focus) /* Secondary text when focused */
157
+ var(--text-link-hover) /* Link text on hover */
158
+ ```
159
+
160
+ **Background Colors:**
161
+
162
+ ```css
163
+ var(--bg-primary) /* Main background */
164
+ var(--bg-secondary) /* Secondary background */
165
+ var(--bg-surface) /* Surface/card background */
166
+ ```
167
+
168
+ **Brand Colors:**
169
+
170
+ ```css
171
+ var(--primary-color) /* Primary actions */
172
+ var(--error-color) /* Error states */
173
+ var(--success-color) /* Success states */
174
+ var(--warning-color) /* Warning states */
175
+ ```
176
+
177
+ **Usage in Components:**
178
+
179
+ ```vue
180
+ <style scoped>
181
+ .my-component {
182
+ background-color: var(--bg-primary);
183
+ color: var(--text-primary);
184
+ border: 2px solid var(--border-color);
185
+ }
186
+
187
+ .my-button:hover {
188
+ color: var(--text-primary-hover);
189
+ }
190
+ </style>
191
+ ```
192
+
193
+ #### **Development Rules**
194
+
195
+ All components must follow the theme development rules:
196
+
197
+ - ✅ **Use CSS variables** - Never hardcode colors
198
+ - ✅ **Dynamic theming** - Colors change based on brand/mode
199
+ - ✅ **Interactive states** - Use hover, active, focus variables
200
+ - ✅ **Accessibility** - Maintain proper contrast ratios
201
+
202
+ See `THEME_DEVELOPMENT_RULES.md` for complete guidelines.
203
+
204
+ ```bash
205
+ # Generate static color configuration
206
+ yarn generate:color-config
207
+ ```
208
+
209
+ #### **Generated Files**
210
+
211
+ - `dist/colors.json` - Static color configuration
212
+ - `src/dist/clean-configuration.json` - Main theme configuration
213
+ - `src/dist/master-configuration.json` - Source configuration
214
+
215
+ ## 🎨 **Brand Switching & Theme Management**
216
+
217
+ ### **Theme Management**
218
+
219
+ The project uses a sophisticated theme management system providing dynamic brand switching and theme management capabilities.
220
+
221
+ #### **Available Brands**
222
+
223
+ | Brand | Description | Primary Use Case |
224
+ | ---------------- | ----------------------- | ------------------------------------- |
225
+ | **Freddy** | AI and automation tools | Technical interfaces, AI platforms |
226
+ | **Flowplate** | Workflow automation | Process management, automation tools |
227
+ | **Contentplate** | Content management | CMS platforms, content creation tools |
228
+
229
+ #### **Available Modes**
230
+
231
+ | Mode | Description | Best For |
232
+ | ----------- | -------------------------- | ------------------------------------ |
233
+ | **Light** | Traditional light theme | Daytime use, professional interfaces |
234
+ | **Dark** | Dark theme with light text | Night use, modern interfaces |
235
+ | **Default** | Brand-specific default | General use, brand consistency |
236
+
237
+ ### **Runtime Brand Switching**
238
+
239
+ #### **Using the ThemeSwitcher Component**
240
+
241
+ ```vue
242
+ <template>
243
+ <ThemeSwitcher
244
+ :initial-brand="'freddy'"
245
+ :initial-mode="'light'"
246
+ @theme-changed="handleThemeChange"
247
+ @theme-applied="handleThemeApplied"
248
+ />
249
+ </template>
250
+
251
+ <script setup>
252
+ import { ThemeSwitcher } from "@/components";
253
+
254
+ const handleThemeChange = (brand, mode) => {
255
+ console.log("Theme changed:", { brand, mode });
256
+ // Update your app's theme state
257
+ };
258
+
259
+ const handleThemeApplied = (brand, mode) => {
260
+ console.log("Theme applied:", { brand, mode });
261
+ // Apply the theme to your application
262
+ };
263
+ </script>
264
+ ```
265
+
266
+ #### **Using the Theme Service**
267
+
268
+ ```typescript
269
+ import { useTheme } from "@/composables/useTheme";
270
+
271
+ // Get theme service
272
+ const {
273
+ currentBrandId,
274
+ currentModeId,
275
+ availableBrands,
276
+ availableModes,
277
+ setBrand,
278
+ setMode,
279
+ } = useTheme();
280
+
281
+ // Get available brands and modes
282
+ console.log("Available brands:", availableBrands.value);
283
+ console.log("Available modes:", availableModes.value);
284
+
285
+ // Switch brand and mode
286
+ setBrand("freddy-public-id");
287
+ setMode("light-mode-id");
288
+ ```
289
+
290
+ ### **CSS Custom Properties Integration**
291
+
292
+ The system automatically generates CSS custom properties for each brand and mode:
293
+
294
+ ```css
295
+ /* Freddy Light Mode */
296
+ .freddy-light {
297
+ --color-primary-500: #00aeef;
298
+ --color-background-50: #ffffff;
299
+ --color-text-900: #111827;
300
+ --color-border-200: #e5e7eb;
301
+ }
302
+
303
+ /* Flowplate Dark Mode */
304
+ .flowplate-dark {
305
+ --color-primary-500: #6366f1;
306
+ --color-background-50: #0f172a;
307
+ --color-text-50: #f8fafc;
308
+ --color-border-700: #374151;
309
+ }
310
+
311
+ /* Contentplate Default Mode */
312
+ .contentplate-default {
313
+ --color-primary-500: #7c3aed;
314
+ --color-background-50: #ffffff;
315
+ --color-text-900: #111827;
316
+ --color-border-200: #e5e7eb;
317
+ }
318
+ ```
319
+
320
+ ### **Component-Level Brand Switching**
321
+
322
+ ```vue
323
+ <template>
324
+ <div :class="`component--${currentBrand}--${currentMode}`">
325
+ <Button :style="{ backgroundColor: primaryColor }" @click="switchBrand">
326
+ Switch to {{ nextBrand }}
327
+ </Button>
328
+ </div>
329
+ </template>
330
+
331
+ <script setup>
332
+ import { ref, computed } from "vue";
333
+ import { useTheme } from "@/composables/useTheme";
334
+
335
+ const { setBrand, setMode, availableBrands } = useTheme();
336
+
337
+ const currentBrand = ref("freddy");
338
+ const currentMode = ref("light");
339
+
340
+ const brands = ["freddy", "flowplate", "contentplate"];
341
+ const currentBrandIndex = computed(() => brands.indexOf(currentBrand.value));
342
+ const nextBrand = computed(
343
+ () => brands[(currentBrandIndex.value + 1) % brands.length]
344
+ );
345
+
346
+ const switchBrand = () => {
347
+ currentBrand.value = nextBrand.value;
348
+
349
+ // Find the brand ID and set it
350
+ const targetBrand = availableBrands.value.find((b) =>
351
+ b.name.toLowerCase().includes(currentBrand.value)
352
+ );
353
+ if (targetBrand) {
354
+ setBrand(targetBrand.id);
355
+ }
356
+ };
357
+ </script>
358
+ ```
359
+
360
+ ### **Global Theme State Management**
361
+
362
+ The theme system uses Vue's reactivity system for state management. See the `ThemeService.ts` for the complete implementation.
363
+
364
+ ### **Usage Examples**
365
+
366
+ #### **Component Integration**
367
+
368
+ ```vue
369
+ <template>
370
+ <div :class="`component--${brand}--${mode}`">
371
+ <button :style="{ backgroundColor: primaryColor }">Primary Button</button>
372
+ </div>
373
+ </template>
374
+
375
+ <script setup>
376
+ import { useColorSystem } from "@/config/colors";
377
+
378
+ const { getColor } = useColorSystem();
379
+
380
+ const primaryColor = getColor({
381
+ brand: "contentplate",
382
+ mode: "light",
383
+ category: "primary",
384
+ scale: 500,
385
+ });
386
+ </script>
387
+ ```
388
+
389
+ #### **CSS Custom Properties**
390
+
391
+ ```css
392
+ .contentplate-light {
393
+ --color-primary-500: #7c3aed;
394
+ --color-background-50: #ffffff;
395
+ --color-text-900: #111827;
396
+ }
397
+
398
+ .flowplate-dark {
399
+ --color-primary-500: #6366f1;
400
+ --color-background-50: #0f172a;
401
+ --color-text-50: #f8fafc;
402
+ }
403
+ ```
404
+
405
+ #### **TypeScript Support**
406
+
407
+ ```typescript
408
+ import { getColor, validateColorContrast } from "@/config/colors";
409
+
410
+ // Get a specific color
411
+ const primaryColor = getColor({
412
+ brand: "contentplate",
413
+ mode: "light",
414
+ category: "primary",
415
+ scale: 500,
416
+ });
417
+
418
+ // Validate contrast
419
+ const result = validateColorContrast("#7c3aed", "#ffffff");
420
+ if (!result.isAccessible) {
421
+ console.warn("Low contrast detected");
422
+ }
423
+ ```
424
+
425
+ ### **Accessibility Features**
426
+
427
+ - **WCAG Compliance**: AA standard (4.5:1) and AAA standard (7:1)
428
+ - **Contrast Validation**: Automatic validation of color combinations
429
+ - **Color Blindness Support**: High contrast ratios for all color combinations
430
+ - **Semantic Colors**: Clear distinction between success, warning, error states
431
+
432
+ ### **Performance Optimizations**
433
+
434
+ - **Static Configuration**: Reliable theme configuration from JSON files
435
+ - **Fallback System**: Graceful degradation with default themes
436
+ - **Efficient Processing**: Optimized color scale generation
437
+ - **Minimal Network Requests**: Smart caching reduces API calls
438
+
439
+ ## 📦 **Components**
53
440
  **✨ No code changes needed!** New components and features are automatically available after updating.
54
441
 
442
+ ### **Core Components**
443
+
444
+ - `Button` - Primary action buttons
445
+ - `InputField` - Form input components
446
+ - `Modal` - Dialog and modal components
447
+ - `Dropdown` - Selection components
448
+ - `Pagination` - Navigation components
55
449
  ## 🎨 Storybook Documentation
56
450
 
451
+ ### **Specialized Components**
452
+
453
+ - `ChatInterface` - Real-time chat components
454
+ - `ApiInteraction` - API testing interface
455
+ - `LoginRegister` - Authentication components
456
+ - `IconLibrary` - Complete icon set (100+ icons)
57
457
  Explore all components, icons, and utilities with interactive demos:
58
458
 
459
+ ### **Utility Components**
460
+
461
+ - `Spinner` - Loading indicators
462
+ - `ToastMessage` - Notification system
463
+ - `Tooltip` - Information overlays
464
+ - `CodeBlock` - Syntax highlighting
59
465
  **[📚 View Storybook →](https://aitronos-freddy-plugins.vercel.app/)**
60
466
 
61
467
  The Storybook provides:
@@ -75,6 +481,8 @@ The Storybook provides:
75
481
  npm install @aitronos/freddy-plugins
76
482
  ```
77
483
 
484
+ # Staging (staging branch)
485
+ git push origin staging
78
486
  ### Import Web Components
79
487
 
80
488
  **Option 1: Global Registration (Recommended)**
@@ -213,6 +621,24 @@ function App() {
213
621
  export default App;
214
622
  ```
215
623
 
624
+ ### Setup Guide
625
+
626
+ For a concise setup guide and environment notes, see `docs/development/setup-guide.md`.
627
+
628
+ ### **Brand Switching Commands**
629
+
630
+ ```bash
631
+ # Generate clean configuration
632
+ yarn generate:color-config
633
+
634
+ # Build the project
635
+ yarn build
636
+
637
+ # Run Storybook
638
+ yarn storybook
639
+ ```
640
+
641
+ ## 📋 **Project Structure**
216
642
  ### Using Components
217
643
 
218
644
  ```tsx
@@ -268,14 +694,29 @@ declare namespace JSX {
268
694
 
269
695
  ## 🟢 Vue Usage
270
696
 
697
+ ### **Security Features**
698
+
699
+ - ✅ **HTTPS only** - All traffic encrypted
700
+ - ✅ **Security headers** - XSS, CSRF protection
701
+ - ✅ **Content Security Policy** - Resource restrictions
702
+ - ✅ **No sensitive data** - Public component library
271
703
  ### Installation
272
704
 
705
+ ### **Performance Optimizations**
706
+
707
+ - ✅ **Gzip compression** - Reduced transfer size
708
+ - ✅ **Static asset caching** - 1-year cache headers
709
+ - ✅ **CDN distribution** - Global edge locations
710
+ - ✅ **Auto-scaling** - Handles traffic spikes
273
711
  ```bash
274
712
  npm install @aitronos/freddy-plugins
275
713
  ```
276
714
 
277
715
  ### Using in Vue 3
278
716
 
717
+ ### **DNS Configuration**
718
+
719
+ Add these CNAME records in Hostpoint.ch:
279
720
  ```vue
280
721
  <!-- App.vue -->
281
722
  <template>
@@ -313,10 +754,19 @@ import "@aitronos/freddy-plugins/dist/freddy-plugins.css";
313
754
  </script>
314
755
  ```
315
756
 
757
+ ### **SSL Certificates**
758
+
759
+ - Automatically managed by Google Cloud
760
+ - Custom domains require verification in Google Cloud Console
316
761
  ## 🎯 Available Components
317
762
 
318
763
  ### Core Components
319
764
 
765
+ ### **Health Checks**
766
+
767
+ - **Endpoint**: `/health` - Returns 200 OK
768
+ - **Auto-restart**: Failed instances restart automatically
769
+ - **Logging**: Cloud Run logs available in Google Cloud Console
320
770
  - `freddy-button` - Interactive freddy-buttons with multiple variants
321
771
  - `freddy-input-field` - Form input fields
322
772
  - `freddy-modal-box` - Modal dialogs
@@ -328,6 +778,11 @@ import "@aitronos/freddy-plugins/dist/freddy-plugins.css";
328
778
  - `freddy-spinner` - Loading spinners
329
779
  - `freddy-skeleton-loader` - Skeleton loading states
330
780
 
781
+ ### **Performance Metrics**
782
+
783
+ - **Response time**: < 200ms average
784
+ - **Uptime**: 99.9% SLA with Cloud Run
785
+ - **Availability**: Multi-zone deployment
331
786
  ### Icons (120+ available)
332
787
 
333
788
  - `icon-search` - Search icon
@@ -343,6 +798,11 @@ import "@aitronos/freddy-plugins/dist/freddy-plugins.css";
343
798
 
344
799
  ### Animations
345
800
 
801
+ **Build Failures:**
802
+
803
+ ```bash
804
+ # Check TypeScript errors
805
+ yarn vue-tsc --noEmit
346
806
  - `freddy-anime-spaceman` - Spaceman animation
347
807
 
348
808
  ### Utilities
@@ -359,6 +819,12 @@ import "@aitronos/freddy-plugins/dist/freddy-plugins.css";
359
819
  import "@aitronos/freddy-plugins/dist/freddy-plugins.css";
360
820
  ```
361
821
 
822
+ **Deployment Issues:**
823
+
824
+ ```bash
825
+ # Check GitHub Actions logs
826
+ # Verify GCP_SA_KEY secret is set
827
+ # Ensure Docker build succeeds locally
362
828
  ### Custom Theming
363
829
 
364
830
  ```css
@@ -375,6 +841,11 @@ icon-search {
375
841
  }
376
842
  ```
377
843
 
844
+ **Domain Issues:**
845
+
846
+ - Verify DNS propagation (can take 24-48 hours)
847
+ - Check custom domain verification in Google Cloud Console
848
+ - Ensure CNAME records are correct
378
849
  ## 📚 Documentation
379
850
 
380
851
  - **[Storybook Demo](https://aitronos-freddy-plugins.vercel.app/)** - Interactive component documentation