@aquera/nile-visualization 2.9.3 → 2.9.5

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.
@@ -111,6 +111,8 @@ export declare class NileChart extends NileElement {
111
111
  addAiResponse(text: string): void;
112
112
  private handleAiSend;
113
113
  private switchType;
114
+ /** Single-control filter chart where the in-body label should be promoted to the chart header. */
115
+ private get isPromotableFilter();
114
116
  private get headerTitle();
115
117
  private get headerSubtitle();
116
118
  private onHeaderSlotChange;
@@ -286,11 +286,32 @@ let NileChart = class NileChart extends NileElement {
286
286
  config: converted,
287
287
  });
288
288
  }
289
+ /** Single-control filter chart where the in-body label should be promoted to the chart header. */
290
+ get isPromotableFilter() {
291
+ const cfg = (this.activeConfig ?? this.resolvedConfig);
292
+ return cfg?.type === 'filter'
293
+ && Array.isArray(cfg?.controls)
294
+ && cfg.controls.length === 1;
295
+ }
289
296
  get headerTitle() {
290
- return this.activeConfig?.chartTitle ?? this.resolvedConfig?.chartTitle ?? '';
297
+ const explicit = this.activeConfig?.chartTitle ?? this.resolvedConfig?.chartTitle;
298
+ if (explicit)
299
+ return explicit;
300
+ if (this.isPromotableFilter) {
301
+ const cfg = (this.activeConfig ?? this.resolvedConfig);
302
+ return cfg.controls[0]?.label ?? '';
303
+ }
304
+ return '';
291
305
  }
292
306
  get headerSubtitle() {
293
- return this.activeConfig?.chartSubtitle ?? this.resolvedConfig?.chartSubtitle ?? '';
307
+ const explicit = this.activeConfig?.chartSubtitle ?? this.resolvedConfig?.chartSubtitle;
308
+ if (explicit)
309
+ return explicit;
310
+ if (this.isPromotableFilter) {
311
+ const cfg = (this.activeConfig ?? this.resolvedConfig);
312
+ return cfg.controls[0]?.description ?? '';
313
+ }
314
+ return '';
294
315
  }
295
316
  onHeaderSlotChange(e) {
296
317
  const slot = e.target;
@@ -1675,8 +1696,10 @@ let NileChart = class NileChart extends NileElement {
1675
1696
  ></nile-data-grid>`;
1676
1697
  }
1677
1698
  case 'filter': {
1699
+ const promote = this.isPromotableFilter;
1678
1700
  return html `<nile-filter-chart
1679
1701
  .config=${{ chart: config }}
1702
+ ?hide-control-headers=${promote}
1680
1703
  @nile-change="${(e) => this.emit('nile-change', e.detail)}"
1681
1704
  ></nile-filter-chart>`;
1682
1705
  }
@@ -90,7 +90,10 @@ export const styles = css `
90
90
  color: var(--nile-colors-neutral-700, var(--ng-colors-text-tertiary-600));
91
91
  text-transform: uppercase;
92
92
  letter-spacing: 0.05em;
93
+ line-height: 1.4;
94
+ padding-top: 2px;
93
95
  margin-bottom: var(--nile-spacing-4px, var(--ng-spacing-1));
96
+ overflow: visible;
94
97
  }
95
98
 
96
99
  .fc-control__desc {
@@ -487,9 +490,9 @@ export const styles = css `
487
490
  outline: none;
488
491
  background: transparent;
489
492
  border-radius: inherit;
490
- padding: var(--nile-spacing-2xl, var(--ng-spacing-5)) var(--nile-spacing-xl, var(--ng-spacing-4));
493
+ padding: var(--nile-spacing-lg, var(--ng-spacing-3)) var(--nile-spacing-lg, var(--ng-spacing-3));
491
494
  font-family: var(--nile-font-family-serif, var(--ng-font-family-body));
492
- font-size: var(--nile-type-scale-4, var(--ng-font-size-text-md));
495
+ font-size: var(--nile-font-size-sm);
493
496
  color: var(--nile-colors-dark-900, var(--ng-colors-text-primary-900));
494
497
  line-height: 1.4;
495
498
  box-sizing: border-box;
@@ -5,6 +5,9 @@ export type { NileTagVariant, FilterOption, QueryLanguageConfig, QueryNode, Quer
5
5
  export declare class NileFilterChart extends NileElement implements FilterChartHost {
6
6
  static get styles(): CSSResultArray;
7
7
  config: FilterChartSeparatedPayload | null;
8
+ /** When set, the host (e.g. nile-chart) is already rendering the control's label/description
9
+ * in its own header — skip the in-body copies to avoid duplication. */
10
+ hideControlHeaders: boolean;
8
11
  selectedValues: Map<string, unknown>;
9
12
  private collapsedGroups;
10
13
  /** Currently displayed (animated) placeholder text per prompt-variant control id. */
@@ -21,6 +21,9 @@ let NileFilterChart = NileFilterChart_1 = class NileFilterChart extends NileElem
21
21
  constructor() {
22
22
  super(...arguments);
23
23
  this.config = null;
24
+ /** When set, the host (e.g. nile-chart) is already rendering the control's label/description
25
+ * in its own header — skip the in-body copies to avoid duplication. */
26
+ this.hideControlHeaders = false;
24
27
  this.selectedValues = new Map();
25
28
  this.collapsedGroups = new Set();
26
29
  /** Currently displayed (animated) placeholder text per prompt-variant control id. */
@@ -468,10 +471,11 @@ let NileFilterChart = NileFilterChart_1 = class NileFilterChart extends NileElem
468
471
  break;
469
472
  default: body = html ``;
470
473
  }
474
+ const showHeader = !this.hideControlHeaders;
471
475
  return html `
472
476
  <div class="fc-control" part="filter-control">
473
- ${ctrl.label ? html `<div class="fc-control__label">${ctrl.label}</div>` : nothing}
474
- ${ctrl.description ? html `<div class="fc-control__desc">${ctrl.description}</div>` : nothing}
477
+ ${showHeader && ctrl.label ? html `<div class="fc-control__label">${ctrl.label}</div>` : nothing}
478
+ ${showHeader && ctrl.description ? html `<div class="fc-control__desc">${ctrl.description}</div>` : nothing}
475
479
  <div class="fc-control__body">${body}</div>
476
480
  </div>`;
477
481
  }
@@ -541,6 +545,9 @@ NileFilterChart._PROMPT_DEBOUNCE_MS = 500;
541
545
  __decorate([
542
546
  property({ attribute: false })
543
547
  ], NileFilterChart.prototype, "config", void 0);
548
+ __decorate([
549
+ property({ type: Boolean, attribute: 'hide-control-headers', reflect: true })
550
+ ], NileFilterChart.prototype, "hideControlHeaders", void 0);
544
551
  __decorate([
545
552
  state()
546
553
  ], NileFilterChart.prototype, "selectedValues", void 0);
@@ -135,6 +135,7 @@ export const styles = css `
135
135
  width: 100%;
136
136
  max-width: 100%;
137
137
  box-sizing: border-box;
138
+ flex-shrink: 0;
138
139
  }
139
140
 
140
141
  .kpi-value-row {
@@ -144,6 +145,7 @@ export const styles = css `
144
145
  flex-wrap: nowrap;
145
146
  min-width: 0;
146
147
  overflow: hidden;
148
+ flex-shrink: 0;
147
149
  }
148
150
 
149
151
  .kpi-value {
@@ -225,13 +227,15 @@ export const styles = css `
225
227
  width: 100%;
226
228
  max-width: 100%;
227
229
  box-sizing: border-box;
230
+ flex-shrink: 1;
228
231
  }
229
232
 
230
233
  .kpi-sparkline {
231
234
  width: 100%;
232
- flex: 0 1 48px;
233
- min-height: 22px;
235
+ flex: 1 1 0;
236
+ min-height: 0;
234
237
  margin-top: var(--nile-spacing-xs, var(--ng-spacing-xs));
238
+ overflow: hidden;
235
239
  }
236
240
 
237
241
  /* ── Container queries: scale down for narrow cards ── */
@@ -264,8 +268,7 @@ export const styles = css `
264
268
  }
265
269
 
266
270
  .kpi-sparkline {
267
- flex-basis: 32px;
268
- min-height: 18px;
271
+ min-height: 0;
269
272
  }
270
273
  }
271
274
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aquera/nile-visualization",
3
- "version": "2.9.3",
3
+ "version": "2.9.5",
4
4
  "description": "A visualization Library for the Nile Design System",
5
5
  "license": "MIT",
6
6
  "author": "Aquera Inc",