mn-angular-lib 2.0.18 → 2.0.20

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": "mn-angular-lib",
3
- "version": "2.0.18",
3
+ "version": "2.0.20",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^22.1.7",
6
6
  "@angular/core": "^22.1.7",
@@ -614,6 +614,7 @@ type SortState = {
614
614
  };
615
615
  type TableAppearance = {
616
616
  striped?: boolean;
617
+ /** Hover wash on clickable rows (on by default); rows that do nothing on click never get one. */
617
618
  hover?: boolean;
618
619
  compact?: boolean;
619
620
  bordered?: boolean;
@@ -1010,6 +1011,13 @@ declare class MnTable<T = object> extends MnSelectableCollectionBase<T, TableDat
1010
1011
  */
1011
1012
  private updateFilterLayout;
1012
1013
  sort(column: ColumnDefinition<T>): void;
1014
+ /**
1015
+ * Whether clicking a row does anything: a data-source `onRowClick`, a bound `(rowClick)`,
1016
+ * or row selection. Only then does a row get the hover wash and the pointer, so a plain
1017
+ * list does not look like one that opens something. `appearance.hover: false` still turns
1018
+ * the wash off on a clickable table.
1019
+ */
1020
+ get rowsClickable(): boolean;
1013
1021
  onRowClick(row: T): void;
1014
1022
  /**
1015
1023
  * Resolves the skeleton placeholder config for a column's cells.
@@ -1397,7 +1405,7 @@ type ListSkeleton = {
1397
1405
  type ListAppearance = {
1398
1406
  /** Show a divider between items. Defaults to true. */
1399
1407
  dividers?: boolean;
1400
- /** Highlight item on hover. Defaults to true. */
1408
+ /** Highlight a clickable item on hover. Defaults to true; items that do nothing on click never get it. */
1401
1409
  hover?: boolean;
1402
1410
  /** Use compact (smaller) padding. */
1403
1411
  compact?: boolean;
@@ -1430,6 +1438,11 @@ declare class MnList<T = unknown> extends MnSelectableCollectionBase<T, ListData
1430
1438
  protected readonly componentName = "MnList";
1431
1439
  /** Skeleton lines rendered for each placeholder item, falling back to the default two-bar layout. */
1432
1440
  get skeletonLines(): Partial<MnSkeletonProps>[];
1441
+ /**
1442
+ * Whether clicking an item does anything: a data-source `onItemClick` or a bound
1443
+ * `(itemClick)`. Only then does an item get the hover wash and the pointer.
1444
+ */
1445
+ get itemsClickable(): boolean;
1433
1446
  onItemClick(item: T): void;
1434
1447
  /**
1435
1448
  * Keyboard activation of a clickable item: Enter and Space open it, as they would a button.
@@ -43,8 +43,11 @@ declare const mnCardVariants: tailwind_variants.TVReturnType<{
43
43
  };
44
44
  };
45
45
  /**
46
- * Hover response. `shadow` is a little depth for a card that only sits there;
47
- * `lift` promises a destination and belongs on a card that is a link.
46
+ * Hover response. None by default: a hover promises that a click does something, and
47
+ * most cards are settings, forms or facts that do nothing when clicked. `lift` promises a
48
+ * destination and belongs on a card that is a link or a button; it brings the matching
49
+ * keyboard focus ring, so a card that answers the pointer also answers Tab. `shadow` is
50
+ * kept for a consumer that already asks for it.
48
51
  */
49
52
  hover: {
50
53
  none: {};
@@ -158,8 +161,11 @@ declare const mnCardVariants: tailwind_variants.TVReturnType<{
158
161
  };
159
162
  };
160
163
  /**
161
- * Hover response. `shadow` is a little depth for a card that only sits there;
162
- * `lift` promises a destination and belongs on a card that is a link.
164
+ * Hover response. None by default: a hover promises that a click does something, and
165
+ * most cards are settings, forms or facts that do nothing when clicked. `lift` promises a
166
+ * destination and belongs on a card that is a link or a button; it brings the matching
167
+ * keyboard focus ring, so a card that answers the pointer also answers Tab. `shadow` is
168
+ * kept for a consumer that already asks for it.
163
169
  */
164
170
  hover: {
165
171
  none: {};
@@ -273,8 +279,11 @@ declare const mnCardVariants: tailwind_variants.TVReturnType<{
273
279
  };
274
280
  };
275
281
  /**
276
- * Hover response. `shadow` is a little depth for a card that only sits there;
277
- * `lift` promises a destination and belongs on a card that is a link.
282
+ * Hover response. None by default: a hover promises that a click does something, and
283
+ * most cards are settings, forms or facts that do nothing when clicked. `lift` promises a
284
+ * destination and belongs on a card that is a link or a button; it brings the matching
285
+ * keyboard focus ring, so a card that answers the pointer also answers Tab. `shadow` is
286
+ * kept for a consumer that already asks for it.
278
287
  */
279
288
  hover: {
280
289
  none: {};
@@ -366,16 +375,16 @@ type MnCardVariants = VariantProps<typeof mnCardVariants>;
366
375
 
367
376
  /**
368
377
  * Configuration of one {@link MnCard}. Every field is optional; the defaults give the
369
- * compact stacked tile with a soft hover, which is what most cards are.
378
+ * compact stacked tile that does not react to the pointer, which is what most cards are.
370
379
  */
371
380
  type MnCardTypes = {
372
381
  /** Inner padding and child gap. `sm` for tiles, `md` for section cards, `lg` for hero cards. */
373
382
  padding: MnCardVariants['padding'];
374
383
  /** Stacked children (`column`, the default) or one centred line (`row`). */
375
384
  layout: MnCardVariants['layout'];
376
- /** Hover response: `shadow` (default), `lift` for a card that is a link, or `none`. */
385
+ /** Hover response: `none` (default), `lift` for a card that is a link or a button, or `shadow`. */
377
386
  hover: MnCardVariants['hover'];
378
- /** Entrance animation: `rise` (default, needs the consumer's `--animate-rise`) or `none`. */
387
+ /** Entrance animation: `none` (default) or `rise` (needs the consumer's `--animate-rise`). */
379
388
  enter: MnCardVariants['enter'];
380
389
  /** Corner rounding. Defaults to `two_xl`. */
381
390
  borderRadius: MnCardVariants['borderRadius'];
@@ -435,7 +444,7 @@ declare class MnCard {
435
444
  color?: "primary" | "secondary" | "accent" | "success" | "warning" | "danger" | "gray" | undefined;
436
445
  padding?: "md" | "sm" | "lg" | undefined;
437
446
  layout?: "column" | "row" | undefined;
438
- hover?: "shadow" | "none" | "lift" | undefined;
447
+ hover?: "none" | "shadow" | "lift" | undefined;
439
448
  enter?: "none" | "rise" | undefined;
440
449
  borderRadius?: "md" | "xs" | "sm" | "lg" | "xl" | "none" | "two_xl" | "three_xl" | "four_xl" | undefined;
441
450
  } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string;
@@ -443,7 +452,7 @@ declare class MnCard {
443
452
  color?: "primary" | "secondary" | "accent" | "success" | "warning" | "danger" | "gray" | undefined;
444
453
  padding?: "md" | "sm" | "lg" | undefined;
445
454
  layout?: "column" | "row" | undefined;
446
- hover?: "shadow" | "none" | "lift" | undefined;
455
+ hover?: "none" | "shadow" | "lift" | undefined;
447
456
  enter?: "none" | "rise" | undefined;
448
457
  borderRadius?: "md" | "xs" | "sm" | "lg" | "xl" | "none" | "two_xl" | "three_xl" | "four_xl" | undefined;
449
458
  } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string;
@@ -451,7 +460,7 @@ declare class MnCard {
451
460
  color?: "primary" | "secondary" | "accent" | "success" | "warning" | "danger" | "gray" | undefined;
452
461
  padding?: "md" | "sm" | "lg" | undefined;
453
462
  layout?: "column" | "row" | undefined;
454
- hover?: "shadow" | "none" | "lift" | undefined;
463
+ hover?: "none" | "shadow" | "lift" | undefined;
455
464
  enter?: "none" | "rise" | undefined;
456
465
  borderRadius?: "md" | "xs" | "sm" | "lg" | "xl" | "none" | "two_xl" | "three_xl" | "four_xl" | undefined;
457
466
  } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string;
@@ -459,7 +468,7 @@ declare class MnCard {
459
468
  color?: "primary" | "secondary" | "accent" | "success" | "warning" | "danger" | "gray" | undefined;
460
469
  padding?: "md" | "sm" | "lg" | undefined;
461
470
  layout?: "column" | "row" | undefined;
462
- hover?: "shadow" | "none" | "lift" | undefined;
471
+ hover?: "none" | "shadow" | "lift" | undefined;
463
472
  enter?: "none" | "rise" | undefined;
464
473
  borderRadius?: "md" | "xs" | "sm" | "lg" | "xl" | "none" | "two_xl" | "three_xl" | "four_xl" | undefined;
465
474
  } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string;
@@ -468,7 +477,7 @@ declare class MnCard {
468
477
  color?: "primary" | "secondary" | "accent" | "success" | "warning" | "danger" | "gray" | undefined;
469
478
  padding?: "md" | "sm" | "lg" | undefined;
470
479
  layout?: "column" | "row" | undefined;
471
- hover?: "shadow" | "none" | "lift" | undefined;
480
+ hover?: "none" | "shadow" | "lift" | undefined;
472
481
  enter?: "none" | "rise" | undefined;
473
482
  borderRadius?: "md" | "xs" | "sm" | "lg" | "xl" | "none" | "two_xl" | "three_xl" | "four_xl" | undefined;
474
483
  } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string;
@@ -476,7 +485,7 @@ declare class MnCard {
476
485
  color?: "primary" | "secondary" | "accent" | "success" | "warning" | "danger" | "gray" | undefined;
477
486
  padding?: "md" | "sm" | "lg" | undefined;
478
487
  layout?: "column" | "row" | undefined;
479
- hover?: "shadow" | "none" | "lift" | undefined;
488
+ hover?: "none" | "shadow" | "lift" | undefined;
480
489
  enter?: "none" | "rise" | undefined;
481
490
  borderRadius?: "md" | "xs" | "sm" | "lg" | "xl" | "none" | "two_xl" | "three_xl" | "four_xl" | undefined;
482
491
  } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string;
@@ -484,7 +493,7 @@ declare class MnCard {
484
493
  color?: "primary" | "secondary" | "accent" | "success" | "warning" | "danger" | "gray" | undefined;
485
494
  padding?: "md" | "sm" | "lg" | undefined;
486
495
  layout?: "column" | "row" | undefined;
487
- hover?: "shadow" | "none" | "lift" | undefined;
496
+ hover?: "none" | "shadow" | "lift" | undefined;
488
497
  enter?: "none" | "rise" | undefined;
489
498
  borderRadius?: "md" | "xs" | "sm" | "lg" | "xl" | "none" | "two_xl" | "three_xl" | "four_xl" | undefined;
490
499
  } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string;
@@ -492,7 +501,7 @@ declare class MnCard {
492
501
  color?: "primary" | "secondary" | "accent" | "success" | "warning" | "danger" | "gray" | undefined;
493
502
  padding?: "md" | "sm" | "lg" | undefined;
494
503
  layout?: "column" | "row" | undefined;
495
- hover?: "shadow" | "none" | "lift" | undefined;
504
+ hover?: "none" | "shadow" | "lift" | undefined;
496
505
  enter?: "none" | "rise" | undefined;
497
506
  borderRadius?: "md" | "xs" | "sm" | "lg" | "xl" | "none" | "two_xl" | "three_xl" | "four_xl" | undefined;
498
507
  } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string;
@@ -3117,6 +3117,12 @@ declare class MnDropdown implements OnInit {
3117
3117
  /** Capture-phase scroll listener installed while open, closing on any ancestor scroll. */
3118
3118
  private scrollCapture;
3119
3119
  isOpen: boolean;
3120
+ /**
3121
+ * The command that takes focus once the opened menu has rendered: the first or last one,
3122
+ * or none when a desktop search box takes focus instead. Set by {@link open}, consumed by
3123
+ * the panel and sheet queries the moment the menu appears.
3124
+ */
3125
+ private pendingFocus;
3120
3126
  /** Stable fallback id, used when {@link MnDropdownProps.id} is omitted. Generated once per
3121
3127
  * instance so the a11y wiring (menu id, `aria-controls`, the search input) stays valid. */
3122
3128
  private readonly autoId;
@@ -3146,12 +3152,50 @@ declare class MnDropdown implements OnInit {
3146
3152
  private startWatchingViewport;
3147
3153
  private stopWatchingViewport;
3148
3154
  toggle(): void;
3155
+ /**
3156
+ * Opens the menu and moves focus into it, as the menu-button pattern expects: a keyboard
3157
+ * user lands on a command (or in the search box) instead of staying on the trigger with
3158
+ * the items out of reach at the end of the page.
3159
+ * @param focus The command to focus once the menu has rendered.
3160
+ */
3161
+ private open;
3149
3162
  /** The single close path, so every open-only listener is torn down with the panel. */
3150
3163
  close(): void;
3151
3164
  /** Whether the menu should currently render as a bottom sheet. */
3152
3165
  get isSheet(): boolean;
3153
- /** Fires an action and closes. Ignores disabled items defensively. */
3166
+ /**
3167
+ * Fires an action and closes. Focus goes back to the trigger first, so a keyboard user is
3168
+ * not left on a removed item and a modal the action opens restores focus there. Ignores
3169
+ * disabled items defensively.
3170
+ */
3154
3171
  select(action: MnDropdownAction): void;
3172
+ /**
3173
+ * Arrow keys on the trigger open the menu on its first (↓) or last (↑) command, or move
3174
+ * there when it is already open. Enter and Space need no handler: they click the button.
3175
+ * @param event The keydown on the trigger.
3176
+ */
3177
+ onTriggerKeydown(event: KeyboardEvent): void;
3178
+ /**
3179
+ * Keyboard movement inside the open menu: the arrows step through the enabled commands
3180
+ * (wrapping), Home and End jump to the ends, and Tab closes the menu with focus back on the
3181
+ * trigger, so the browser's own Tab then moves on from there as if the menu was never
3182
+ * open. Escape is handled document-wide by {@link onEscape}.
3183
+ * @param event The keydown inside the menu.
3184
+ */
3185
+ onMenuKeydown(event: KeyboardEvent): void;
3186
+ /** The enabled commands currently rendered in the menu, in order. */
3187
+ private menuItems;
3188
+ /**
3189
+ * Focuses a command relative to the one that has focus now. From outside the list (the
3190
+ * search box) "next" is the first command and "previous" the last.
3191
+ * @param which The first, last, next or previous enabled command.
3192
+ */
3193
+ private focusItem;
3194
+ /**
3195
+ * Moves focus to the command {@link open} asked for, once. Called from the panel and sheet
3196
+ * queries; deferred a microtask so the item list rendered in the same pass exists.
3197
+ */
3198
+ private focusPendingItem;
3155
3199
  /** Whether the filter input is shown — the explicit `searchable` prop, off by default. */
3156
3200
  get isSearchable(): boolean;
3157
3201
  /**