@lifecorner/angular-ui-kit 3.35.0 → 3.37.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.
Files changed (43) hide show
  1. package/README.md +1 -0
  2. package/fesm2022/lifecorner-angular-ui-kit-button.mjs +6 -6
  3. package/fesm2022/lifecorner-angular-ui-kit-button.mjs.map +1 -1
  4. package/fesm2022/lifecorner-angular-ui-kit-card.mjs +82 -16
  5. package/fesm2022/lifecorner-angular-ui-kit-card.mjs.map +1 -1
  6. package/fesm2022/lifecorner-angular-ui-kit-combobox.mjs +18 -2
  7. package/fesm2022/lifecorner-angular-ui-kit-combobox.mjs.map +1 -1
  8. package/fesm2022/lifecorner-angular-ui-kit-description-list.mjs +43 -5
  9. package/fesm2022/lifecorner-angular-ui-kit-description-list.mjs.map +1 -1
  10. package/fesm2022/lifecorner-angular-ui-kit-header.mjs +45 -8
  11. package/fesm2022/lifecorner-angular-ui-kit-header.mjs.map +1 -1
  12. package/fesm2022/lifecorner-angular-ui-kit-hero.mjs +78 -5
  13. package/fesm2022/lifecorner-angular-ui-kit-hero.mjs.map +1 -1
  14. package/fesm2022/lifecorner-angular-ui-kit-internal-chart.mjs +2 -2
  15. package/fesm2022/lifecorner-angular-ui-kit-internal-chart.mjs.map +1 -1
  16. package/fesm2022/lifecorner-angular-ui-kit-list.mjs +30 -6
  17. package/fesm2022/lifecorner-angular-ui-kit-list.mjs.map +1 -1
  18. package/fesm2022/lifecorner-angular-ui-kit-select.mjs +15 -10
  19. package/fesm2022/lifecorner-angular-ui-kit-select.mjs.map +1 -1
  20. package/fesm2022/lifecorner-angular-ui-kit-stacked-bar-chart.mjs +47 -5
  21. package/fesm2022/lifecorner-angular-ui-kit-stacked-bar-chart.mjs.map +1 -1
  22. package/fesm2022/lifecorner-angular-ui-kit-state-strip.mjs +226 -0
  23. package/fesm2022/lifecorner-angular-ui-kit-state-strip.mjs.map +1 -0
  24. package/fesm2022/lifecorner-angular-ui-kit-table.mjs +25 -4
  25. package/fesm2022/lifecorner-angular-ui-kit-table.mjs.map +1 -1
  26. package/fesm2022/lifecorner-angular-ui-kit.mjs +1 -0
  27. package/package.json +5 -1
  28. package/src/styles/_theme-light.scss +8 -1
  29. package/src/styles/theme-contrast.spec.ts +116 -0
  30. package/src/styles/theme-modes.spec.ts +20 -5
  31. package/types/lifecorner-angular-ui-kit-button.d.ts +7 -3
  32. package/types/lifecorner-angular-ui-kit-card.d.ts +51 -3
  33. package/types/lifecorner-angular-ui-kit-combobox.d.ts +15 -0
  34. package/types/lifecorner-angular-ui-kit-description-list.d.ts +40 -0
  35. package/types/lifecorner-angular-ui-kit-header.d.ts +44 -2
  36. package/types/lifecorner-angular-ui-kit-hero.d.ts +50 -1
  37. package/types/lifecorner-angular-ui-kit-internal-chart.d.ts +6 -0
  38. package/types/lifecorner-angular-ui-kit-list.d.ts +27 -0
  39. package/types/lifecorner-angular-ui-kit-select.d.ts +13 -1
  40. package/types/lifecorner-angular-ui-kit-stacked-bar-chart.d.ts +36 -0
  41. package/types/lifecorner-angular-ui-kit-state-strip.d.ts +125 -0
  42. package/types/lifecorner-angular-ui-kit-table.d.ts +46 -1
  43. package/types/lifecorner-angular-ui-kit.d.ts +1 -0
@@ -10,6 +10,11 @@ export interface StackedBarLegend {
10
10
  color?: string;
11
11
  }
12
12
  export type StackedBarOrientation = 'vertical' | 'horizontal';
13
+ /**
14
+ * Form of `lc-stacked-bar-chart` (3.36): `chart` (axes, grid, labels and
15
+ * paddings, as before) or `band` (one horizontal bar edge to edge).
16
+ */
17
+ export type StackedBarVariant = 'chart' | 'band';
13
18
  export declare class StackedBarChartComponent {
14
19
  private readonly _el;
15
20
  private readonly _destroyRef;
@@ -42,6 +47,32 @@ export declare class StackedBarChartComponent {
42
47
  * series names and every category's total.
43
48
  */
44
49
  ariaLabel: import("@angular/core").InputSignal<string>;
50
+ /**
51
+ * Form of the chart (3.36, cockpit row 2). `chart`: axes, grid, labels and
52
+ * paddings, as before. `band`: one horizontal bar that fills the host's
53
+ * width edge to edge, `height` px thick, scaled from 0 to the sum of the
54
+ * values, without axes, grid, labels, values or paddings; the parts are
55
+ * split by a 2 px gap in the surface colour (CSS hooks
56
+ * `--lc-stacked-bar-chart-band-gap`, default `2px`, and
57
+ * `--lc-stacked-bar-chart-band-gap-color`, default `var(--color-surface)`:
58
+ * set it to the band's background off a card). `ariaLabel`, `legends` and
59
+ * the legend work as in `chart`. Needs exactly one category (otherwise it
60
+ * renders as `chart`, with a warning in dev mode); `orientation` is
61
+ * ignored; negative values draw nothing, and a sum of 0 draws no parts.
62
+ * Part widths are percentages, so the band is exact in prerendered HTML.
63
+ * @default 'chart'
64
+ */
65
+ variant: import("@angular/core").InputSignal<StackedBarVariant>;
66
+ /** `band` with exactly one category (3.36); otherwise the chart renders. */
67
+ protected readonly isBand: import("@angular/core").Signal<boolean>;
68
+ /** The band's parts as percentages of the width: 0 … sum of the positive values. */
69
+ protected readonly bandParts: import("@angular/core").Signal<{
70
+ x: number;
71
+ w: number;
72
+ color: string;
73
+ }[]>;
74
+ /** The boundaries between two drawn parts, where the band's gap lines sit. */
75
+ protected readonly bandGaps: import("@angular/core").Signal<number[]>;
45
76
  private readonly PL;
46
77
  private readonly PR;
47
78
  private readonly PT;
@@ -167,5 +198,10 @@ export declare class StackedBarChartComponent {
167
198
  "required": false;
168
199
  "isSignal": true;
169
200
  };
201
+ "variant": {
202
+ "alias": "variant";
203
+ "required": false;
204
+ "isSignal": true;
205
+ };
170
206
  }, {}, never, never, true, never>;
171
207
  }
@@ -0,0 +1,125 @@
1
+ import * as i0 from "@angular/core";
2
+ /** State of one run in `lc-state-strip` (3.36). */
3
+ export type StateStripState = 'success' | 'warning' | 'error' | 'neutral';
4
+ /** One run of `lc-state-strip`: its state, and a `label` that names it („Mo 06.10., 06:00“). */
5
+ export interface StateStripSegment {
6
+ state: StateStripState;
7
+ label: string;
8
+ }
9
+ /** The words of the four states, for the counts and the segment names. */
10
+ export type StateStripLabels = Record<StateStripState, string>;
11
+ /** English state words of `lc-state-strip`; pass `stateLabels` for another language. */
12
+ export declare const DEFAULT_STATE_STRIP_LABELS: Readonly<StateStripLabels>;
13
+ /**
14
+ * The states of the last runs at a glance (3.36, quellen row 1): one segment
15
+ * per run, oldest first. The state is a shape, not only a colour: success a
16
+ * block in the upper half, error one in the lower half, warning a centred
17
+ * block, neutral a flat dash, so the strip reads without hue and in forced
18
+ * colours.
19
+ *
20
+ * Accessibility: an APG single-row grid. The strip is named by `ariaLabel`
21
+ * and the count per state („Letzte 10 Ladeläufe, 9 geladen, 1
22
+ * fehlgeschlagen“); each segment is a grid cell named by its `label` and
23
+ * state word. One Tab stop (the newest run first), Arrow Left/Right, Home and
24
+ * End move between the runs, Escape hides the caption. Hovering or focusing a
25
+ * segment shows its name below the strip (hidden from screen readers, which
26
+ * read the cell). 3.37: the pointer uses the whole strip (one layer over the
27
+ * row picks the run under it), so dense strips need no 24 px cells.
28
+ *
29
+ * Without segments it renders nothing. The segments are in the prerendered
30
+ * HTML. CSS hooks: `--lc-state-strip-height` (default `2rem`) and
31
+ * `--lc-state-strip-segment-max-width` (default `1.5rem`; more segments than
32
+ * fit share the width, never overflowing).
33
+ *
34
+ * @example
35
+ * ```html
36
+ * <lc-state-strip
37
+ * ariaLabel="Letzte 10 Ladeläufe"
38
+ * [stateLabels]="{ success: 'geladen', warning: 'teilweise geladen', error: 'fehlgeschlagen', neutral: 'ausstehend' }"
39
+ * [segments]="runs"
40
+ * />
41
+ * ```
42
+ */
43
+ export declare class StateStripComponent {
44
+ /**
45
+ * The runs, in order, oldest first: one segment each. Empty renders nothing
46
+ * (no box, no accessibility node).
47
+ *
48
+ * More runs than fit at 24 px (13 and more in 328 px) narrow the cells below
49
+ * 24 px; the pointer then uses the whole strip: pointing at it, or sliding a
50
+ * pressed finger along it, shows that run; the keyboard moves with the
51
+ * arrows (3.37).
52
+ * @default []
53
+ */
54
+ readonly segments: import("@angular/core").InputSignal<readonly StateStripSegment[]>;
55
+ /**
56
+ * Start of the strip's accessible name; the count per state follows it
57
+ * („Letzte 10 Ladeläufe, 9 geladen, 1 fehlgeschlagen“).
58
+ * @default ''
59
+ */
60
+ readonly ariaLabel: import("@angular/core").InputSignal<string>;
61
+ /**
62
+ * The state words for the counts and the segment names, over the English
63
+ * defaults (`DEFAULT_STATE_STRIP_LABELS`: succeeded, with warnings, failed,
64
+ * pending). German: `{ success: 'geladen', warning: 'teilweise geladen',
65
+ * error: 'fehlgeschlagen', neutral: 'ausstehend' }`.
66
+ * @default {}
67
+ */
68
+ readonly stateLabels: import("@angular/core").InputSignal<Partial<StateStripLabels>>;
69
+ private readonly cellEls;
70
+ /** The state words in use. */
71
+ private readonly words;
72
+ /** One entry per segment: its state (unknown states draw as neutral) and its name. */
73
+ protected readonly cells: import("@angular/core").Signal<{
74
+ state: StateStripState;
75
+ name: string;
76
+ }[]>;
77
+ /** The strip's name: `ariaLabel`, then the count per state (0 left out). */
78
+ protected readonly gridLabel: import("@angular/core").Signal<string>;
79
+ /** The roving Tab stop: the newest run until the user moves. */
80
+ protected readonly current: import("@angular/core").WritableSignal<number>;
81
+ /** The segment under the pointer, the one with focus, and whether Escape hid the caption. */
82
+ protected readonly hovered: import("@angular/core").WritableSignal<number | null>;
83
+ private readonly focused;
84
+ private readonly dismissed;
85
+ /** The segment whose name the caption shows, if any. */
86
+ private readonly captionIndex;
87
+ /** The caption's text: the name of the hovered or focused segment ('' hides it). */
88
+ protected readonly caption: import("@angular/core").Signal<string>;
89
+ protected onFocus(index: number): void;
90
+ protected onBlur(): void;
91
+ protected onPointerEnter(index: number): void;
92
+ protected onPointerLeave(): void;
93
+ /** The run the scrub layer last picked; a move within it changes nothing (as entering a cell). */
94
+ private scrubbed;
95
+ /**
96
+ * The pointer over the strip (3.37, request 057, 056 S-1): the run whose
97
+ * cell spans the pointer's x shows in the caption; outside every cell none.
98
+ */
99
+ protected onScrubMove(event: PointerEvent): void;
100
+ /** Releasing the pointer (a click, a lifted finger) focuses the run under it. */
101
+ protected onScrubUp(event: PointerEvent): void;
102
+ protected onScrubLeave(): void;
103
+ /** The index of the cell whose box spans `x`, any writing direction. */
104
+ private cellAt;
105
+ /** Arrow Left/Right, Home, End move between the runs (no wrap); Escape hides the caption. */
106
+ protected onKeydown(event: KeyboardEvent): void;
107
+ static ɵfac: i0.ɵɵFactoryDeclaration<StateStripComponent, never>;
108
+ static ɵcmp: i0.ɵɵComponentDeclaration<StateStripComponent, "lc-state-strip", never, {
109
+ "segments": {
110
+ "alias": "segments";
111
+ "required": false;
112
+ "isSignal": true;
113
+ };
114
+ "ariaLabel": {
115
+ "alias": "ariaLabel";
116
+ "required": false;
117
+ "isSignal": true;
118
+ };
119
+ "stateLabels": {
120
+ "alias": "stateLabels";
121
+ "required": false;
122
+ "isSignal": true;
123
+ };
124
+ }, {}, never, never, true, never>;
125
+ }
@@ -1,6 +1,6 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import { QueryList, TemplateRef } from "@angular/core";
3
- import { ButtonVariant } from "@lifecorner/angular-ui-kit/button";
3
+ import { ButtonSize, ButtonVariant } from "@lifecorner/angular-ui-kit/button";
4
4
  /**
5
5
  * Directive for defining custom cell templates in the Table component.
6
6
  *
@@ -12,6 +12,9 @@ import { ButtonVariant } from "@lifecorner/angular-ui-kit/button";
12
12
  * </ng-template>
13
13
  * </lc-table>
14
14
  * ```
15
+ *
16
+ * In the `footerRow` (3.36) the same template renders with `footer: true` in
17
+ * its context (`let-footer="footer"`), e.g. to leave out a badge in the sum.
15
18
  */
16
19
  export declare class TableCellDirective {
17
20
  /** The column key this template applies to */
@@ -81,8 +84,25 @@ export interface TableAction {
81
84
  icon?: string;
82
85
  /** Button variant (default: 'ghost') */
83
86
  variant?: ButtonVariant;
87
+ /**
88
+ * Size of the action's `lc-button` (3.37, services row 3). `'lg'` is
89
+ * 48.5 px high with a label and 45.6 px icon-only, for touch rows; the icon
90
+ * stays 20 px. Pass another size per breakpoint yourself.
91
+ *
92
+ * @default 'xs'
93
+ */
94
+ size?: ButtonSize;
84
95
  /** Optional tooltip / aria-label, useful for icon-only actions */
85
96
  tooltip?: string;
97
+ /**
98
+ * Accessible name of the action's button (3.36, services row 2): a string,
99
+ * or a function of the row, so each row's button names its object
100
+ * (`(row) => 'Herkunft von ' + row.name` → „Herkunft von Demo Netz“) while
101
+ * the visible label, icon and look stay the same. Wins over `tooltip`,
102
+ * `label` and `key`; an empty result falls back to them. Keep the visible
103
+ * label in it (WCAG 2.5.3).
104
+ */
105
+ ariaLabel?: string | ((row: Record<string, unknown>, rowIndex: number) => string);
86
106
  /** Hide this action for specific rows */
87
107
  hidden?: (row: Record<string, unknown>, rowIndex: number) => boolean;
88
108
  /** Disable this action for specific rows */
@@ -184,6 +204,8 @@ interface DisplayRow {
184
204
  * - `caption` as the table's `<caption>`, visible or for screen readers only
185
205
  * (`showCaption`, 3.16)
186
206
  * - Empty state text for no data
207
+ * - `footerRow` (3.36): a sum row in `<tfoot>`, outside sorting, filtering,
208
+ * paging and the tree; `TableAction.ariaLabel` names each row's action
187
209
  * - Accessible with proper table semantics
188
210
  *
189
211
  * @example
@@ -297,6 +319,19 @@ export declare class TableComponent {
297
319
  actionsWidth: import("@angular/core").InputSignal<string | undefined>;
298
320
  /** Horizontal alignment of the action buttons (and header label) within the cell */
299
321
  actionsAlign: import("@angular/core").InputSignal<TableActionsAlign>;
322
+ /**
323
+ * One footer row below all data rows (3.36, services row 1), e.g. a sum:
324
+ * a record of the data's shape, rendered as a `<tfoot>` row with the
325
+ * table's columns, `lcTableCell` templates (their context has
326
+ * `footer: true`), `cellClass`, `cellStyle` and `formatter` (`rowIndex`
327
+ * −1). It is never sorted, filtered, searched, paged, selected or counted,
328
+ * stays last in every tree state, and its first cell is the row header
329
+ * (`<th scope="row">`). A 1 px rule above and a 3 px double rule below
330
+ * (`--color-field-border`) separate it; its cells are semibold with tabular
331
+ * figures. The table scrolls on small screens, and the footer with it.
332
+ * @default undefined
333
+ */
334
+ footerRow: import("@angular/core").InputSignal<Record<string, unknown> | undefined>;
300
335
  /**
301
336
  * Row field holding the unique id. Required (together with {@link parentKey})
302
337
  * to enable hierarchical "tree mode". Absent ⇒ today's flat table.
@@ -458,6 +493,11 @@ export declare class TableComponent {
458
493
  protected readonly hasActions: import("@angular/core").Signal<boolean>;
459
494
  protected isActionHidden(action: TableAction, row: Record<string, unknown>, rowIndex: number): boolean;
460
495
  protected isActionDisabled(action: TableAction, row: Record<string, unknown>, rowIndex: number): boolean;
496
+ /**
497
+ * Accessible name of an action button (3.36): `ariaLabel` (a string or the
498
+ * row's result) over `tooltip`, `label` and `key`; without it, as before.
499
+ */
500
+ protected actionAriaLabel(action: TableAction, row: Record<string, unknown>, rowIndex: number): string;
461
501
  /**
462
502
  * Handles an action button click. The DOM click is stopped from propagating
463
503
  * (see template `$event.stopPropagation()`), so the row's `rowClick` never fires.
@@ -659,6 +699,11 @@ export declare class TableComponent {
659
699
  "required": false;
660
700
  "isSignal": true;
661
701
  };
702
+ "footerRow": {
703
+ "alias": "footerRow";
704
+ "required": false;
705
+ "isSignal": true;
706
+ };
662
707
  "idKey": {
663
708
  "alias": "idKey";
664
709
  "required": false;
@@ -54,6 +54,7 @@ export * from "@lifecorner/angular-ui-kit/app-shell";
54
54
  export * from "@lifecorner/angular-ui-kit/avatar";
55
55
  export * from "@lifecorner/angular-ui-kit/badge";
56
56
  export * from "@lifecorner/angular-ui-kit/status-dot";
57
+ export * from "@lifecorner/angular-ui-kit/state-strip";
57
58
  export * from "@lifecorner/angular-ui-kit/toggle-group";
58
59
  export * from "@lifecorner/angular-ui-kit/list";
59
60
  export * from "@lifecorner/angular-ui-kit/chip";