@serve.zone/catalog 2.4.0 → 2.6.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serve.zone/catalog",
3
- "version": "2.4.0",
3
+ "version": "2.6.0",
4
4
  "private": false,
5
5
  "description": "UI component catalog for serve.zone",
6
6
  "main": "dist_ts_web/index.js",
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@serve.zone/catalog',
6
- version: '2.4.0',
6
+ version: '2.6.0',
7
7
  description: 'UI component catalog for serve.zone'
8
8
  }
@@ -17,6 +17,13 @@ export interface IConfigField {
17
17
  linkTo?: string;
18
18
  }
19
19
 
20
+ export interface IConfigSectionAction {
21
+ label: string;
22
+ icon?: string;
23
+ event?: string;
24
+ detail?: any;
25
+ }
26
+
20
27
  declare global {
21
28
  interface HTMLElementTagNameMap {
22
29
  'sz-config-section': SzConfigSection;
@@ -81,6 +88,9 @@ export class SzConfigSection extends DeesElement {
81
88
  @property({ type: Array })
82
89
  public accessor fields: IConfigField[] = [];
83
90
 
91
+ @property({ type: Array })
92
+ public accessor actions: IConfigSectionAction[] = [];
93
+
84
94
  @property({ type: Boolean })
85
95
  public accessor collapsible: boolean = false;
86
96
 
@@ -226,6 +236,32 @@ export class SzConfigSection extends DeesElement {
226
236
  background: ${cssManager.bdTheme('#f59e0b', '#fbbf24')};
227
237
  }
228
238
 
239
+ /* Action buttons */
240
+ .header-action {
241
+ display: inline-flex;
242
+ align-items: center;
243
+ gap: 5px;
244
+ padding: 4px 12px;
245
+ border-radius: 6px;
246
+ font-size: 12px;
247
+ font-weight: 500;
248
+ color: ${cssManager.bdTheme('#2563eb', '#60a5fa')};
249
+ background: transparent;
250
+ border: none;
251
+ cursor: pointer;
252
+ transition: background 150ms ease;
253
+ white-space: nowrap;
254
+ font-family: inherit;
255
+ }
256
+
257
+ .header-action:hover {
258
+ background: ${cssManager.bdTheme('rgba(37,99,235,0.08)', 'rgba(96,165,250,0.1)')};
259
+ }
260
+
261
+ .header-action dees-icon {
262
+ font-size: 14px;
263
+ }
264
+
229
265
  /* Chevron */
230
266
  .chevron {
231
267
  display: flex;
@@ -439,6 +475,19 @@ export class SzConfigSection extends DeesElement {
439
475
  ${statusLabels[this.status] || this.status}
440
476
  </span>
441
477
  ` : ''}
478
+ ${this.actions.map(action => html`
479
+ <button class="header-action" @click=${(e: Event) => {
480
+ e.stopPropagation();
481
+ this.dispatchEvent(new CustomEvent(action.event || 'action', {
482
+ detail: action.detail || { label: action.label },
483
+ bubbles: true,
484
+ composed: true,
485
+ }));
486
+ }}>
487
+ ${action.icon ? html`<dees-icon .icon=${action.icon}></dees-icon>` : ''}
488
+ ${action.label}
489
+ </button>
490
+ `)}
442
491
  ${this.collapsible ? html`
443
492
  <span class="chevron ${this.isCollapsed ? 'collapsed' : ''}">
444
493
  <dees-icon .icon=${'lucide:chevronDown'}></dees-icon>
@@ -6,7 +6,7 @@ import {
6
6
  cssManager,
7
7
  type TemplateResult,
8
8
  } from '@design.estate/dees-element';
9
- import type { IConfigField } from './sz-config-section.js';
9
+ import type { IConfigField, IConfigSectionAction } from './sz-config-section.js';
10
10
  import './index.js';
11
11
 
12
12
  declare global {
@@ -109,6 +109,7 @@ export class SzDemoViewConfig extends DeesElement {
109
109
  icon="lucide:network"
110
110
  status="enabled"
111
111
  .fields=${proxyFields}
112
+ .actions=${[{ label: 'View Routes', icon: 'lucide:arrow-right', event: 'navigate', detail: { view: 'routes' } }] as IConfigSectionAction[]}
112
113
  ></sz-config-section>
113
114
 
114
115
  <sz-config-section
@@ -48,6 +48,9 @@ export interface IServiceConfig {
48
48
  memoryLimit: string;
49
49
  restartPolicy: 'always' | 'on-failure' | 'never';
50
50
  networkMode: string;
51
+ enableMongoDB: boolean;
52
+ enableS3: boolean;
53
+ enableClickHouse: boolean;
51
54
  }
52
55
 
53
56
  @customElement('sz-service-create-view')
@@ -104,6 +107,15 @@ export class SzServiceCreateView extends DeesElement {
104
107
  @state()
105
108
  private accessor showAdvanced: boolean = false;
106
109
 
110
+ @state()
111
+ private accessor enableMongoDB: boolean = false;
112
+
113
+ @state()
114
+ private accessor enableS3: boolean = false;
115
+
116
+ @state()
117
+ private accessor enableClickHouse: boolean = false;
118
+
107
119
  public static styles = [
108
120
  cssManager.defaultStyles,
109
121
  css`
@@ -312,6 +324,105 @@ export class SzServiceCreateView extends DeesElement {
312
324
  accent-color: ${cssManager.bdTheme('#3b82f6', '#60a5fa')};
313
325
  }
314
326
 
327
+ .platform-toggle-list {
328
+ display: flex;
329
+ flex-direction: column;
330
+ gap: 12px;
331
+ }
332
+
333
+ .platform-toggle-item {
334
+ display: flex;
335
+ align-items: center;
336
+ justify-content: space-between;
337
+ padding: 12px 16px;
338
+ background: ${cssManager.bdTheme('#f4f4f5', '#18181b')};
339
+ border-radius: 8px;
340
+ transition: background 200ms ease;
341
+ }
342
+
343
+ .platform-toggle-item:has(input:checked) {
344
+ background: ${cssManager.bdTheme('#eff6ff', 'rgba(59, 130, 246, 0.1)')};
345
+ }
346
+
347
+ .platform-toggle-info {
348
+ display: flex;
349
+ align-items: center;
350
+ gap: 12px;
351
+ }
352
+
353
+ .platform-toggle-icon {
354
+ width: 36px;
355
+ height: 36px;
356
+ border-radius: 8px;
357
+ background: ${cssManager.bdTheme('#ffffff', '#27272a')};
358
+ display: flex;
359
+ align-items: center;
360
+ justify-content: center;
361
+ }
362
+
363
+ .platform-toggle-icon svg {
364
+ width: 20px;
365
+ height: 20px;
366
+ color: ${cssManager.bdTheme('#18181b', '#fafafa')};
367
+ }
368
+
369
+ .platform-toggle-name {
370
+ font-size: 14px;
371
+ font-weight: 500;
372
+ color: ${cssManager.bdTheme('#18181b', '#fafafa')};
373
+ }
374
+
375
+ .platform-toggle-desc {
376
+ font-size: 12px;
377
+ color: ${cssManager.bdTheme('#71717a', '#a1a1aa')};
378
+ margin-top: 2px;
379
+ }
380
+
381
+ .toggle-switch {
382
+ position: relative;
383
+ width: 44px;
384
+ height: 24px;
385
+ flex-shrink: 0;
386
+ }
387
+
388
+ .toggle-switch input {
389
+ opacity: 0;
390
+ width: 0;
391
+ height: 0;
392
+ }
393
+
394
+ .toggle-slider {
395
+ position: absolute;
396
+ cursor: pointer;
397
+ top: 0;
398
+ left: 0;
399
+ right: 0;
400
+ bottom: 0;
401
+ background: ${cssManager.bdTheme('#d4d4d8', '#3f3f46')};
402
+ border-radius: 12px;
403
+ transition: background 200ms ease;
404
+ }
405
+
406
+ .toggle-slider::before {
407
+ content: '';
408
+ position: absolute;
409
+ height: 18px;
410
+ width: 18px;
411
+ left: 3px;
412
+ bottom: 3px;
413
+ background: white;
414
+ border-radius: 50%;
415
+ transition: transform 200ms ease;
416
+ }
417
+
418
+ .toggle-switch input:checked + .toggle-slider {
419
+ background: ${cssManager.bdTheme('#3b82f6', '#60a5fa')};
420
+ }
421
+
422
+ .toggle-switch input:checked + .toggle-slider::before {
423
+ transform: translateX(20px);
424
+ }
425
+
315
426
  .actions {
316
427
  display: flex;
317
428
  justify-content: flex-end;
@@ -536,6 +647,81 @@ export class SzServiceCreateView extends DeesElement {
536
647
  </button>
537
648
  </div>
538
649
 
650
+ <!-- Platform Services -->
651
+ <div class="section">
652
+ <div class="section-title">
653
+ <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
654
+ <rect x="2" y="2" width="20" height="8" rx="2" ry="2"></rect>
655
+ <rect x="2" y="14" width="20" height="8" rx="2" ry="2"></rect>
656
+ <line x1="6" y1="6" x2="6.01" y2="6"></line>
657
+ <line x1="6" y1="18" x2="6.01" y2="18"></line>
658
+ </svg>
659
+ Platform Services
660
+ </div>
661
+ <div class="form-hint" style="margin-bottom: 12px;">
662
+ Enable managed infrastructure services for this deployment. Resources are automatically provisioned and connection details injected as environment variables.
663
+ </div>
664
+ <div class="platform-toggle-list">
665
+ <label class="platform-toggle-item">
666
+ <div class="platform-toggle-info">
667
+ <div class="platform-toggle-icon">
668
+ <svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"/></svg>
669
+ </div>
670
+ <div>
671
+ <div class="platform-toggle-name">MongoDB</div>
672
+ <div class="platform-toggle-desc">Document database with auto-provisioned credentials</div>
673
+ </div>
674
+ </div>
675
+ <div class="toggle-switch">
676
+ <input
677
+ type="checkbox"
678
+ ?checked=${this.enableMongoDB}
679
+ @change=${(e: Event) => this.enableMongoDB = (e.target as HTMLInputElement).checked}
680
+ >
681
+ <span class="toggle-slider"></span>
682
+ </div>
683
+ </label>
684
+ <label class="platform-toggle-item">
685
+ <div class="platform-toggle-info">
686
+ <div class="platform-toggle-icon">
687
+ <svg viewBox="0 0 24 24" fill="currentColor"><path d="M21 16.5c0 .38-.21.71-.53.88l-7.9 4.44c-.16.12-.36.18-.57.18-.21 0-.41-.06-.57-.18l-7.9-4.44A.991.991 0 0 1 3 16.5v-9c0-.38.21-.71.53-.88l7.9-4.44c.16-.12.36-.18.57-.18.21 0 .41.06.57.18l7.9 4.44c.32.17.53.5.53.88v9z"/></svg>
688
+ </div>
689
+ <div>
690
+ <div class="platform-toggle-name">S3 Storage (MinIO)</div>
691
+ <div class="platform-toggle-desc">Object storage bucket with auto-provisioned access keys</div>
692
+ </div>
693
+ </div>
694
+ <div class="toggle-switch">
695
+ <input
696
+ type="checkbox"
697
+ ?checked=${this.enableS3}
698
+ @change=${(e: Event) => this.enableS3 = (e.target as HTMLInputElement).checked}
699
+ >
700
+ <span class="toggle-slider"></span>
701
+ </div>
702
+ </label>
703
+ <label class="platform-toggle-item">
704
+ <div class="platform-toggle-info">
705
+ <div class="platform-toggle-icon">
706
+ <svg viewBox="0 0 24 24" fill="currentColor"><rect x="2" y="2" width="6" height="20"/><rect x="9" y="7" width="6" height="15"/><rect x="16" y="12" width="6" height="10"/></svg>
707
+ </div>
708
+ <div>
709
+ <div class="platform-toggle-name">ClickHouse</div>
710
+ <div class="platform-toggle-desc">Analytics database with auto-provisioned credentials</div>
711
+ </div>
712
+ </div>
713
+ <div class="toggle-switch">
714
+ <input
715
+ type="checkbox"
716
+ ?checked=${this.enableClickHouse}
717
+ @change=${(e: Event) => this.enableClickHouse = (e.target as HTMLInputElement).checked}
718
+ >
719
+ <span class="toggle-slider"></span>
720
+ </div>
721
+ </label>
722
+ </div>
723
+ </div>
724
+
539
725
  <!-- Advanced Options Toggle -->
540
726
  <button
541
727
  class="toggle-advanced ${this.showAdvanced ? 'open' : ''}"
@@ -750,6 +936,9 @@ export class SzServiceCreateView extends DeesElement {
750
936
  memoryLimit: this.memoryLimit,
751
937
  restartPolicy: this.restartPolicy,
752
938
  networkMode: this.networkMode,
939
+ enableMongoDB: this.enableMongoDB,
940
+ enableS3: this.enableS3,
941
+ enableClickHouse: this.enableClickHouse,
753
942
  };
754
943
 
755
944
  this.dispatchEvent(new CustomEvent('create-service', {
@@ -771,5 +960,8 @@ export class SzServiceCreateView extends DeesElement {
771
960
  this.restartPolicy = 'always';
772
961
  this.networkMode = 'bridge';
773
962
  this.showAdvanced = false;
963
+ this.enableMongoDB = false;
964
+ this.enableS3 = false;
965
+ this.enableClickHouse = false;
774
966
  }
775
967
  }