@akcelik/strct 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.
@@ -9138,6 +9138,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.16", ngImpo
9138
9138
  `, host: { class: 'strct-spark' }, styles: [".strct-spark{display:inline-block;line-height:0}.strct-spark__line{stroke-width:1.6;vector-effect:non-scaling-stroke;stroke-linejoin:round;stroke-linecap:round}.strct-spark__area{opacity:.14}\n"] }]
9139
9139
  }], propDecorators: { data: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }], area: [{ type: i0.Input, args: [{ isSignal: true, alias: "area", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }] } });
9140
9140
 
9141
+ /** Resolve a color role to its CSS value. */
9142
+ function colorOf(role) {
9143
+ return role.startsWith('chart-') ? `var(--${role})` : COLOR$1[role];
9144
+ }
9141
9145
  const COLOR$1 = {
9142
9146
  accent: 'var(--acc)',
9143
9147
  success: 'var(--success)',
@@ -9644,7 +9648,7 @@ class StrctChart {
9644
9648
  }
9645
9649
  const curve = x.curve ?? this.curve();
9646
9650
  return {
9647
- color: COLOR$1[x.status ?? this.status()],
9651
+ color: colorOf(x.color ?? x.status ?? this.status()),
9648
9652
  label: x.label ?? '',
9649
9653
  area: false,
9650
9654
  dash: x.dash ? (typeof x.dash === 'string' ? x.dash : '5 4') : null,
@@ -9670,7 +9674,7 @@ class StrctChart {
9670
9674
  ? bandPath(x.upper.map((v, i) => ptOf(v, i)), x.lower.map((v, i) => ptOf(v, i)), curve)
9671
9675
  : '';
9672
9676
  return {
9673
- color: COLOR$1[x.status ?? this.status()],
9677
+ color: colorOf(x.color ?? x.status ?? this.status()),
9674
9678
  label: x.label ?? '',
9675
9679
  area,
9676
9680
  dash: x.dash ? (typeof x.dash === 'string' ? x.dash : '5 4') : null,