@lifecorner/angular-ui-kit 3.15.0 → 3.16.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 (28) hide show
  1. package/README.md +2 -1
  2. package/fesm2022/lifecorner-angular-ui-kit-icon.mjs +2 -2
  3. package/fesm2022/lifecorner-angular-ui-kit-icon.mjs.map +1 -1
  4. package/fesm2022/lifecorner-angular-ui-kit-icons.mjs +26 -2
  5. package/fesm2022/lifecorner-angular-ui-kit-icons.mjs.map +1 -1
  6. package/fesm2022/lifecorner-angular-ui-kit-internal-icon-set.mjs +10 -1
  7. package/fesm2022/lifecorner-angular-ui-kit-internal-icon-set.mjs.map +1 -1
  8. package/fesm2022/lifecorner-angular-ui-kit-list.mjs +29 -6
  9. package/fesm2022/lifecorner-angular-ui-kit-list.mjs.map +1 -1
  10. package/fesm2022/lifecorner-angular-ui-kit-money.mjs +250 -0
  11. package/fesm2022/lifecorner-angular-ui-kit-money.mjs.map +1 -0
  12. package/fesm2022/lifecorner-angular-ui-kit-next-step-card.mjs +21 -2
  13. package/fesm2022/lifecorner-angular-ui-kit-next-step-card.mjs.map +1 -1
  14. package/fesm2022/lifecorner-angular-ui-kit-switch.mjs +21 -4
  15. package/fesm2022/lifecorner-angular-ui-kit-switch.mjs.map +1 -1
  16. package/fesm2022/lifecorner-angular-ui-kit-table.mjs +71 -7
  17. package/fesm2022/lifecorner-angular-ui-kit-table.mjs.map +1 -1
  18. package/fesm2022/lifecorner-angular-ui-kit.mjs +1 -0
  19. package/package.json +5 -1
  20. package/src/styles/theme-contrast.spec.ts +22 -0
  21. package/types/lifecorner-angular-ui-kit-icon.d.ts +2 -1
  22. package/types/lifecorner-angular-ui-kit-icons.d.ts +5 -1
  23. package/types/lifecorner-angular-ui-kit-list.d.ts +38 -0
  24. package/types/lifecorner-angular-ui-kit-money.d.ts +150 -0
  25. package/types/lifecorner-angular-ui-kit-next-step-card.d.ts +26 -0
  26. package/types/lifecorner-angular-ui-kit-switch.d.ts +19 -0
  27. package/types/lifecorner-angular-ui-kit-table.d.ts +42 -1
  28. package/types/lifecorner-angular-ui-kit.d.ts +1 -0
@@ -0,0 +1,150 @@
1
+ import * as i0 from "@angular/core";
2
+ /**
3
+ * How the sign of an amount shows, as `Intl.NumberFormat`'s `signDisplay`:
4
+ * - `auto`: negative amounts only (−42,17 €)
5
+ * - `always`: plus and minus, also on zero (+0,00 €)
6
+ * - `exceptZero`: plus and minus, no sign on zero
7
+ * - `never`: no sign
8
+ */
9
+ type MoneySignDisplay = 'auto' | 'always' | 'exceptZero' | 'never';
10
+ /** Options of {@link formatMoney}. */
11
+ interface MoneyFormatOptions {
12
+ /** BCP 47 locale. An invalid one falls back to `en-US`. @default 'en-US' */
13
+ locale?: string;
14
+ /** As `Intl.NumberFormat`'s `signDisplay`. @default 'auto' */
15
+ signDisplay?: MoneySignDisplay;
16
+ /** Spoken word for the minus sign. @default 'minus' */
17
+ minusLabel?: string;
18
+ /** Spoken word for the plus sign. @default 'plus' */
19
+ plusLabel?: string;
20
+ }
21
+ /** A formatted amount: the visible text and the words a screen reader speaks. */
22
+ interface MoneyText {
23
+ /** Visible text, e.g. „−42,17 €“ (U+2212 minus, U+00A0 from `Intl`). */
24
+ text: string;
25
+ /** Spoken text, e.g. „minus 42,17 Euro“. */
26
+ spoken: string;
27
+ }
28
+ /** The ISO 4217 minor-unit exponent of `currency` (2 unless listed). */
29
+ declare function moneyMinorUnits(currency: string): number;
30
+ /** Text direction of an amount formatted for `locale`. */
31
+ declare function moneyDirection(locale: string): 'ltr' | 'rtl';
32
+ /**
33
+ * Formats an amount of money given in integer minor units (cents, yen, fils)
34
+ * exactly, never through a float: the decimal string goes into `Intl`.
35
+ * Returns `null` for an amount that is not a safe integer or a currency that
36
+ * is not a three-letter code. This is the formatter of `lc-money`, for table
37
+ * `formatter`s and texts.
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * formatMoney(-4217, 'EUR', { locale: 'de-DE' });
42
+ * // { text: '−42,17 €', spoken: 'minus 42,17 Euro' }
43
+ * ```
44
+ */
45
+ export declare function formatMoney(amountMinor: number, currency: string, options?: MoneyFormatOptions): MoneyText | null;
46
+ /**
47
+ * Displays an amount of money (3.16, BA-4): locale, currency, sign, tabular
48
+ * figures and a spoken text. Display only, no input parsing or conversion.
49
+ *
50
+ * - `amountMinor` is an integer in the currency's minor units (cents, yen,
51
+ * fils), formatted exactly through a decimal string, never a float. Minor
52
+ * units follow ISO 4217: 2, except 0 (BIF CLP DJF GNF ISK JPY KMF KRW PYG
53
+ * RWF UGX UYI VND VUV XAF XOF XPF), 3 (BHD IQD JOD KWD LYD OMR TND) and 4
54
+ * (CLF UYW).
55
+ * - The visible amount („−42,17 €“, U+2212 minus, a no-break space from
56
+ * `Intl`) is `aria-hidden`; a visually hidden span holds the words
57
+ * („minus 42,17 Euro“), so a screen reader reads the amount once.
58
+ * - Tabular figures, no wrapping inside the amount; the amount is a `dir`
59
+ * isolate (`ltr`, or `rtl` for an RTL locale), safe inside RTL text.
60
+ * - Font and colour come from the context; colour never carries the sign.
61
+ * - `locale` empty: the app's `LOCALE_ID` (Angular's default `en-US`), the
62
+ * same on the server and in the browser.
63
+ * - For table `formatter`s and texts use {@link formatMoney}.
64
+ *
65
+ * Separate a `lc-money` from adjacent text with a space in your template, so
66
+ * the spoken text does not run into the words around it.
67
+ *
68
+ * @example
69
+ * ```html
70
+ * <lc-money [amountMinor]="-4217" currency="EUR" locale="de-DE" />
71
+ * ```
72
+ */
73
+ export declare class MoneyComponent {
74
+ private readonly appLocale;
75
+ /**
76
+ * Amount in minor units of `currency` (cents, yen, fils): a safe integer
77
+ * (±9,007,199,254,740,991), formatted exactly. Anything else renders
78
+ * nothing (a dev warning).
79
+ */
80
+ readonly amountMinor: import("@angular/core").InputSignal<number>;
81
+ /**
82
+ * ISO 4217 currency code (`EUR`, `USD`, `JPY`, `KWD`). It sets the minor
83
+ * units and the symbol. Not a three-letter code: renders nothing (a dev
84
+ * warning).
85
+ */
86
+ readonly currency: import("@angular/core").InputSignal<string>;
87
+ /**
88
+ * BCP 47 locale of the amount (`de-DE`, `en-GB`). Empty: the app's
89
+ * `LOCALE_ID` (Angular's default `en-US`). An invalid locale falls back to
90
+ * `en-US`.
91
+ * @default ''
92
+ */
93
+ readonly locale: import("@angular/core").InputSignal<string>;
94
+ /**
95
+ * Which signs show, as `Intl.NumberFormat`: `auto` (negative only),
96
+ * `always`, `exceptZero`, `never`. The spoken text says the sign whenever
97
+ * it shows.
98
+ * @default 'auto'
99
+ */
100
+ readonly signDisplay: import("@angular/core").InputSignal<MoneySignDisplay>;
101
+ /**
102
+ * Spoken word for the minus sign („minus 42,17 Euro“; the same in German).
103
+ * @default 'minus'
104
+ */
105
+ readonly minusLabel: import("@angular/core").InputSignal<string>;
106
+ /**
107
+ * Spoken word for the plus sign („plus 42,17 Euro“; the same in German).
108
+ * @default 'plus'
109
+ */
110
+ readonly plusLabel: import("@angular/core").InputSignal<string>;
111
+ /** The locale in use: the `locale` input or the app's `LOCALE_ID`. */
112
+ protected readonly effectiveLocale: import("@angular/core").Signal<string>;
113
+ protected readonly formatted: import("@angular/core").Signal<import("@lifecorner/angular-ui-kit/money").MoneyText | null>;
114
+ protected readonly dir: import("@angular/core").Signal<"ltr" | "rtl">;
115
+ constructor();
116
+ static ɵfac: i0.ɵɵFactoryDeclaration<MoneyComponent, never>;
117
+ static ɵcmp: i0.ɵɵComponentDeclaration<MoneyComponent, "lc-money", never, {
118
+ "amountMinor": {
119
+ "alias": "amountMinor";
120
+ "required": true;
121
+ "isSignal": true;
122
+ };
123
+ "currency": {
124
+ "alias": "currency";
125
+ "required": true;
126
+ "isSignal": true;
127
+ };
128
+ "locale": {
129
+ "alias": "locale";
130
+ "required": false;
131
+ "isSignal": true;
132
+ };
133
+ "signDisplay": {
134
+ "alias": "signDisplay";
135
+ "required": false;
136
+ "isSignal": true;
137
+ };
138
+ "minusLabel": {
139
+ "alias": "minusLabel";
140
+ "required": false;
141
+ "isSignal": true;
142
+ };
143
+ "plusLabel": {
144
+ "alias": "plusLabel";
145
+ "required": false;
146
+ "isSignal": true;
147
+ };
148
+ }, {}, never, never, true, never>;
149
+ }
150
+ export type { MoneyFormatOptions, MoneySignDisplay, MoneyText };
@@ -15,6 +15,15 @@ export type NextStepCardVariant = 'default' | 'soft';
15
15
  * - `stacked`: always in their own row, one per line at equal width, 8 px apart
16
16
  */
17
17
  export type NextStepCardActionsLayout = 'inline' | 'stacked';
18
+ /**
19
+ * Weight of the two built-in actions.
20
+ * - `default`: a filled primary and a ghost secondary with a chevron, the
21
+ * primary last
22
+ * - `equal`: two answers of the same weight (a question such as „Teilen?“):
23
+ * both `outline` in the primary tone at `actionSize`, the primary first,
24
+ * no chevron
25
+ */
26
+ export type NextStepCardActionsStyle = 'default' | 'equal';
18
27
  /** Element that renders the title (semantics only, the look stays the same). */
19
28
  export type NextStepCardTitleTag = 'div' | 'h2' | 'h3';
20
29
  /** Size of the built-in action buttons (`sm` 32 px, `md` 42 px, `lg` 48.5 px). */
@@ -44,6 +53,8 @@ export type NextStepCardActionSize = 'sm' | 'md' | 'lg';
44
53
  * `fullWidth` button gets its own row at every width.
45
54
  * - `variant="soft"`: the tinted card of the "Weite" look; `actionsLayout`
46
55
  * `stacked` for several equal-width actions; `titleTag` for a heading
56
+ * - `actionsStyle="equal"` (3.16, BA-5): a question with two answers of the
57
+ * same weight, both outline buttons in the primary tone, primary first
47
58
  *
48
59
  * The host is a size container (`container-type: inline-size`) and takes the
49
60
  * full inline size of its parent.
@@ -106,6 +117,16 @@ export declare class NextStepCardComponent implements AfterViewChecked {
106
117
  * @default 'sm'
107
118
  */
108
119
  actionSize: import("@angular/core").InputSignal<NextStepCardActionSize>;
120
+ /**
121
+ * Weight of the built-in actions. `default`: filled primary, ghost secondary
122
+ * with a chevron, primary last. `equal`: two answers of the same weight, both
123
+ * `outline` in the primary tone at `actionSize`, primary first, no chevron
124
+ * (`primaryClick`, `secondaryClick`, `primaryLoading`, `primaryDisabled` and
125
+ * `announce` work as before). Use `actionSize="lg"` (48.5 px, the 44 px
126
+ * target; a dev warning otherwise). No effect on `[slot='actions']`.
127
+ * @default 'default'
128
+ */
129
+ actionsStyle: import("@angular/core").InputSignal<NextStepCardActionsStyle>;
109
130
  /** Message below the title. For markup, use the default slot instead. */
110
131
  message: import("@angular/core").InputSignal<string | undefined>;
111
132
  /** Label of the primary action. Omit to render no primary button. */
@@ -200,6 +221,11 @@ export declare class NextStepCardComponent implements AfterViewChecked {
200
221
  "required": false;
201
222
  "isSignal": true;
202
223
  };
224
+ "actionsStyle": {
225
+ "alias": "actionsStyle";
226
+ "required": false;
227
+ "isSignal": true;
228
+ };
203
229
  "message": {
204
230
  "alias": "message";
205
231
  "required": false;
@@ -8,6 +8,10 @@ import * as i0 from "@angular/core";
8
8
  * - Size options (sm, md, lg)
9
9
  * - Loading state with spinner
10
10
  * - Configurable label positioning (left/right)
11
+ * - Help text below the label, linked by `aria-describedby` (`helpText`, 3.16)
12
+ * - Rows with a label or help text are at least 44 px high
13
+ * (`--lc-switch-min-height`, default `var(--size-min-touch-height)`; `0`
14
+ * restores the 3.15 rows of 21/24/28 px)
11
15
  * - Keyboard toggle support
12
16
  * - Disabled and required states
13
17
  * - ControlValueAccessor integration for reactive forms
@@ -54,12 +58,22 @@ export declare class SwitchComponent implements ControlValueAccessor {
54
58
  * ARIA label for accessibility (overrides the visible label as accessible name)
55
59
  */
56
60
  readonly ariaLabel: import("@angular/core").InputSignal<string | undefined>;
61
+ /**
62
+ * Description below the label, linked to the switch by `aria-describedby`
63
+ * (read after the name and state). Wraps; 14 px secondary text. A tap on it
64
+ * toggles the switch like the label. Empty renders no element and no
65
+ * `aria-describedby` (3.15).
66
+ * @default ''
67
+ */
68
+ readonly helpText: import("@angular/core").InputSignal<string>;
57
69
  /**
58
70
  * Emitted when checked state changes
59
71
  */
60
72
  readonly checkedChange: import("@angular/core").OutputEmitterRef<boolean>;
61
73
  /** Per-instance id so the visible `<label for>` points at this switch. */
62
74
  readonly switchId: string;
75
+ /** id of the rendered help text (only while `helpText` is set). */
76
+ readonly helpTextId: import("@angular/core").Signal<string | null>;
63
77
  /**
64
78
  * Effective checked state: follows the `checked` input, overridden by
65
79
  * form writes (`writeValue`) and user toggles.
@@ -135,6 +149,11 @@ export declare class SwitchComponent implements ControlValueAccessor {
135
149
  "required": false;
136
150
  "isSignal": true;
137
151
  };
152
+ "helpText": {
153
+ "alias": "helpText";
154
+ "required": false;
155
+ "isSignal": true;
156
+ };
138
157
  }, {
139
158
  "checkedChange": "checkedChange";
140
159
  }, never, never, true, never>;
@@ -162,6 +162,9 @@ interface DisplayRow {
162
162
  * - Composed cells (e.g. avatar + badge + actions)
163
163
  * - Hierarchical "tree" rows (grouped / expandable) via `idKey` + `parentKey`
164
164
  * - Responsive horizontal scrolling
165
+ * - `clickable` rows: tab stops, Enter/Space emit `rowClick` (3.16)
166
+ * - `caption` as the table's `<caption>`, visible or for screen readers only
167
+ * (`showCaption`, 3.16)
165
168
  * - Empty state text for no data
166
169
  * - Accessible with proper table semantics
167
170
  *
@@ -198,6 +201,29 @@ export declare class TableComponent {
198
201
  size: import("@angular/core").InputSignal<TableSize>;
199
202
  /** Whether rows should highlight on hover */
200
203
  hoverable: import("@angular/core").InputSignal<boolean>;
204
+ /**
205
+ * Rows are interactive (3.16, BA-3): each data row is a tab stop, Enter and
206
+ * Space emit `rowClick` (Space does not scroll the page), pointer and hover
207
+ * as `hoverable`. Clicks and keys on controls inside a row (buttons, links,
208
+ * inputs, switches) stay theirs and emit no `rowClick`. Set it whenever you
209
+ * handle `rowClick`. Tree mode keeps its roving tab stop. A focused row is
210
+ * read by its cells, not as "clickable": let the row open something that
211
+ * announces itself (a dialog, a page).
212
+ * @default false
213
+ */
214
+ clickable: import("@angular/core").InputSignal<boolean>;
215
+ /**
216
+ * Title of the table, rendered as its `<caption>` (3.16, BA-3), so it also
217
+ * names the table for screen readers. Empty renders no caption.
218
+ * @default ''
219
+ */
220
+ caption: import("@angular/core").InputSignal<string>;
221
+ /**
222
+ * Show the caption above the table (16 px semibold, 12 px above the table);
223
+ * `false` keeps it for screen readers only.
224
+ * @default true
225
+ */
226
+ showCaption: import("@angular/core").InputSignal<boolean>;
201
227
  /** Whether table should be responsive (horizontal scroll on mobile) */
202
228
  responsive: import("@angular/core").InputSignal<boolean>;
203
229
  /** Text shown when data is empty */
@@ -398,7 +424,7 @@ export declare class TableComponent {
398
424
  protected treeCellLabel(row: Record<string, unknown>): string;
399
425
  getCellTemplate(columnKey: string): TableCellDirective | undefined;
400
426
  hasCustomTemplate(columnKey: string): boolean;
401
- onRowClick(row: Record<string, unknown>): void;
427
+ onRowClick(row: Record<string, unknown>, event?: Event): void;
402
428
  /** Whether the trailing actions column should be rendered */
403
429
  protected readonly hasActions: import("@angular/core").Signal<boolean>;
404
430
  protected isActionHidden(action: TableAction, row: Record<string, unknown>, rowIndex: number): boolean;
@@ -469,6 +495,21 @@ export declare class TableComponent {
469
495
  "required": false;
470
496
  "isSignal": true;
471
497
  };
498
+ "clickable": {
499
+ "alias": "clickable";
500
+ "required": false;
501
+ "isSignal": true;
502
+ };
503
+ "caption": {
504
+ "alias": "caption";
505
+ "required": false;
506
+ "isSignal": true;
507
+ };
508
+ "showCaption": {
509
+ "alias": "showCaption";
510
+ "required": false;
511
+ "isSignal": true;
512
+ };
472
513
  "responsive": {
473
514
  "alias": "responsive";
474
515
  "required": false;
@@ -58,6 +58,7 @@ export * from "@lifecorner/angular-ui-kit/toggle-group";
58
58
  export * from "@lifecorner/angular-ui-kit/list";
59
59
  export * from "@lifecorner/angular-ui-kit/chip";
60
60
  export * from "@lifecorner/angular-ui-kit/table";
61
+ export * from "@lifecorner/angular-ui-kit/money";
61
62
  export * from "@lifecorner/angular-ui-kit/field-group";
62
63
  export * from "@lifecorner/angular-ui-kit/stepper";
63
64
  export * from "@lifecorner/angular-ui-kit/filter-bar";