@forgeroute/ui 0.3.2 → 0.3.3

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,16 +1,20 @@
1
1
  {
2
2
  "name": "@forgeroute/ui",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=22.0.0",
6
6
  "@angular/core": ">=22.0.0",
7
7
  "@angular/forms": ">=22.0.0",
8
8
  "@angular/router": ">=22.0.0",
9
- "@angular/platform-browser": ">=22.0.0"
9
+ "@angular/platform-browser": ">=22.0.0",
10
+ "chart.js": ">=4.0.0"
10
11
  },
11
12
  "peerDependenciesMeta": {
12
13
  "@angular/forms": {
13
14
  "optional": false
15
+ },
16
+ "chart.js": {
17
+ "optional": true
14
18
  }
15
19
  },
16
20
  "publishConfig": {
@@ -1823,6 +1823,99 @@ export declare class ProgressBarComponent {
1823
1823
  };
1824
1824
  }, {}, never, never, true, never>;
1825
1825
  }
1826
+ /**
1827
+ * Bar chart of one series (e.g. calls per day). Pass the category `labels` and the matching `values`.
1828
+ *
1829
+ * <ui-bar-chart [labels]="['8/1', '8/2']" [values]="[3, 0]" ariaLabel="Daily call volume"
1830
+ * unitSingular="call" unitPlural="calls" />
1831
+ *
1832
+ * - Bars show their value above them (`showValues`, a 0 bar shows nothing), the y axis starts at 0 and counts whole numbers.
1833
+ * - The tooltip reads "<value> <unit>" (`unitSingular` for 1, `unitPlural` otherwise; no unit = just the number).
1834
+ * - The canvas is an image for assistive tech (`role="img"` + `ariaLabel`); render the same figures as text next to it
1835
+ * (e.g. a visually hidden list) when the exact values matter.
1836
+ * - Height is `height` px (shorter on phones: 200px up to 768px wide, 160px up to 480px wide, when the default 240 is used);
1837
+ * the width follows the container. Needs the optional peer dependency `chart.js` (>= 4).
1838
+ */
1839
+ export declare class BarChartComponent {
1840
+ /** Category labels, left to right (one per bar). */
1841
+ readonly labels: import("@angular/core").InputSignal<string[]>;
1842
+ /** The bar values, in the order of `labels`. */
1843
+ readonly values: import("@angular/core").InputSignal<number[]>;
1844
+ /** Bar colour (any CSS colour). */
1845
+ readonly color: import("@angular/core").InputSignal<string>;
1846
+ /** Bar colour while hovered. */
1847
+ readonly hoverColor: import("@angular/core").InputSignal<string>;
1848
+ /** Chart height in px. */
1849
+ readonly height: import("@angular/core").InputSignal<number>;
1850
+ /** Spoken description of the chart. */
1851
+ readonly ariaLabel: import("@angular/core").InputSignal<string>;
1852
+ /** Show each bar's value above it. */
1853
+ readonly showValues: import("@angular/core").InputSignal<boolean>;
1854
+ /** Tooltip unit for exactly 1 (e.g. "call"). */
1855
+ readonly unitSingular: import("@angular/core").InputSignal<string>;
1856
+ /** Tooltip unit for any other value (e.g. "calls"). */
1857
+ readonly unitPlural: import("@angular/core").InputSignal<string>;
1858
+ private readonly canvas;
1859
+ private readonly zone;
1860
+ private chart;
1861
+ private readonly tooltipText;
1862
+ protected readonly series: import("@angular/core").Signal<{
1863
+ labels: string[];
1864
+ data: number[];
1865
+ color: string;
1866
+ hoverColor: string;
1867
+ showValues: boolean;
1868
+ }>;
1869
+ constructor();
1870
+ static ɵfac: i0.ɵɵFactoryDeclaration<BarChartComponent, never>;
1871
+ static ɵcmp: i0.ɵɵComponentDeclaration<BarChartComponent, "ui-bar-chart", never, {
1872
+ "labels": {
1873
+ "alias": "labels";
1874
+ "required": false;
1875
+ "isSignal": true;
1876
+ };
1877
+ "values": {
1878
+ "alias": "values";
1879
+ "required": false;
1880
+ "isSignal": true;
1881
+ };
1882
+ "color": {
1883
+ "alias": "color";
1884
+ "required": false;
1885
+ "isSignal": true;
1886
+ };
1887
+ "hoverColor": {
1888
+ "alias": "hoverColor";
1889
+ "required": false;
1890
+ "isSignal": true;
1891
+ };
1892
+ "height": {
1893
+ "alias": "height";
1894
+ "required": false;
1895
+ "isSignal": true;
1896
+ };
1897
+ "ariaLabel": {
1898
+ "alias": "ariaLabel";
1899
+ "required": false;
1900
+ "isSignal": true;
1901
+ };
1902
+ "showValues": {
1903
+ "alias": "showValues";
1904
+ "required": false;
1905
+ "isSignal": true;
1906
+ };
1907
+ "unitSingular": {
1908
+ "alias": "unitSingular";
1909
+ "required": false;
1910
+ "isSignal": true;
1911
+ };
1912
+ "unitPlural": {
1913
+ "alias": "unitPlural";
1914
+ "required": false;
1915
+ "isSignal": true;
1916
+ };
1917
+ }, {}, never, never, true, never>;
1918
+ }
1826
1919
  export declare class SkeletonComponent {
1827
1920
  readonly height: import("@angular/core").InputSignal<number>;
1828
1921
  readonly width: import("@angular/core").InputSignal<string>;