@eagami/ui 5.68.0 → 5.69.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": "@eagami/ui",
3
- "version": "5.68.0",
3
+ "version": "5.69.0",
4
4
  "description": "Lightweight, accessible, themeable Angular UI component library and icon set built on CSS custom properties",
5
5
  "author": "Michal Wiraszka <michal@eagami.com>",
6
6
  "license": "MIT",
@@ -74,6 +74,14 @@ export interface EagamiMessages {
74
74
  point: (series: string, label: string, value: string) => string;
75
75
  /** Announces the highlighted slice of a pie chart. */
76
76
  slice: (label: string, value: string, percent: string) => string;
77
+ /** Caption beneath the total in a donut's hole. */
78
+ total: string;
79
+ /** Default accessible name of a sparkline. */
80
+ trend: string;
81
+ /** Describes a sparkline by its first, last, lowest, and highest values. */
82
+ trendSummary: (first: string, last: string, low: string, high: string) => string;
83
+ /** Reads out a reference line; `label` is empty when the line has none. */
84
+ referenceLine: (label: string, value: string) => string;
77
85
  };
78
86
  codeInput: {
79
87
  groupLabel: (length: number) => string;
@@ -1403,6 +1411,16 @@ interface ChartPointEvent {
1403
1411
  label: string;
1404
1412
  value: number;
1405
1413
  }
1414
+ /** A dashed rule across a line or bar chart's plot at a value, such as a target or an average. */
1415
+ interface ChartReferenceLine {
1416
+ value: number;
1417
+ /** Text printed at the line's end and read out with the chart's data. */
1418
+ label?: string;
1419
+ /** Any CSS color; defaults to the strong border color. */
1420
+ color?: string;
1421
+ }
1422
+ /** How a line bends between points. */
1423
+ type ChartCurve = 'linear' | 'smooth' | 'step';
1406
1424
  /** Number of categorical colors in the `--color-chart-*` palette. */
1407
1425
  declare const CHART_COLOR_COUNT = 8;
1408
1426
  /** Resolves a series' color, falling back to its slot of the chart palette. */
@@ -1418,9 +1436,18 @@ interface NiceScale {
1418
1436
  * where a gap would otherwise exceed `maxStep`.
1419
1437
  */
1420
1438
  declare function niceScale(min: number, max: number, maxTicks?: number, maxStep?: number): NiceScale;
1439
+ /** A plotted point in pixels. */
1440
+ interface CurvePoint {
1441
+ x: number;
1442
+ y: number;
1443
+ }
1444
+ /** SVG path data tracing a run of points with each curve. */
1445
+ declare const CHART_CURVES: Record<ChartCurve, (points: CurvePoint[]) => string>;
1446
+ /** Reference lines with a finite value, the only ones a chart can place. */
1447
+ declare function plottableReferenceLines(lines: readonly ChartReferenceLine[]): ChartReferenceLine[];
1421
1448
  /** Rough rendered width of `text` in px, for reserving axis room without a layout pass. */
1422
1449
  declare function estimateTextWidth(text: string, fontPx: number): number;
1423
- /** Live size of a chart's host, re-measured on resize and whenever `size` changes. */
1450
+ /** Live size of a chart's host, re-measured on resize and whenever `remeasureOn` changes. */
1424
1451
  interface ChartViewport {
1425
1452
  width: Signal<number>;
1426
1453
  fontSize: Signal<number>;
@@ -1429,7 +1456,7 @@ interface ChartViewport {
1429
1456
  * Measures the host's width and font-size so the chart can lay out its SVG in
1430
1457
  * real pixels, keeping text and stroke widths crisp at every width.
1431
1458
  */
1432
- declare function injectChartViewport(size: Signal<ChartSize>): ChartViewport;
1459
+ declare function injectChartViewport(remeasureOn: Signal<unknown>): ChartViewport;
1433
1460
  /** Localized value formatter honouring a consumer's own `formatValue`. */
1434
1461
  declare function injectChartFormatter(formatValue: Signal<((value: number) => string) | null>): Signal<(value: number) => string>;
1435
1462
  /** Keeps a value inside `[min, max]`. */
@@ -1473,7 +1500,7 @@ export type BarChartOrientation = 'vertical' | 'horizontal';
1473
1500
  * another, and `fade` fades the bars in.
1474
1501
  */
1475
1502
  export type BarChartAnimation = 'grow' | 'cascade' | 'fade' | 'none';
1476
- interface PlotBar {
1503
+ interface PlotBar$1 {
1477
1504
  series: number;
1478
1505
  index: number;
1479
1506
  value: number;
@@ -1521,6 +1548,11 @@ export declare class BarChartComponent {
1521
1548
  * zero, when every value is positive, and marks the cut with a break symbol.
1522
1549
  */
1523
1550
  readonly showAxisBreak: import("@angular/core").InputSignal<boolean>;
1551
+ /**
1552
+ * Dashed rules across the plot at set values, such as a target or an
1553
+ * average. The value axis widens to take them in.
1554
+ */
1555
+ readonly referenceLines: import("@angular/core").InputSignal<readonly ChartReferenceLine[]>;
1524
1556
  /** Height of the plot in pixels; the width fills the container. */
1525
1557
  readonly height: import("@angular/core").InputSignal<number>;
1526
1558
  /** Visual size; scales the axis, legend, and tooltip text and the bar thickness cap. */
@@ -1543,6 +1575,7 @@ export declare class BarChartComponent {
1543
1575
  protected readonly label: import("@angular/core").Signal<string>;
1544
1576
  protected readonly count: import("@angular/core").Signal<number>;
1545
1577
  protected readonly hasData: import("@angular/core").Signal<boolean>;
1578
+ protected readonly references: import("@angular/core").Signal<ChartReferenceLine[]>;
1546
1579
  protected readonly renderPass: import("@angular/core").Signal<{}[]>;
1547
1580
  protected readonly hostClasses: import("@angular/core").Signal<{
1548
1581
  [x: string]: boolean;
@@ -1571,8 +1604,18 @@ export declare class BarChartComponent {
1571
1604
  index: number;
1572
1605
  pos: number;
1573
1606
  }[];
1574
- bars: PlotBar[];
1607
+ bars: PlotBar$1[];
1575
1608
  valueLabels: PlotValueLabel[];
1609
+ referenceLines: {
1610
+ labelX: number;
1611
+ labelY: number;
1612
+ anchor: "start" | "end";
1613
+ key: number;
1614
+ pos: number;
1615
+ value: number;
1616
+ label?: string;
1617
+ color?: string;
1618
+ }[];
1576
1619
  valuePos: (v: number) => number;
1577
1620
  axisY: number;
1578
1621
  tickEndY: number;
@@ -1607,7 +1650,8 @@ export declare class BarChartComponent {
1607
1650
  protected readonly announcement: import("@angular/core").Signal<string>;
1608
1651
  protected readonly showsLegend: import("@angular/core").Signal<boolean>;
1609
1652
  protected seriesColor(index: number): string;
1610
- protected isDimmed(bar: PlotBar): boolean;
1653
+ protected isDimmed(bar: PlotBar$1): boolean;
1654
+ protected referenceText(line: ChartReferenceLine): string;
1611
1655
  protected tableValue(value: number | null | undefined): string;
1612
1656
  protected onPointerMove(event: PointerEvent): void;
1613
1657
  protected onPointerLeave(): void;
@@ -1667,6 +1711,11 @@ export declare class BarChartComponent {
1667
1711
  "required": false;
1668
1712
  "isSignal": true;
1669
1713
  };
1714
+ "referenceLines": {
1715
+ "alias": "referenceLines";
1716
+ "required": false;
1717
+ "isSignal": true;
1718
+ };
1670
1719
  "height": {
1671
1720
  "alias": "height";
1672
1721
  "required": false;
@@ -5410,7 +5459,7 @@ export declare class InputComponent implements ControlValueAccessor {
5410
5459
  }, never, ["[slot=prefix]", "[slot=suffix]"], true, never>;
5411
5460
  }
5412
5461
  /** How the line bends between points. */
5413
- export type LineChartCurve = 'linear' | 'smooth' | 'step';
5462
+ export type LineChartCurve = ChartCurve;
5414
5463
  /**
5415
5464
  * Entrance animation, replayed whenever the data changes. `draw` traces each
5416
5465
  * line along its length, `reveal` wipes every line in together from left to
@@ -5500,7 +5549,7 @@ export declare class LineChartComponent {
5500
5549
  */
5501
5550
  readonly visibleXSpan: import("@angular/core").InputSignal<number | null>;
5502
5551
  /** How the line bends between points. */
5503
- readonly curve: import("@angular/core").InputSignal<LineChartCurve>;
5552
+ readonly curve: import("@angular/core").InputSignal<ChartCurve>;
5504
5553
  /** Fills the area beneath each line with a light wash of its color. */
5505
5554
  readonly showArea: import("@angular/core").InputSignal<boolean>;
5506
5555
  /** Marks every value with a point. */
@@ -5515,6 +5564,12 @@ export declare class LineChartComponent {
5515
5564
  readonly yMax: import("@angular/core").InputSignal<number | undefined>;
5516
5565
  /** Largest gap between y-axis ticks; a wider range gets more ticks instead of wider gaps. */
5517
5566
  readonly maxYStep: import("@angular/core").InputSignal<number | undefined>;
5567
+ /**
5568
+ * Dashed rules across the plot at set values, such as a target or an
5569
+ * average. The y-axis widens to take them in, unless `yMin` or `yMax` cuts
5570
+ * them off.
5571
+ */
5572
+ readonly referenceLines: import("@angular/core").InputSignal<readonly ChartReferenceLine[]>;
5518
5573
  /** How the x-axis labels are set; `auto` turns them as they run out of room. */
5519
5574
  readonly xLabelOrientation: import("@angular/core").InputSignal<ChartLabelOrientation>;
5520
5575
  /** Marks the foot of a y-axis that stops short of zero with a break symbol. */
@@ -5556,6 +5611,7 @@ export declare class LineChartComponent {
5556
5611
  private readonly positions;
5557
5612
  protected readonly domain: import("@angular/core").Signal<XDomain>;
5558
5613
  protected readonly windowed: import("@angular/core").Signal<boolean>;
5614
+ protected readonly references: import("@angular/core").Signal<ChartReferenceLine[]>;
5559
5615
  protected readonly renderPass: import("@angular/core").Signal<{}[]>;
5560
5616
  protected readonly hostClasses: import("@angular/core").Signal<{
5561
5617
  [x: string]: boolean;
@@ -5564,6 +5620,7 @@ export declare class LineChartComponent {
5564
5620
  }>;
5565
5621
  private readonly runs;
5566
5622
  private readonly visibleValues;
5623
+ private withReferences;
5567
5624
  protected readonly layout: import("@angular/core").Signal<{
5568
5625
  width: number;
5569
5626
  height: number;
@@ -5586,6 +5643,14 @@ export declare class LineChartComponent {
5586
5643
  }[];
5587
5644
  xLabels: PlacedXLabel[];
5588
5645
  series: PlotSeries[];
5646
+ references: {
5647
+ labelY: number;
5648
+ key: number;
5649
+ y: number;
5650
+ value: number;
5651
+ label?: string;
5652
+ color?: string;
5653
+ }[];
5589
5654
  x: (i: number) => number;
5590
5655
  y: (v: number) => number;
5591
5656
  }>;
@@ -5620,6 +5685,7 @@ export declare class LineChartComponent {
5620
5685
  protected seriesColor(index: number): string;
5621
5686
  protected isDimmed(index: number): boolean;
5622
5687
  protected isActivePoint(seriesIndex: number, index: number): boolean;
5688
+ protected referenceText(line: ChartReferenceLine): string;
5623
5689
  protected tableValue(value: number | null | undefined): string;
5624
5690
  protected onPointerDown(event: PointerEvent): void;
5625
5691
  protected onPointerMove(event: PointerEvent): void;
@@ -5722,6 +5788,11 @@ export declare class LineChartComponent {
5722
5788
  "required": false;
5723
5789
  "isSignal": true;
5724
5790
  };
5791
+ "referenceLines": {
5792
+ "alias": "referenceLines";
5793
+ "required": false;
5794
+ "isSignal": true;
5795
+ };
5725
5796
  "xLabelOrientation": {
5726
5797
  "alias": "xLabelOrientation";
5727
5798
  "required": false;
@@ -6525,6 +6596,10 @@ export declare class PieChartComponent {
6525
6596
  readonly showLegend: import("@angular/core").InputSignal<boolean>;
6526
6597
  /** Adds each slice's share of the total to its legend entry. */
6527
6598
  readonly showPercentages: import("@angular/core").InputSignal<boolean>;
6599
+ /** Prints the total of every slice in the middle of a donut. */
6600
+ readonly showTotal: import("@angular/core").InputSignal<boolean>;
6601
+ /** Caption beneath a donut's total; defaults to a localized "Total". */
6602
+ readonly totalLabel: import("@angular/core").InputSignal<string | undefined>;
6528
6603
  /** Largest diameter of the chart in pixels; it shrinks to fit a narrower container. */
6529
6604
  readonly height: import("@angular/core").InputSignal<number>;
6530
6605
  /** Visual size; scales the legend and tooltip text. */
@@ -6559,6 +6634,12 @@ export declare class PieChartComponent {
6559
6634
  inner: number;
6560
6635
  slices: PlotSlice[];
6561
6636
  }>;
6637
+ protected readonly center: import("@angular/core").Signal<{
6638
+ value: string;
6639
+ caption: string;
6640
+ room: number;
6641
+ valuePx: number;
6642
+ } | null>;
6562
6643
  protected readonly legend: import("@angular/core").Signal<{
6563
6644
  label: string;
6564
6645
  color: string;
@@ -6583,6 +6664,7 @@ export declare class PieChartComponent {
6583
6664
  protected readonly announcement: import("@angular/core").Signal<string>;
6584
6665
  protected tableValue(slice: PieChartSlice): string;
6585
6666
  protected tablePercent(index: number): string;
6667
+ protected totalPercent(): string;
6586
6668
  protected isDimmed(index: number): boolean;
6587
6669
  protected offset(slice: PlotSlice): string | null;
6588
6670
  protected onPointerMove(event: PointerEvent): void;
@@ -6618,6 +6700,16 @@ export declare class PieChartComponent {
6618
6700
  "required": false;
6619
6701
  "isSignal": true;
6620
6702
  };
6703
+ "showTotal": {
6704
+ "alias": "showTotal";
6705
+ "required": false;
6706
+ "isSignal": true;
6707
+ };
6708
+ "totalLabel": {
6709
+ "alias": "totalLabel";
6710
+ "required": false;
6711
+ "isSignal": true;
6712
+ };
6621
6713
  "height": {
6622
6714
  "alias": "height";
6623
6715
  "required": false;
@@ -7682,6 +7774,183 @@ export declare class SliderComponent implements ControlValueAccessor {
7682
7774
  "changed": "changed";
7683
7775
  }, never, never, true, never>;
7684
7776
  }
7777
+ /** How a sparkline draws its values. */
7778
+ export type SparklineVariant = 'line' | 'area' | 'bar';
7779
+ /**
7780
+ * Values a sparkline singles out: `last` the latest one, `extremes` the
7781
+ * highest and lowest as well, and `all` every value. A line or area marks them
7782
+ * with a dot; bars dim every other bar.
7783
+ */
7784
+ export type SparklineMarkers = 'none' | 'last' | 'extremes' | 'all';
7785
+ /**
7786
+ * Entrance animation, replayed whenever the data changes. `draw` traces the
7787
+ * line or grows the bars, and `fade` fades the sparkline in.
7788
+ */
7789
+ export type SparklineAnimation = 'draw' | 'fade' | 'none';
7790
+ interface PlotBar {
7791
+ index: number;
7792
+ x: number;
7793
+ y: number;
7794
+ width: number;
7795
+ height: number;
7796
+ }
7797
+ interface PlotPosition {
7798
+ index: number;
7799
+ x: number;
7800
+ y: number;
7801
+ }
7802
+ /**
7803
+ * A small, axis-free trend of one run of values, as a line, an area, or bars,
7804
+ * sized to sit in a stat tile, a table cell, or a line of text. It is a single
7805
+ * image to assistive technology, named by `aria-label` and described by its
7806
+ * first, last, lowest, and highest values.
7807
+ */
7808
+ export declare class SparklineComponent {
7809
+ protected readonly i18n: EagamiI18nService;
7810
+ /** The values to plot, oldest first; `null` leaves a gap. */
7811
+ readonly data: import("@angular/core").InputSignal<(number | null)[]>;
7812
+ /** Draws the values as a line, a line over a filled area, or bars. */
7813
+ readonly variant: import("@angular/core").InputSignal<SparklineVariant>;
7814
+ /** How a line or area bends between values. */
7815
+ readonly curve: import("@angular/core").InputSignal<ChartCurve>;
7816
+ /** Values singled out with a dot, or on bars by dimming the rest. */
7817
+ readonly markers: import("@angular/core").InputSignal<SparklineMarkers>;
7818
+ /** Any CSS color; defaults to the first color of the chart palette. */
7819
+ readonly color: import("@angular/core").InputSignal<string | undefined>;
7820
+ /**
7821
+ * Starts the scale of a line or area at zero, so its height shows the true
7822
+ * size of each value rather than a close-up of how they vary. Bars always
7823
+ * start at zero.
7824
+ */
7825
+ readonly startAtZero: import("@angular/core").InputSignal<boolean>;
7826
+ /** Shows the value under the pointer in a tooltip, on hover or while a finger slides along. */
7827
+ readonly showTooltip: import("@angular/core").InputSignal<boolean>;
7828
+ /** Height in pixels; the width fills the container. */
7829
+ readonly height: import("@angular/core").InputSignal<number>;
7830
+ /** Entrance animation, replayed whenever the data changes. */
7831
+ readonly animation: import("@angular/core").InputSignal<SparklineAnimation>;
7832
+ /** Length of the entrance animation in milliseconds. */
7833
+ readonly animationDuration: import("@angular/core").InputSignal<number>;
7834
+ /** Formats the values in the tooltip and those read out to assistive technology; locale-grouped by default. */
7835
+ readonly formatValue: import("@angular/core").InputSignal<((value: number) => string) | null>;
7836
+ /** Accessible name for the sparkline; defaults to a localized "Trend". */
7837
+ readonly ariaLabel: import("@angular/core").InputSignal<string | undefined>;
7838
+ private readonly viewport;
7839
+ private readonly format;
7840
+ protected readonly summaryId: string;
7841
+ protected readonly active: import("@angular/core").WritableSignal<number | null>;
7842
+ protected readonly label: import("@angular/core").Signal<string>;
7843
+ private readonly values;
7844
+ private readonly known;
7845
+ protected readonly hasData: import("@angular/core").Signal<boolean>;
7846
+ protected readonly renderPass: import("@angular/core").Signal<{}[]>;
7847
+ protected readonly hostClasses: import("@angular/core").Signal<{
7848
+ [x: string]: boolean;
7849
+ 'ea-sparkline--interactive': boolean;
7850
+ }>;
7851
+ protected readonly stroke: import("@angular/core").Signal<string>;
7852
+ private readonly marked;
7853
+ protected readonly layout: import("@angular/core").Signal<{
7854
+ width: number;
7855
+ height: number;
7856
+ baseline: number;
7857
+ bars: PlotBar[];
7858
+ paths: never[];
7859
+ areas: never[];
7860
+ markers: never[];
7861
+ positions: PlotPosition[];
7862
+ } | {
7863
+ width: number;
7864
+ height: number;
7865
+ baseline: number;
7866
+ bars: never[];
7867
+ paths: string[];
7868
+ areas: string[];
7869
+ markers: {
7870
+ r: number;
7871
+ x: number;
7872
+ y: number;
7873
+ }[];
7874
+ positions: PlotPosition[];
7875
+ }>;
7876
+ protected readonly activePosition: import("@angular/core").Signal<PlotPosition | null>;
7877
+ protected readonly activeRadius = 4.5;
7878
+ protected readonly tooltips: import("@angular/core").Signal<{
7879
+ key: number;
7880
+ text: string;
7881
+ index: number;
7882
+ x: number;
7883
+ y: number;
7884
+ }[]>;
7885
+ protected isDimmed(bar: PlotBar): boolean;
7886
+ protected onPointer(event: PointerEvent): void;
7887
+ protected onPointerUp(event: PointerEvent): void;
7888
+ protected clear(): void;
7889
+ protected readonly summary: import("@angular/core").Signal<string>;
7890
+ static ɵfac: i0.ɵɵFactoryDeclaration<SparklineComponent, never>;
7891
+ static ɵcmp: i0.ɵɵComponentDeclaration<SparklineComponent, "ea-sparkline", never, {
7892
+ "data": {
7893
+ "alias": "data";
7894
+ "required": false;
7895
+ "isSignal": true;
7896
+ };
7897
+ "variant": {
7898
+ "alias": "variant";
7899
+ "required": false;
7900
+ "isSignal": true;
7901
+ };
7902
+ "curve": {
7903
+ "alias": "curve";
7904
+ "required": false;
7905
+ "isSignal": true;
7906
+ };
7907
+ "markers": {
7908
+ "alias": "markers";
7909
+ "required": false;
7910
+ "isSignal": true;
7911
+ };
7912
+ "color": {
7913
+ "alias": "color";
7914
+ "required": false;
7915
+ "isSignal": true;
7916
+ };
7917
+ "startAtZero": {
7918
+ "alias": "startAtZero";
7919
+ "required": false;
7920
+ "isSignal": true;
7921
+ };
7922
+ "showTooltip": {
7923
+ "alias": "showTooltip";
7924
+ "required": false;
7925
+ "isSignal": true;
7926
+ };
7927
+ "height": {
7928
+ "alias": "height";
7929
+ "required": false;
7930
+ "isSignal": true;
7931
+ };
7932
+ "animation": {
7933
+ "alias": "animation";
7934
+ "required": false;
7935
+ "isSignal": true;
7936
+ };
7937
+ "animationDuration": {
7938
+ "alias": "animationDuration";
7939
+ "required": false;
7940
+ "isSignal": true;
7941
+ };
7942
+ "formatValue": {
7943
+ "alias": "formatValue";
7944
+ "required": false;
7945
+ "isSignal": true;
7946
+ };
7947
+ "ariaLabel": {
7948
+ "alias": "aria-label";
7949
+ "required": false;
7950
+ "isSignal": true;
7951
+ };
7952
+ }, {}, never, never, true, never>;
7953
+ }
7685
7954
  /** Visual size of the spinner. */
7686
7955
  export type SpinnerSize = EaSize;
7687
7956
  /**
@@ -13565,4 +13834,4 @@ export declare class ZoomOutIconComponent extends IconComponentBase {
13565
13834
  static ɵfac: i0.ɵɵFactoryDeclaration<ZoomOutIconComponent, never>;
13566
13835
  static ɵcmp: i0.ɵɵComponentDeclaration<ZoomOutIconComponent, "ea-icon-zoom-out", never, {}, {}, never, never, true, never>;
13567
13836
  }
13568
- export type { ChartLabelOrientation, ChartPointEvent, ChartSeries, ChartSize, EaErrorMessages, EaValidationErrorKey };
13837
+ export type { ChartCurve, ChartLabelOrientation, ChartPointEvent, ChartReferenceLine, ChartSeries, ChartSize, EaErrorMessages, EaValidationErrorKey };