mn-angular-lib 2.0.19 → 2.0.21

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.19",
3
+ "version": "2.0.21",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^22.1.7",
6
6
  "@angular/core": "^22.1.7",
@@ -18,7 +18,7 @@ declare const mnAlertVariants: tailwind_variants.TVReturnType<{
18
18
  outline: string;
19
19
  soft: string;
20
20
  };
21
- }, undefined, "flex items-start gap-3 p-4 border rounded-xl shadow-sm transition-all duration-300 w-full ", {
21
+ }, undefined, "flex items-start gap-3 p-4 border rounded-xl shadow-sm w-full ", {
22
22
  kind: {
23
23
  success: string;
24
24
  info: string;
@@ -46,7 +46,7 @@ declare const mnAlertVariants: tailwind_variants.TVReturnType<{
46
46
  outline: string;
47
47
  soft: string;
48
48
  };
49
- }, undefined, "flex items-start gap-3 p-4 border rounded-xl shadow-sm transition-all duration-300 w-full ", unknown, unknown, undefined>>;
49
+ }, undefined, "flex items-start gap-3 p-4 border rounded-xl shadow-sm w-full ", unknown, unknown, undefined>>;
50
50
  type MnAlertVariants = VariantProps<typeof mnAlertVariants>;
51
51
 
52
52
  type MnAlertId = string;
@@ -54,7 +54,7 @@ declare const mnButtonVariants: tailwind_variants.TVReturnType<{
54
54
  hover: {
55
55
  true: string;
56
56
  };
57
- }, undefined, "inline-flex items-center justify-center hover:cursor-pointer transition-all duration-300 ease-in-out", {
57
+ }, undefined, "inline-flex items-center justify-center hover:cursor-pointer transition-[color,background-color,border-color,box-shadow,filter,opacity] duration-300 ease-in-out", {
58
58
  size: {
59
59
  sm: string;
60
60
  md: string;
@@ -158,7 +158,7 @@ declare const mnButtonVariants: tailwind_variants.TVReturnType<{
158
158
  hover: {
159
159
  true: string;
160
160
  };
161
- }, undefined, "inline-flex items-center justify-center hover:cursor-pointer transition-all duration-300 ease-in-out", unknown, unknown, undefined>>;
161
+ }, undefined, "inline-flex items-center justify-center hover:cursor-pointer transition-[color,background-color,border-color,box-shadow,filter,opacity] duration-300 ease-in-out", unknown, unknown, undefined>>;
162
162
  type MnButtonVariants = VariantProps<typeof mnButtonVariants>;
163
163
 
164
164
  type MnButtonTypes = {
@@ -1417,7 +1417,7 @@ declare const mnFileInputVariants: tailwind_variants.TVReturnType<{
1417
1417
  disabled: {
1418
1418
  true: string;
1419
1419
  };
1420
- }, undefined, "bg-base-100 border-1 border-base-300 text-base-content text-sm outline-none transition-all duration-300 ease-in-out", {
1420
+ }, undefined, "bg-base-100 border-1 border-base-300 text-base-content text-sm outline-none transition-[color,background-color,border-color,box-shadow,scale,opacity] duration-300 ease-in-out", {
1421
1421
  /** Inner padding scale of the clickable control. */
1422
1422
  size: {
1423
1423
  sm: string;
@@ -1495,7 +1495,7 @@ declare const mnFileInputVariants: tailwind_variants.TVReturnType<{
1495
1495
  disabled: {
1496
1496
  true: string;
1497
1497
  };
1498
- }, undefined, "bg-base-100 border-1 border-base-300 text-base-content text-sm outline-none transition-all duration-300 ease-in-out", unknown, unknown, undefined>>;
1498
+ }, undefined, "bg-base-100 border-1 border-base-300 text-base-content text-sm outline-none transition-[color,background-color,border-color,box-shadow,scale,opacity] duration-300 ease-in-out", unknown, unknown, undefined>>;
1499
1499
  /** Variant prop types derived from {@link mnFileInputVariants}. */
1500
1500
  type MnFileInputVariants = VariantProps<typeof mnFileInputVariants>;
1501
1501
 
@@ -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
  /**