@gravionlabs/helix-ui 22.2.6 → 22.2.7

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": "@gravionlabs/helix-ui",
3
- "version": "22.2.6",
3
+ "version": "22.2.7",
4
4
  "description": "Helix UI: vanilla Angular components on the Helix design tokens — plain CSS, no runtime styling engine.",
5
5
  "license": "MIT",
6
6
  "keywords": [
@@ -47,11 +47,16 @@
47
47
  "types": "./types/gravionlabs-helix-ui.d.ts",
48
48
  "default": "./fesm2022/gravionlabs-helix-ui.mjs"
49
49
  },
50
+ "./chart": {
51
+ "types": "./types/gravionlabs-helix-ui-chart.d.ts",
52
+ "default": "./fesm2022/gravionlabs-helix-ui-chart.mjs"
53
+ },
50
54
  "./validators": {
51
55
  "types": "./types/gravionlabs-helix-ui-validators.d.ts",
52
56
  "default": "./fesm2022/gravionlabs-helix-ui-validators.mjs"
53
57
  },
54
58
  "./styles.css": "./styles.css",
59
+ "./core.css": "./core.css",
55
60
  "./tokens.css": "./tokens.css"
56
61
  },
57
62
  "type": "module"
package/styles.css CHANGED
@@ -1753,6 +1753,26 @@
1753
1753
  height: 2.5rem;
1754
1754
  }
1755
1755
 
1756
+ /* a header with extra content: the label (or sort button) and the content side by side */
1757
+ .hx-data-table-header-content {
1758
+ display: flex;
1759
+ align-items: center;
1760
+ gap: var(--h-datatable-header-cell-gap);
1761
+ }
1762
+
1763
+ .hx-data-table-header-content > .hx-data-table-sort {
1764
+ flex: 1 1 auto;
1765
+ width: auto;
1766
+ }
1767
+
1768
+ .hx-data-table-align-center .hx-data-table-header-content {
1769
+ justify-content: center;
1770
+ }
1771
+
1772
+ .hx-data-table-align-right .hx-data-table-header-content {
1773
+ justify-content: flex-end;
1774
+ }
1775
+
1756
1776
  /* sortable headers: a button that fills the header cell */
1757
1777
  .hx-data-table-sort {
1758
1778
  display: inline-flex;
@@ -2452,6 +2472,13 @@
2452
2472
  .hx-date-time-range-picker-popup {
2453
2473
  max-width: calc(100vw - 2rem);
2454
2474
  overflow: auto;
2475
+ /* the presets row and the body sit inside the popup, so the popup carries the outer border */
2476
+ border: 1px solid var(--h-datepicker-panel-border-color);
2477
+ }
2478
+
2479
+ /* the popup border already closes the button bar */
2480
+ .hx-date-time-range-picker-popup .hx-date-picker-buttonbar {
2481
+ border: 0;
2455
2482
  }
2456
2483
 
2457
2484
  .hx-date-time-range-picker-body {
@@ -2508,6 +2535,13 @@
2508
2535
  font-weight: var(--h-datepicker-title-font-weight);
2509
2536
  }
2510
2537
 
2538
+ .hx-date-time-range-picker-presets {
2539
+ display: flex;
2540
+ flex-wrap: wrap;
2541
+ gap: var(--h-datepicker-title-gap);
2542
+ padding: var(--h-datepicker-panel-padding) var(--h-datepicker-panel-padding) 0;
2543
+ }
2544
+
2511
2545
  /* dialog */
2512
2546
  /*
2513
2547
  * Dialog: `<hx-dialog>` and the dialogs of `HxDialogService`. The box (`.hx-dialog`) is a grid of the title, the
@@ -0,0 +1,134 @@
1
+ import * as i0 from "@angular/core";
2
+ import { InjectionToken } from "@angular/core";
3
+ type HxChartType = 'bar' | 'line' | 'scatter' | 'bubble' | 'pie' | 'doughnut' | 'polarArea' | 'radar';
4
+ /** What `(dataSelect)` carries: the click and what chart.js found under it. */
5
+ interface HxChartSelectEvent {
6
+ originalEvent: Event;
7
+ /** The nearest element under the pointer (chart.js `{ datasetIndex, index, element }`). */
8
+ element: unknown;
9
+ /** The elements of that dataset. */
10
+ dataset: unknown[];
11
+ }
12
+ /** The part of chart.js this component uses; the real module is `chart.js/auto`. */
13
+ interface HxChartModule {
14
+ default: new (canvas: HTMLCanvasElement, config: unknown) => HxChartInstance;
15
+ }
16
+ interface HxChartInstance {
17
+ data: unknown;
18
+ options: unknown;
19
+ update(mode?: string): void;
20
+ destroy(): void;
21
+ getElementsAtEventForMode(event: Event, mode: string, options: object, useFinalPosition: boolean): unknown[];
22
+ }
23
+ /**
24
+ * Loads chart.js. The default is a dynamic `import('chart.js/auto')`, so chart.js is only fetched by apps that show
25
+ * a chart; provide another function to register a smaller set of chart.js parts or to replace it in tests.
26
+ */
27
+ export declare const HX_CHART_LOADER: InjectionToken<() => Promise<HxChartModule>>;
28
+ type Json = Record<string, unknown>;
29
+ /** The parts of chart.js data and datasets that are read here; everything else is passed on untouched. */
30
+ interface ChartDataLike extends Json {
31
+ datasets?: unknown;
32
+ }
33
+ /**
34
+ * A chart.js chart whose colours, grid and font come from the Helix tokens.
35
+ *
36
+ * ```html
37
+ * <hx-chart type="bar" [data]="data" [options]="options" height="20rem" ariaLabel="Sales per month">
38
+ * <table hxChartFallback>…the same numbers as text…</table>
39
+ * </hx-chart>
40
+ * ```
41
+ *
42
+ * chart.js is an optional peer dependency, loaded with a dynamic import (see `HX_CHART_LOADER`) the first time a
43
+ * chart is shown. Datasets without colours get the Helix palette; text, grid and legend colours come from
44
+ * `--h-text-muted-color` and `--h-content-border-color` of the element. Your `options` win over these defaults.
45
+ * The chart is redrawn when `class` or `style` of `<html>` change (dark mode, the primary colour).
46
+ *
47
+ * The canvas is an `img` named by `ariaLabel` / `ariaLabelledBy`; content marked `hxChartFallback` becomes the
48
+ * canvas fallback content, which assistive technology reads: put the numbers there as text or as a table.
49
+ */
50
+ export declare class HxChart {
51
+ #private;
52
+ private readonly canvas;
53
+ readonly type: import("@angular/core").InputSignal<HxChartType>;
54
+ /** chart.js data: `{ labels, datasets }`. Pass a new object to update the chart. */
55
+ readonly data: import("@angular/core").InputSignal<ChartDataLike>;
56
+ /** chart.js options, on top of the token defaults. Pass a new object to update the chart. */
57
+ readonly options: import("@angular/core").InputSignal<Json>;
58
+ /** Extra chart.js plugins for this chart. */
59
+ readonly plugins: import("@angular/core").InputSignal<readonly unknown[]>;
60
+ /** CSS width of the frame, e.g. `30rem`; the chart fills its container by default. */
61
+ readonly width: import("@angular/core").InputSignal<string | undefined>;
62
+ /** CSS height of the frame; without it chart.js keeps its aspect ratio. */
63
+ readonly height: import("@angular/core").InputSignal<string | undefined>;
64
+ /** Resize with the container. */
65
+ readonly responsive: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
66
+ readonly ariaLabel: import("@angular/core").InputSignal<string | undefined>;
67
+ readonly ariaLabelledBy: import("@angular/core").InputSignal<string | undefined>;
68
+ /** Delay of a redraw after the theme changed, in ms; the style change is usually followed by more. */
69
+ readonly themeDelay: import("@angular/core").InputSignalWithTransform<number, unknown>;
70
+ /** A data point or dataset was clicked. */
71
+ readonly dataSelect: import("@angular/core").OutputEmitterRef<HxChartSelectEvent>;
72
+ constructor();
73
+ /** The chart.js instance, once it exists; `undefined` before chart.js has loaded. */
74
+ get chart(): HxChartInstance | undefined;
75
+ /** Redraws the chart, e.g. after the theme changed in a way the component cannot see. */
76
+ refresh(): void;
77
+ protected onClick(event: MouseEvent): void;
78
+ static ɵfac: i0.ɵɵFactoryDeclaration<HxChart, never>;
79
+ static ɵcmp: i0.ɵɵComponentDeclaration<HxChart, "hx-chart", never, {
80
+ "type": {
81
+ "alias": "type";
82
+ "required": false;
83
+ "isSignal": true;
84
+ };
85
+ "data": {
86
+ "alias": "data";
87
+ "required": false;
88
+ "isSignal": true;
89
+ };
90
+ "options": {
91
+ "alias": "options";
92
+ "required": false;
93
+ "isSignal": true;
94
+ };
95
+ "plugins": {
96
+ "alias": "plugins";
97
+ "required": false;
98
+ "isSignal": true;
99
+ };
100
+ "width": {
101
+ "alias": "width";
102
+ "required": false;
103
+ "isSignal": true;
104
+ };
105
+ "height": {
106
+ "alias": "height";
107
+ "required": false;
108
+ "isSignal": true;
109
+ };
110
+ "responsive": {
111
+ "alias": "responsive";
112
+ "required": false;
113
+ "isSignal": true;
114
+ };
115
+ "ariaLabel": {
116
+ "alias": "ariaLabel";
117
+ "required": false;
118
+ "isSignal": true;
119
+ };
120
+ "ariaLabelledBy": {
121
+ "alias": "ariaLabelledBy";
122
+ "required": false;
123
+ "isSignal": true;
124
+ };
125
+ "themeDelay": {
126
+ "alias": "themeDelay";
127
+ "required": false;
128
+ "isSignal": true;
129
+ };
130
+ }, {
131
+ "dataSelect": "dataSelect";
132
+ }, never, ["[hxChartFallback]"], true, never>;
133
+ }
134
+ export type { HxChartInstance, HxChartModule, HxChartSelectEvent, HxChartType };