@serve.zone/catalog 2.4.0 → 2.5.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.5.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.5.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