@mk-kit/ui 0.34.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.
- package/LICENSE +21 -0
- package/README.md +115 -0
- package/block-editor/README.md +254 -0
- package/fesm2022/mk-kit-ui-block-editor.mjs +2158 -0
- package/fesm2022/mk-kit-ui-block-editor.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-button.mjs +81 -0
- package/fesm2022/mk-kit-ui-button.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-checkbox.mjs +136 -0
- package/fesm2022/mk-kit-ui-checkbox.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-chip.mjs +122 -0
- package/fesm2022/mk-kit-ui-chip.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-context-menu.mjs +144 -0
- package/fesm2022/mk-kit-ui-context-menu.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-core.mjs +1576 -0
- package/fesm2022/mk-kit-ui-core.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-data.mjs +6055 -0
- package/fesm2022/mk-kit-ui-data.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-datetime.mjs +3409 -0
- package/fesm2022/mk-kit-ui-datetime.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-directives.mjs +1779 -0
- package/fesm2022/mk-kit-ui-directives.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-dnd.mjs +1073 -0
- package/fesm2022/mk-kit-ui-dnd.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-feedback.mjs +2426 -0
- package/fesm2022/mk-kit-ui-feedback.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-forms.mjs +9208 -0
- package/fesm2022/mk-kit-ui-forms.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-icon.mjs +470 -0
- package/fesm2022/mk-kit-ui-icon.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-media.mjs +896 -0
- package/fesm2022/mk-kit-ui-media.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-navigation.mjs +2542 -0
- package/fesm2022/mk-kit-ui-navigation.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-rich-text.mjs +565 -0
- package/fesm2022/mk-kit-ui-rich-text.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-table.mjs +1378 -0
- package/fesm2022/mk-kit-ui-table.mjs.map +1 -0
- package/fesm2022/mk-kit-ui.mjs +32 -0
- package/fesm2022/mk-kit-ui.mjs.map +1 -0
- package/package.json +130 -0
- package/schematics/collection.json +10 -0
- package/schematics/ng-add/index.js +113 -0
- package/schematics/ng-add/schema.json +22 -0
- package/schematics/package.json +3 -0
- package/styles/mk-kit.css +750 -0
- package/types/mk-kit-ui-block-editor.d.ts +292 -0
- package/types/mk-kit-ui-button.d.ts +40 -0
- package/types/mk-kit-ui-checkbox.d.ts +62 -0
- package/types/mk-kit-ui-chip.d.ts +59 -0
- package/types/mk-kit-ui-context-menu.d.ts +57 -0
- package/types/mk-kit-ui-core.d.ts +1105 -0
- package/types/mk-kit-ui-data.d.ts +2580 -0
- package/types/mk-kit-ui-datetime.d.ts +1171 -0
- package/types/mk-kit-ui-directives.d.ts +807 -0
- package/types/mk-kit-ui-dnd.d.ts +423 -0
- package/types/mk-kit-ui-feedback.d.ts +1270 -0
- package/types/mk-kit-ui-forms.d.ts +3586 -0
- package/types/mk-kit-ui-icon.d.ts +108 -0
- package/types/mk-kit-ui-media.d.ts +549 -0
- package/types/mk-kit-ui-navigation.d.ts +1169 -0
- package/types/mk-kit-ui-rich-text.d.ts +187 -0
- package/types/mk-kit-ui-table.d.ts +739 -0
- package/types/mk-kit-ui.d.ts +17 -0
|
@@ -0,0 +1,1270 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { OnDestroy, Type, InjectionToken } from '@angular/core';
|
|
3
|
+
import * as _mk_kit_ui_core from '@mk-kit/ui/core';
|
|
4
|
+
import { MkPlacement, MkTone, MkOverlayConfig, MkOverlayRef } from '@mk-kit/ui/core';
|
|
5
|
+
import * as _mk_kit_ui_feedback from '@mk-kit/ui/feedback';
|
|
6
|
+
|
|
7
|
+
/** Semantic tones supported by {@link MkAlert}. */
|
|
8
|
+
type MkAlertTone = 'info' | 'success' | 'warning' | 'danger' | 'neutral';
|
|
9
|
+
/** Visual treatments supported by {@link MkAlert}. */
|
|
10
|
+
type MkAlertVariant = 'soft' | 'solid' | 'outline';
|
|
11
|
+
/**
|
|
12
|
+
* Alert — an inline banner that communicates a contextual status message.
|
|
13
|
+
* Fully themed via `--mk-*` tokens using the same tone/local-var pattern as
|
|
14
|
+
* the Button. Danger/warning alerts use `role="alert"` (assertive), all other
|
|
15
|
+
* tones use `role="status"` (polite).
|
|
16
|
+
*
|
|
17
|
+
* ```html
|
|
18
|
+
* <mk-alert tone="success" title="Saved">Your changes were saved.</mk-alert>
|
|
19
|
+
*
|
|
20
|
+
* <mk-alert tone="danger" variant="outline" dismissible (dismissed)="hide()">
|
|
21
|
+
* <svg mkAlertIcon>…</svg>
|
|
22
|
+
* Could not reach the server.
|
|
23
|
+
* </mk-alert>
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
declare class MkAlert {
|
|
27
|
+
/** Localised strings (override globally via `provideMkI18n`). */
|
|
28
|
+
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
29
|
+
/** Semantic color tone. */
|
|
30
|
+
readonly tone: _angular_core.InputSignal<MkAlertTone>;
|
|
31
|
+
/** Visual treatment. */
|
|
32
|
+
readonly variant: _angular_core.InputSignal<MkAlertVariant>;
|
|
33
|
+
/** Optional bold heading rendered above the message. */
|
|
34
|
+
readonly title: _angular_core.InputSignal<string | undefined>;
|
|
35
|
+
/** When set, renders a keyboard-accessible close button that emits `dismissed`. */
|
|
36
|
+
readonly dismissible: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
37
|
+
/** Emitted when the user activates the close button. */
|
|
38
|
+
readonly dismissed: _angular_core.OutputEmitterRef<void>;
|
|
39
|
+
/** Assertive roles for urgent tones, polite `status` otherwise. */
|
|
40
|
+
protected readonly role: _angular_core.Signal<"alert" | "status">;
|
|
41
|
+
protected onDismiss(): void;
|
|
42
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkAlert, never>;
|
|
43
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkAlert, "mk-alert", never, { "tone": { "alias": "tone"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "dismissible": { "alias": "dismissible"; "required": false; "isSignal": true; }; }, { "dismissed": "dismissed"; }, never, ["[mkAlertIcon]", "*"], true, never>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Body-level presentation surface for {@link MkTooltip}. Rendered imperatively
|
|
48
|
+
* by the directive; not intended for direct template use.
|
|
49
|
+
*/
|
|
50
|
+
declare class MkTooltipPanel {
|
|
51
|
+
/** Text content shown inside the tooltip. */
|
|
52
|
+
readonly text: _angular_core.InputSignal<string>;
|
|
53
|
+
/** DOM id used to wire `aria-describedby` on the trigger. */
|
|
54
|
+
readonly id: _angular_core.InputSignal<string | undefined>;
|
|
55
|
+
/** Resolved placement relative to the trigger. */
|
|
56
|
+
readonly placement: _angular_core.InputSignal<MkPlacement>;
|
|
57
|
+
/** Drives the entrance/exit transition. */
|
|
58
|
+
readonly visible: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
59
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkTooltipPanel, never>;
|
|
60
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkTooltipPanel, "mk-tooltip", never, { "text": { "alias": "text"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "placement": { "alias": "placement"; "required": false; "isSignal": true; }; "visible": { "alias": "visible"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Tooltip directive — shows a themed tooltip on hover AND keyboard focus, and
|
|
64
|
+
* hides on blur, mouse-leave (after a short grace period — the pointer may
|
|
65
|
+
* move onto the tooltip itself, which keeps it open, per WCAG 1.4.13), or
|
|
66
|
+
* Escape pressed anywhere while it is visible. The tooltip is appended to
|
|
67
|
+
* `document.body`, positioned relative to the host, and wired to the host via
|
|
68
|
+
* `aria-describedby` for screen-reader users. Respects `prefers-reduced-motion`.
|
|
69
|
+
*
|
|
70
|
+
* ```html
|
|
71
|
+
* <button mkButton [mkTooltip]="'Delete row'" mkTooltipPlacement="bottom">
|
|
72
|
+
* <svg>…</svg>
|
|
73
|
+
* </button>
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
declare class MkTooltip {
|
|
77
|
+
private readonly host;
|
|
78
|
+
private readonly appRef;
|
|
79
|
+
private readonly envInjector;
|
|
80
|
+
private readonly document;
|
|
81
|
+
private readonly isBrowser;
|
|
82
|
+
/** Set by pointerdown so the focusin it causes doesn't re-open the tip. */
|
|
83
|
+
private suppressFocusShow;
|
|
84
|
+
/** Tooltip text. When empty the tooltip is suppressed. */
|
|
85
|
+
readonly mkTooltip: _angular_core.InputSignal<string>;
|
|
86
|
+
/** Preferred placement relative to the host. */
|
|
87
|
+
readonly mkTooltipPlacement: _angular_core.InputSignal<MkPlacement>;
|
|
88
|
+
private readonly tooltipId;
|
|
89
|
+
private ref?;
|
|
90
|
+
private openTimer?;
|
|
91
|
+
private hideTimer?;
|
|
92
|
+
private previousDescribedBy;
|
|
93
|
+
/**
|
|
94
|
+
* Hovering the tooltip itself keeps it open (WCAG 1.4.13 "hoverable"): the
|
|
95
|
+
* pointer may cross the gap between trigger and panel, so leaving either one
|
|
96
|
+
* only SCHEDULES a hide, and entering either one cancels it.
|
|
97
|
+
*/
|
|
98
|
+
private readonly onPanelEnter;
|
|
99
|
+
private readonly onPanelLeave;
|
|
100
|
+
/**
|
|
101
|
+
* WCAG 1.4.13 "dismissible": Escape hides a visible tooltip no matter where
|
|
102
|
+
* focus is. Attached to the document only while the tooltip is shown, and
|
|
103
|
+
* preventDefault only fires when a tooltip was actually hidden.
|
|
104
|
+
*/
|
|
105
|
+
private readonly onDocumentKeydown;
|
|
106
|
+
protected onPointerEnter(): void;
|
|
107
|
+
protected onPointerLeave(): void;
|
|
108
|
+
private scheduleHide;
|
|
109
|
+
protected onFocus(): void;
|
|
110
|
+
protected onPointerDown(event: PointerEvent): void;
|
|
111
|
+
/**
|
|
112
|
+
* Outside-tap dismissal (attached to the document only while visible): a
|
|
113
|
+
* pointerdown that lands on neither the trigger nor the panel hides the
|
|
114
|
+
* tooltip. The trigger's own pointerdown handles show/hide/toggle itself,
|
|
115
|
+
* and a press on the panel keeps it up (WCAG 1.4.13 "hoverable").
|
|
116
|
+
*/
|
|
117
|
+
private readonly onDocumentPointerdown;
|
|
118
|
+
private scheduleShow;
|
|
119
|
+
protected hide(): void;
|
|
120
|
+
private show;
|
|
121
|
+
private position;
|
|
122
|
+
ngOnDestroy(): void;
|
|
123
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkTooltip, never>;
|
|
124
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MkTooltip, "[mkTooltip]", never, { "mkTooltip": { "alias": "mkTooltip"; "required": false; "isSignal": true; }; "mkTooltipPlacement": { "alias": "mkTooltipPlacement"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Popover — a non-modal floating panel for rich (non-text) content, anchored to
|
|
129
|
+
* a trigger. Unlike {@link MkTooltip} (text, hover) it holds arbitrary projected
|
|
130
|
+
* content and is opened by click via the `mkPopoverTriggerFor` directive (or the
|
|
131
|
+
* `open`/`toggle` API).
|
|
132
|
+
*
|
|
133
|
+
* The panel renders in the browser top layer through {@link MkAnchoredPanel}, so
|
|
134
|
+
* it is never clipped by an ancestor's `overflow`/`transform`. On open, focus
|
|
135
|
+
* moves into the panel; Escape closes and restores focus to the trigger, an
|
|
136
|
+
* outside click or Tabbing out closes it (non-modal — no keyboard trap).
|
|
137
|
+
*
|
|
138
|
+
* ```html
|
|
139
|
+
* <button mkButton [mkPopoverTriggerFor]="info">Details</button>
|
|
140
|
+
* <mk-popover #info ariaLabel="Details">
|
|
141
|
+
* <h4>Shipping</h4><p>Ships in 2–3 business days.</p>
|
|
142
|
+
* </mk-popover>
|
|
143
|
+
* ```
|
|
144
|
+
*/
|
|
145
|
+
declare class MkPopover {
|
|
146
|
+
private readonly injector;
|
|
147
|
+
private readonly isBrowser;
|
|
148
|
+
private readonly panelRef;
|
|
149
|
+
/** Stable id for `aria-controls` on the trigger. */
|
|
150
|
+
readonly panelId: string;
|
|
151
|
+
/** Preferred placement relative to the trigger. */
|
|
152
|
+
readonly placement: _angular_core.InputSignal<MkPlacement>;
|
|
153
|
+
/** Accessible label for the dialog panel. */
|
|
154
|
+
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
155
|
+
/** Move focus into the panel on open. Default `true`. */
|
|
156
|
+
readonly autoFocus: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
157
|
+
/** Emitted whenever the popover closes (any reason). */
|
|
158
|
+
readonly closed: _angular_core.OutputEmitterRef<void>;
|
|
159
|
+
private readonly _open;
|
|
160
|
+
/** Whether the popover is open. */
|
|
161
|
+
readonly opened: _angular_core.Signal<boolean>;
|
|
162
|
+
protected readonly anchorEl: _angular_core.WritableSignal<HTMLElement | undefined>;
|
|
163
|
+
private triggerEl;
|
|
164
|
+
/** Open the popover anchored to `trigger`. */
|
|
165
|
+
open(trigger: HTMLElement): void;
|
|
166
|
+
/** Close the popover; optionally restore focus to the trigger. */
|
|
167
|
+
close(restoreFocus?: boolean): void;
|
|
168
|
+
/** Toggle open/closed from a trigger. */
|
|
169
|
+
toggle(trigger: HTMLElement): void;
|
|
170
|
+
private focusInitial;
|
|
171
|
+
protected onEscape(event: Event): void;
|
|
172
|
+
protected onPanelFocusout(event: FocusEvent): void;
|
|
173
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkPopover, never>;
|
|
174
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkPopover, "mk-popover", ["mkPopover"], { "placement": { "alias": "placement"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "autoFocus": { "alias": "autoFocus"; "required": false; "isSignal": true; }; }, { "closed": "closed"; }, never, ["*"], true, never>;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Turns its host element into a click trigger for an `<mk-popover>`. Wires
|
|
179
|
+
* `aria-haspopup="dialog"` / `aria-expanded` / `aria-controls`, toggles on click
|
|
180
|
+
* and closes on Escape.
|
|
181
|
+
*
|
|
182
|
+
* ```html
|
|
183
|
+
* <button mkButton [mkPopoverTriggerFor]="info">Details</button>
|
|
184
|
+
* <mk-popover #info>…</mk-popover>
|
|
185
|
+
* ```
|
|
186
|
+
*/
|
|
187
|
+
declare class MkPopoverTrigger {
|
|
188
|
+
private readonly host;
|
|
189
|
+
/** The popover instance to control. */
|
|
190
|
+
readonly popover: _angular_core.InputSignal<MkPopover>;
|
|
191
|
+
protected onClick(event: Event): void;
|
|
192
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
193
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkPopoverTrigger, never>;
|
|
194
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MkPopoverTrigger, "[mkPopoverTriggerFor]", ["mkPopoverTrigger"], { "popover": { "alias": "mkPopoverTriggerFor"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Popconfirm — an inline confirmation popover (e.g. a row-level "Delete?").
|
|
199
|
+
* Composes {@link MkPopover} with a message and cancel/confirm buttons, so it
|
|
200
|
+
* inherits the top-layer positioning + focus behaviour. Attach it with the
|
|
201
|
+
* `mkPopconfirmFor` directive.
|
|
202
|
+
*
|
|
203
|
+
* ```html
|
|
204
|
+
* <button mkButton tone="danger" [mkPopconfirmFor]="del">Delete</button>
|
|
205
|
+
* <mk-popconfirm #del message="Delete this item?" (confirm)="remove()" />
|
|
206
|
+
* ```
|
|
207
|
+
*/
|
|
208
|
+
declare class MkPopconfirm {
|
|
209
|
+
private readonly popover;
|
|
210
|
+
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
211
|
+
/** Confirmation message. */
|
|
212
|
+
readonly message: _angular_core.InputSignal<string>;
|
|
213
|
+
/** Optional bold heading above the message. */
|
|
214
|
+
readonly title: _angular_core.InputSignal<string | undefined>;
|
|
215
|
+
/** Confirm button label. */
|
|
216
|
+
readonly confirmText: _angular_core.InputSignal<string>;
|
|
217
|
+
/** Cancel button label. */
|
|
218
|
+
readonly cancelText: _angular_core.InputSignal<string>;
|
|
219
|
+
/** Tone of the confirm button (destructive actions use `danger`). */
|
|
220
|
+
readonly tone: _angular_core.InputSignal<MkTone>;
|
|
221
|
+
/** Preferred placement relative to the trigger. */
|
|
222
|
+
readonly placement: _angular_core.InputSignal<MkPlacement>;
|
|
223
|
+
/** Emitted when the user confirms. */
|
|
224
|
+
readonly confirm: _angular_core.OutputEmitterRef<void>;
|
|
225
|
+
/** Emitted when the user cancels (button, Escape or outside click). */
|
|
226
|
+
readonly cancel: _angular_core.OutputEmitterRef<void>;
|
|
227
|
+
/** Id of the underlying dialog panel (for the trigger's `aria-controls`). */
|
|
228
|
+
get panelId(): string | null;
|
|
229
|
+
/** Whether the popconfirm is open. */
|
|
230
|
+
opened(): boolean;
|
|
231
|
+
/** Open anchored to `trigger`. */
|
|
232
|
+
open(trigger: HTMLElement): void;
|
|
233
|
+
/** Toggle from a trigger. */
|
|
234
|
+
toggle(trigger: HTMLElement): void;
|
|
235
|
+
/** Close the popconfirm. */
|
|
236
|
+
close(): void;
|
|
237
|
+
/** Set when the user confirms, so the close handler doesn't also cancel. */
|
|
238
|
+
private confirmed;
|
|
239
|
+
protected onConfirm(): void;
|
|
240
|
+
protected onCancel(): void;
|
|
241
|
+
/** Any close that wasn't a confirm counts as a cancel (Escape / outside). */
|
|
242
|
+
protected onPopoverClosed(): void;
|
|
243
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkPopconfirm, never>;
|
|
244
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkPopconfirm, "mk-popconfirm", ["mkPopconfirm"], { "message": { "alias": "message"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "confirmText": { "alias": "confirmText"; "required": false; "isSignal": true; }; "cancelText": { "alias": "cancelText"; "required": false; "isSignal": true; }; "tone": { "alias": "tone"; "required": false; "isSignal": true; }; "placement": { "alias": "placement"; "required": false; "isSignal": true; }; }, { "confirm": "confirm"; "cancel": "cancel"; }, never, never, true, never>;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Turns its host element into a click trigger for an `<mk-popconfirm>`. Wires
|
|
249
|
+
* `aria-haspopup="dialog"` / `aria-expanded` / `aria-controls`, toggles on click
|
|
250
|
+
* and closes on Escape.
|
|
251
|
+
*
|
|
252
|
+
* ```html
|
|
253
|
+
* <button mkButton tone="danger" [mkPopconfirmFor]="del">Delete</button>
|
|
254
|
+
* <mk-popconfirm #del message="Delete this item?" (confirm)="remove()" />
|
|
255
|
+
* ```
|
|
256
|
+
*/
|
|
257
|
+
declare class MkPopconfirmTrigger {
|
|
258
|
+
private readonly host;
|
|
259
|
+
/** The popconfirm instance to control. */
|
|
260
|
+
readonly popconfirm: _angular_core.InputSignal<MkPopconfirm>;
|
|
261
|
+
protected onClick(event: Event): void;
|
|
262
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
263
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkPopconfirmTrigger, never>;
|
|
264
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MkPopconfirmTrigger, "[mkPopconfirmFor]", ["mkPopconfirmTrigger"], { "popconfirm": { "alias": "mkPopconfirmFor"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/** Status presets supported by {@link MkResult}. */
|
|
268
|
+
type MkResultStatus = 'success' | 'error' | 'info' | 'warning' | '404' | '403' | '500';
|
|
269
|
+
/** Built-in icon glyph chosen for a status. */
|
|
270
|
+
type MkResultIconVariant = 'check' | 'x' | 'alert' | 'info' | 'search';
|
|
271
|
+
/** Tone colour applied to the status icon. */
|
|
272
|
+
type MkResultTone = 'success' | 'danger' | 'warning' | 'info' | 'muted';
|
|
273
|
+
/**
|
|
274
|
+
* Result — a centred, full-page status state: a success confirmation, an error,
|
|
275
|
+
* an empty 404/403/500 page. Renders a large status icon (chosen from
|
|
276
|
+
* `status`), a title, a muted subtitle, projected body content, and a row of
|
|
277
|
+
* action buttons at the bottom.
|
|
278
|
+
*
|
|
279
|
+
* Slots: `[mkResultIcon]` (custom icon, overrides the built-in glyph),
|
|
280
|
+
* `[mkResultTitle]` (custom heading, used when `resultTitle` is unset), default
|
|
281
|
+
* content (extra body), `[mkResultActions]` (buttons).
|
|
282
|
+
*
|
|
283
|
+
* ```html
|
|
284
|
+
* <mk-result status="success" resultTitle="Payment complete"
|
|
285
|
+
* subtitle="Your order is on its way.">
|
|
286
|
+
* <button mkButton mkResultActions>Back home</button>
|
|
287
|
+
* </mk-result>
|
|
288
|
+
* ```
|
|
289
|
+
*/
|
|
290
|
+
declare class MkResult {
|
|
291
|
+
/** Status preset that selects the built-in icon glyph and its tone colour. */
|
|
292
|
+
readonly status: _angular_core.InputSignal<MkResultStatus>;
|
|
293
|
+
/** Main heading rendered as an `<h2>` (falls back to the `[mkResultTitle]` slot). */
|
|
294
|
+
readonly resultTitle: _angular_core.InputSignal<string>;
|
|
295
|
+
/** Supporting muted sentence under the title. */
|
|
296
|
+
readonly subtitle: _angular_core.InputSignal<string>;
|
|
297
|
+
/** Built-in glyph for the current status. */
|
|
298
|
+
protected readonly iconName: _angular_core.Signal<MkResultIconVariant>;
|
|
299
|
+
/** Tone colour applied to the status icon. */
|
|
300
|
+
protected readonly tone: _angular_core.Signal<MkResultTone>;
|
|
301
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkResult, never>;
|
|
302
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkResult, "mk-result", never, { "status": { "alias": "status"; "required": false; "isSignal": true; }; "resultTitle": { "alias": "resultTitle"; "required": false; "isSignal": true; }; "subtitle": { "alias": "subtitle"; "required": false; "isSignal": true; }; }, {}, never, ["[mkResultIcon]", "[mkResultTitle]", "*", "[mkResultActions]"], true, never>;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Hovercard — a rich hover-preview panel anchored to a trigger, in the spirit of
|
|
307
|
+
* GitHub's user hovercards. Unlike {@link MkTooltip} (short text) it projects
|
|
308
|
+
* arbitrary content, and unlike {@link MkPopover} (click) it opens on hover/focus
|
|
309
|
+
* after a short delay and closes when the pointer leaves both the trigger and the
|
|
310
|
+
* card. It is driven by the `mkHovercardFor` directive (or the `open`/`close` API).
|
|
311
|
+
*
|
|
312
|
+
* The panel renders in the browser top layer through {@link MkAnchoredPanel}, so
|
|
313
|
+
* it is never clipped by an ancestor's `overflow`/`transform`. It is non-modal —
|
|
314
|
+
* no focus trap. Moving the pointer from the trigger onto the card keeps it open;
|
|
315
|
+
* Escape closes it.
|
|
316
|
+
*
|
|
317
|
+
* ```html
|
|
318
|
+
* <a href="/u/ada" [mkHovercardFor]="ada">@ada</a>
|
|
319
|
+
* <mk-hovercard #ada ariaLabel="Ada Lovelace">
|
|
320
|
+
* <img src="/ada.png" alt="" /><strong>Ada Lovelace</strong>
|
|
321
|
+
* </mk-hovercard>
|
|
322
|
+
* ```
|
|
323
|
+
*/
|
|
324
|
+
declare class MkHovercard implements OnDestroy {
|
|
325
|
+
private readonly document;
|
|
326
|
+
private readonly isBrowser;
|
|
327
|
+
/** Stable id for `aria-controls` on the trigger. */
|
|
328
|
+
readonly panelId: string;
|
|
329
|
+
/** Preferred placement relative to the trigger. */
|
|
330
|
+
readonly placement: _angular_core.InputSignal<MkPlacement>;
|
|
331
|
+
/** Accessible label for the panel. */
|
|
332
|
+
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
333
|
+
/** Delay in ms before the card opens on hover/focus. Default `300`. */
|
|
334
|
+
readonly openDelay: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
335
|
+
/** Delay in ms before the card closes after the pointer leaves. Default `200`. */
|
|
336
|
+
readonly closeDelay: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
337
|
+
/** Close the card when Escape is pressed while it is open. Default `true`. */
|
|
338
|
+
readonly closeOnEscape: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
339
|
+
/** Emitted whenever the hovercard closes (any reason). */
|
|
340
|
+
readonly closed: _angular_core.OutputEmitterRef<void>;
|
|
341
|
+
private readonly _open;
|
|
342
|
+
/** Whether the hovercard is open. */
|
|
343
|
+
readonly opened: _angular_core.Signal<boolean>;
|
|
344
|
+
protected readonly anchorEl: _angular_core.WritableSignal<HTMLElement | undefined>;
|
|
345
|
+
private triggerEl;
|
|
346
|
+
private openTimer;
|
|
347
|
+
private closeTimer;
|
|
348
|
+
/** Open the card anchored to `trigger` after `openDelay` (cancels a pending close). */
|
|
349
|
+
scheduleOpen(trigger: HTMLElement): void;
|
|
350
|
+
/** Close the card after `closeDelay` (cancels a pending open). */
|
|
351
|
+
scheduleClose(): void;
|
|
352
|
+
/**
|
|
353
|
+
* Keep the card open: cancel any pending open/close. Called when the pointer
|
|
354
|
+
* enters the card itself, so moving from the trigger to the card is seamless.
|
|
355
|
+
*/
|
|
356
|
+
keepOpen(): void;
|
|
357
|
+
/** Open the card immediately, anchored to `trigger`. */
|
|
358
|
+
open(trigger: HTMLElement): void;
|
|
359
|
+
/** Close the card immediately. */
|
|
360
|
+
close(): void;
|
|
361
|
+
protected onCardEnter(): void;
|
|
362
|
+
protected onCardLeave(): void;
|
|
363
|
+
/**
|
|
364
|
+
* Keyboard mirror of `mouseleave`: when focus moves somewhere outside BOTH
|
|
365
|
+
* the card and its trigger, schedule a close. Focus hopping between the
|
|
366
|
+
* trigger and the card (either direction) keeps it open, so the card's
|
|
367
|
+
* content stays reachable with Tab.
|
|
368
|
+
*/
|
|
369
|
+
protected onCardFocusout(event: FocusEvent): void;
|
|
370
|
+
protected onEscape(event: Event): void;
|
|
371
|
+
private setTimer;
|
|
372
|
+
private clearOpenTimer;
|
|
373
|
+
private clearCloseTimer;
|
|
374
|
+
ngOnDestroy(): void;
|
|
375
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkHovercard, never>;
|
|
376
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkHovercard, "mk-hovercard", ["mkHovercard"], { "placement": { "alias": "placement"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "openDelay": { "alias": "openDelay"; "required": false; "isSignal": true; }; "closeDelay": { "alias": "closeDelay"; "required": false; "isSignal": true; }; "closeOnEscape": { "alias": "closeOnEscape"; "required": false; "isSignal": true; }; }, { "closed": "closed"; }, never, ["*"], true, never>;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Turns its host element into a hover/focus trigger for an `<mk-hovercard>`.
|
|
381
|
+
* On `mouseenter`/`focus` it opens the card (after the card's `openDelay`),
|
|
382
|
+
* anchored to the host; on `mouseleave`/`blur` it schedules a close (after the
|
|
383
|
+
* card's `closeDelay`). Moving the pointer — or keyboard focus — from the host
|
|
384
|
+
* onto the card cancels that close, so the card stays open and its content is
|
|
385
|
+
* reachable with Tab. Escape closes it.
|
|
386
|
+
*
|
|
387
|
+
* On touch there is no hover, so a tap toggles instead: tap opens the card
|
|
388
|
+
* immediately, tapping the trigger again closes it, and a tap anywhere else
|
|
389
|
+
* closes it through the panel's outside-pointerdown dismissal.
|
|
390
|
+
*
|
|
391
|
+
* ```html
|
|
392
|
+
* <a href="/u/ada" [mkHovercardFor]="ada">@ada</a>
|
|
393
|
+
* <mk-hovercard #ada>…</mk-hovercard>
|
|
394
|
+
* ```
|
|
395
|
+
*/
|
|
396
|
+
declare class MkHovercardTrigger {
|
|
397
|
+
private readonly host;
|
|
398
|
+
/** Timestamp of the last touch toggle — guards `onEnter` (see above). */
|
|
399
|
+
private lastTouchToggle;
|
|
400
|
+
/** The hovercard instance to control. */
|
|
401
|
+
readonly hovercard: _angular_core.InputSignal<MkHovercard>;
|
|
402
|
+
protected onEnter(): void;
|
|
403
|
+
/**
|
|
404
|
+
* Touch tap-toggle. Mouse and pen are ignored here — they keep the pure
|
|
405
|
+
* hover/focus behaviour. A tap while the card is open closes it (a tap
|
|
406
|
+
* OUTSIDE both trigger and panel is handled by the anchored panel's own
|
|
407
|
+
* outside-pointerdown dismiss, which excludes the anchor, so the two paths
|
|
408
|
+
* never double-fire).
|
|
409
|
+
*/
|
|
410
|
+
protected onPointerDown(event: PointerEvent): void;
|
|
411
|
+
protected onLeave(): void;
|
|
412
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
413
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkHovercardTrigger, never>;
|
|
414
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<MkHovercardTrigger, "[mkHovercardFor]", ["mkHovercardTrigger"], { "hovercard": { "alias": "mkHovercardFor"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
/** A single notification shown in the {@link MkNotificationCenter} panel. */
|
|
418
|
+
interface MkNotification {
|
|
419
|
+
/** Stable identity, used for `track` and immutable updates. */
|
|
420
|
+
id: unknown;
|
|
421
|
+
/** Headline line, always shown. */
|
|
422
|
+
title: string;
|
|
423
|
+
/** Optional supporting text under the title. */
|
|
424
|
+
body?: string;
|
|
425
|
+
/** Optional relative/absolute timestamp label (e.g. "2m ago"). */
|
|
426
|
+
time?: string;
|
|
427
|
+
/** Whether the user has already read this item. */
|
|
428
|
+
read?: boolean;
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* NotificationCenter — a bell trigger with an unread-count badge that opens a
|
|
432
|
+
* dropdown panel listing notifications, each markable as read.
|
|
433
|
+
*
|
|
434
|
+
* The panel renders in the browser top layer through {@link MkAnchoredPanel},
|
|
435
|
+
* so it is never clipped by an ancestor's `overflow`/`transform`. Clicking the
|
|
436
|
+
* bell toggles it; an outside click, Tabbing out or Escape closes it and
|
|
437
|
+
* restores focus to the bell. Clicking a row marks that one read (updating the
|
|
438
|
+
* two-way `notifications` immutably); "Mark all read" clears every unread item.
|
|
439
|
+
*
|
|
440
|
+
* ```html
|
|
441
|
+
* <mk-notification-center
|
|
442
|
+
* [(notifications)]="items"
|
|
443
|
+
* (itemClick)="open($event)"
|
|
444
|
+
* (markedAllRead)="sync()" />
|
|
445
|
+
* ```
|
|
446
|
+
*/
|
|
447
|
+
declare class MkNotificationCenter {
|
|
448
|
+
private readonly injector;
|
|
449
|
+
private readonly isBrowser;
|
|
450
|
+
private readonly panelRef;
|
|
451
|
+
private readonly triggerRef;
|
|
452
|
+
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
453
|
+
/** Stable id linking the trigger to the panel via `aria-controls`. */
|
|
454
|
+
readonly panelId: string;
|
|
455
|
+
/** Stable id for the panel's labelling heading. */
|
|
456
|
+
readonly titleId: string;
|
|
457
|
+
/** Two-way list of notifications rendered in the panel. */
|
|
458
|
+
readonly notifications: _angular_core.ModelSignal<MkNotification[]>;
|
|
459
|
+
/** Heading shown at the top of the panel. */
|
|
460
|
+
readonly panelTitle: _angular_core.InputSignal<string>;
|
|
461
|
+
/** Message shown by the empty state when there are no notifications. */
|
|
462
|
+
readonly emptyText: _angular_core.InputSignal<string>;
|
|
463
|
+
/** Max height of the scrollable list (any CSS length). */
|
|
464
|
+
readonly maxHeight: _angular_core.InputSignal<string>;
|
|
465
|
+
/** Emitted with a notification when its row is clicked. */
|
|
466
|
+
readonly itemClick: _angular_core.OutputEmitterRef<MkNotification>;
|
|
467
|
+
/** Emitted with a notification when it transitions to read. */
|
|
468
|
+
readonly read: _angular_core.OutputEmitterRef<MkNotification>;
|
|
469
|
+
/** Emitted when every notification is marked read at once. */
|
|
470
|
+
readonly markedAllRead: _angular_core.OutputEmitterRef<void>;
|
|
471
|
+
private readonly _open;
|
|
472
|
+
/** Whether the panel is open. */
|
|
473
|
+
readonly open: _angular_core.Signal<boolean>;
|
|
474
|
+
/** Count of notifications that are not yet read. */
|
|
475
|
+
readonly unreadCount: _angular_core.Signal<number>;
|
|
476
|
+
/** Accessible label for the bell trigger. */
|
|
477
|
+
protected readonly triggerLabel: _angular_core.Signal<string>;
|
|
478
|
+
/** Badge text, capped at "99+". */
|
|
479
|
+
protected readonly badgeText: _angular_core.Signal<string>;
|
|
480
|
+
/** Toggle the panel open/closed. */
|
|
481
|
+
toggle(): void;
|
|
482
|
+
/** Open the panel, moving focus into it on the next render. */
|
|
483
|
+
openPanel(): void;
|
|
484
|
+
/** Close the panel; optionally restore focus to the bell trigger. */
|
|
485
|
+
close(restoreFocus?: boolean): void;
|
|
486
|
+
/** Mark every notification read and emit {@link markedAllRead}. */
|
|
487
|
+
markAllRead(): void;
|
|
488
|
+
/** Handle a row click: mark it read (if needed) and emit {@link itemClick}. */
|
|
489
|
+
protected onRowClick(item: MkNotification): void;
|
|
490
|
+
private markRead;
|
|
491
|
+
protected onEscape(event: Event): void;
|
|
492
|
+
protected onPanelFocusout(event: FocusEvent): void;
|
|
493
|
+
private focusInitial;
|
|
494
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkNotificationCenter, never>;
|
|
495
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkNotificationCenter, "mk-notification-center", never, { "notifications": { "alias": "notifications"; "required": false; "isSignal": true; }; "panelTitle": { "alias": "panelTitle"; "required": false; "isSignal": true; }; "emptyText": { "alias": "emptyText"; "required": false; "isSignal": true; }; "maxHeight": { "alias": "maxHeight"; "required": false; "isSignal": true; }; }, { "notifications": "notificationsChange"; "itemClick": "itemClick"; "read": "read"; "markedAllRead": "markedAllRead"; }, never, never, true, never>;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
/**
|
|
499
|
+
* Accessible heading for a dialog. Renders as a level-2 heading and exposes a
|
|
500
|
+
* stable id that {@link MkDialog} wires to the panel's `aria-labelledby`.
|
|
501
|
+
*
|
|
502
|
+
* ```html
|
|
503
|
+
* <mk-dialog>
|
|
504
|
+
* <mk-dialog-title>Delete workspace</mk-dialog-title>
|
|
505
|
+
* …
|
|
506
|
+
* </mk-dialog>
|
|
507
|
+
* ```
|
|
508
|
+
*/
|
|
509
|
+
declare class MkDialogTitle {
|
|
510
|
+
/** Stable id used for `aria-labelledby` wiring. */
|
|
511
|
+
readonly id: _angular_core.InputSignal<string>;
|
|
512
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkDialogTitle, never>;
|
|
513
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkDialogTitle, "mk-dialog-title", never, { "id": { "alias": "id"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
514
|
+
}
|
|
515
|
+
/**
|
|
516
|
+
* Dialog layout — a surface with a sticky header, scrollable body, and sticky
|
|
517
|
+
* footer, designed to be rendered inside an {@link MkOverlayService} panel. The
|
|
518
|
+
* header exposes a close button wired to the injected {@link MkOverlayRef} and
|
|
519
|
+
* the dialog's title is linked to the panel via `aria-labelledby`.
|
|
520
|
+
*
|
|
521
|
+
* Slots: `[mkDialogHeader]` / `<mk-dialog-title>` (header), default content
|
|
522
|
+
* (body), `[mkDialogFooter]` (footer).
|
|
523
|
+
*
|
|
524
|
+
* ```html
|
|
525
|
+
* <mk-dialog>
|
|
526
|
+
* <mk-dialog-title>Rename</mk-dialog-title>
|
|
527
|
+
* <p>Choose a new name.</p>
|
|
528
|
+
* <div mkDialogFooter>
|
|
529
|
+
* <button mkButton variant="ghost">Cancel</button>
|
|
530
|
+
* <button mkButton>Save</button>
|
|
531
|
+
* </div>
|
|
532
|
+
* </mk-dialog>
|
|
533
|
+
* ```
|
|
534
|
+
*/
|
|
535
|
+
declare class MkDialog {
|
|
536
|
+
private readonly host;
|
|
537
|
+
/** Localised strings (override globally via `provideMkI18n`). */
|
|
538
|
+
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
539
|
+
private readonly overlayRef;
|
|
540
|
+
/** Optional plain-text title. Ignored when a `<mk-dialog-title>` is projected. */
|
|
541
|
+
readonly dialogTitle: _angular_core.InputSignal<string | undefined>;
|
|
542
|
+
/** Stable id for the built-in title element. */
|
|
543
|
+
readonly titleId: _angular_core.InputSignal<string>;
|
|
544
|
+
/** Hide the header close button. */
|
|
545
|
+
readonly hideClose: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
546
|
+
constructor();
|
|
547
|
+
/** Close the surrounding overlay, if any. */
|
|
548
|
+
protected close(): void;
|
|
549
|
+
/** Point the owning dialog panel's `aria-labelledby` at the title element. */
|
|
550
|
+
private wireLabelledBy;
|
|
551
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkDialog, never>;
|
|
552
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkDialog, "mk-dialog", never, { "dialogTitle": { "alias": "dialogTitle"; "required": false; "isSignal": true; }; "titleId": { "alias": "titleId"; "required": false; "isSignal": true; }; "hideClose": { "alias": "hideClose"; "required": false; "isSignal": true; }; }, {}, never, ["[mkDialogHeader], mk-dialog-title", "*", "[mkDialogFooter]"], true, never>;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
/** Data contract for {@link MkConfirmDialog} / `MkDialogService.confirm`. */
|
|
556
|
+
interface MkConfirmDialogData {
|
|
557
|
+
/** Heading text. */
|
|
558
|
+
title: string;
|
|
559
|
+
/** Body message. */
|
|
560
|
+
message: string;
|
|
561
|
+
/** Confirm button label. Default `Confirm`. */
|
|
562
|
+
confirmText?: string;
|
|
563
|
+
/** Cancel button label. Default `Cancel`. */
|
|
564
|
+
cancelText?: string;
|
|
565
|
+
/** Tone of the confirm button (and `alertdialog` semantics when `danger`). */
|
|
566
|
+
tone?: 'primary' | 'danger' | 'warning' | 'success';
|
|
567
|
+
/**
|
|
568
|
+
* Optional registered icon name shown beside the message. Useful when the
|
|
569
|
+
* action is destructive and the wording alone carries no visual weight
|
|
570
|
+
* (`trash`, `alert-triangle`, `user-x`).
|
|
571
|
+
*/
|
|
572
|
+
icon?: string;
|
|
573
|
+
/** Hide the cancel button — a single-button acknowledgement (`alert`). */
|
|
574
|
+
hideCancel?: boolean;
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* Internal component backing `MkDialogService.confirm`. Renders a title,
|
|
578
|
+
* message, and cancel/confirm buttons. Resolves the overlay ref with `true`
|
|
579
|
+
* on confirm and `false` on cancel. Uses `alertdialog` semantics for the
|
|
580
|
+
* `danger` tone (set on the panel by the service).
|
|
581
|
+
*/
|
|
582
|
+
declare class MkConfirmDialog {
|
|
583
|
+
private readonly ref;
|
|
584
|
+
protected readonly data: MkConfirmDialogData;
|
|
585
|
+
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
586
|
+
protected readonly confirmTone: _angular_core.Signal<"success" | "warning" | "danger" | "primary">;
|
|
587
|
+
protected readonly confirmText: _angular_core.Signal<string>;
|
|
588
|
+
protected readonly cancelText: _angular_core.Signal<string>;
|
|
589
|
+
protected confirm(): void;
|
|
590
|
+
protected cancel(): void;
|
|
591
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkConfirmDialog, never>;
|
|
592
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkConfirmDialog, "mk-confirm-dialog", never, {}, {}, never, never, true, never>;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
/** Data contract for {@link MkPromptDialog} / `MkDialogService.prompt`. */
|
|
596
|
+
interface MkPromptDialogData {
|
|
597
|
+
/** Heading text. */
|
|
598
|
+
title: string;
|
|
599
|
+
/** Optional body message shown above the input. */
|
|
600
|
+
message?: string;
|
|
601
|
+
/** Field label. */
|
|
602
|
+
label?: string;
|
|
603
|
+
/** Pre-filled value. */
|
|
604
|
+
value?: string;
|
|
605
|
+
/** Input placeholder. */
|
|
606
|
+
placeholder?: string;
|
|
607
|
+
/** Confirm button label. Default `OK`. */
|
|
608
|
+
confirmText?: string;
|
|
609
|
+
/** Cancel button label. Default `Cancel`. */
|
|
610
|
+
cancelText?: string;
|
|
611
|
+
/** Require a non-empty value before the confirm button enables. */
|
|
612
|
+
required?: boolean;
|
|
613
|
+
/** Native input type (e.g. `text`, `email`, `number`, `password`). */
|
|
614
|
+
inputType?: string;
|
|
615
|
+
}
|
|
616
|
+
/**
|
|
617
|
+
* Internal component backing `MkDialogService.prompt`. Renders a single text
|
|
618
|
+
* field and resolves the overlay ref with the entered string on confirm, or
|
|
619
|
+
* `null` on cancel / Escape / backdrop. Submitting the form (Enter) confirms.
|
|
620
|
+
*/
|
|
621
|
+
declare class MkPromptDialog {
|
|
622
|
+
private readonly ref;
|
|
623
|
+
protected readonly data: MkPromptDialogData;
|
|
624
|
+
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
625
|
+
private readonly inputRef;
|
|
626
|
+
protected readonly value: _angular_core.WritableSignal<string>;
|
|
627
|
+
protected readonly confirmText: _angular_core.Signal<string>;
|
|
628
|
+
protected readonly cancelText: _angular_core.Signal<string>;
|
|
629
|
+
protected readonly canConfirm: _angular_core.Signal<boolean>;
|
|
630
|
+
constructor();
|
|
631
|
+
protected onInput(event: Event): void;
|
|
632
|
+
protected submit(): void;
|
|
633
|
+
protected cancel(): void;
|
|
634
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkPromptDialog, never>;
|
|
635
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkPromptDialog, "mk-prompt-dialog", never, {}, {}, never, never, true, never>;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* Panel width preset. The panel is always `min(target, 92vw)`, so it shrinks to
|
|
640
|
+
* fit a phone and grows to its target on a desktop.
|
|
641
|
+
*
|
|
642
|
+
* - `sm` (32rem) — the default; confirmations, single-field prompts
|
|
643
|
+
* - `md` (45rem) — two-column forms
|
|
644
|
+
* - `lg` (56rem) — forms with nested sections
|
|
645
|
+
* - `xl` (75rem) — tables or side-by-side content inside a modal
|
|
646
|
+
*/
|
|
647
|
+
type MkDialogSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
648
|
+
/** Configuration for `MkDialogService.open`. Extends the raw overlay config. */
|
|
649
|
+
interface MkDialogConfig<TData = unknown> extends MkOverlayConfig<TData> {
|
|
650
|
+
/** Panel width preset. Defaults to `sm`, matching pre-0.9 behaviour. */
|
|
651
|
+
size?: MkDialogSize;
|
|
652
|
+
}
|
|
653
|
+
/**
|
|
654
|
+
* Dialog service — a thin, opinionated layer over {@link MkOverlayService} that
|
|
655
|
+
* renders content on a themed `--mk-surface` panel (shadow, radius, entrance
|
|
656
|
+
* animation) and adds a `confirm()` convenience.
|
|
657
|
+
*
|
|
658
|
+
* ```ts
|
|
659
|
+
* const ref = dialog.open(EditUserDialog, { data: user });
|
|
660
|
+
* const saved = await ref.afterClosed;
|
|
661
|
+
*
|
|
662
|
+
* if (await dialog.confirm({ title: 'Delete?', message: 'This cannot be undone.', tone: 'danger' })) {
|
|
663
|
+
* remove();
|
|
664
|
+
* }
|
|
665
|
+
* ```
|
|
666
|
+
*/
|
|
667
|
+
declare class MkDialogService {
|
|
668
|
+
private readonly overlay;
|
|
669
|
+
private readonly i18n;
|
|
670
|
+
/** Open `component` inside a themed dialog panel. */
|
|
671
|
+
open<TComponent, TResult = unknown, TData = unknown>(component: Type<TComponent>, config?: MkDialogConfig<TData>): MkOverlayRef<TResult, TComponent>;
|
|
672
|
+
/**
|
|
673
|
+
* Open a confirmation dialog. Resolves `true` if confirmed, `false` if the
|
|
674
|
+
* user cancels, presses Escape, or clicks the backdrop.
|
|
675
|
+
*/
|
|
676
|
+
confirm(data: MkConfirmDialogData): Promise<boolean>;
|
|
677
|
+
/**
|
|
678
|
+
* Open a single-button acknowledgement dialog. Resolves when the user
|
|
679
|
+
* dismisses it (button, Escape, or backdrop).
|
|
680
|
+
*/
|
|
681
|
+
alert(data: Omit<MkConfirmDialogData, 'hideCancel' | 'cancelText'>): Promise<void>;
|
|
682
|
+
/**
|
|
683
|
+
* Open a single-field prompt dialog. Resolves with the entered string, or
|
|
684
|
+
* `null` if the user cancels, presses Escape, or clicks the backdrop.
|
|
685
|
+
*/
|
|
686
|
+
prompt(data: MkPromptDialogData): Promise<string | null>;
|
|
687
|
+
private mergePanelClass;
|
|
688
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkDialogService, never>;
|
|
689
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<MkDialogService>;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
/** Semantic tones supported by toasts. */
|
|
693
|
+
type MkToastTone = 'info' | 'success' | 'warning' | 'danger' | 'neutral';
|
|
694
|
+
/** An optional action button rendered inside a toast. */
|
|
695
|
+
interface MkToastAction {
|
|
696
|
+
/** Button label. */
|
|
697
|
+
label: string;
|
|
698
|
+
/** Invoked when the action is activated. The toast is dismissed afterwards. */
|
|
699
|
+
handler?: () => void;
|
|
700
|
+
}
|
|
701
|
+
/** Options accepted by {@link MkToastService.show}. */
|
|
702
|
+
interface MkToastConfig {
|
|
703
|
+
/** Optional bold heading. */
|
|
704
|
+
title?: string;
|
|
705
|
+
/** Body message (required). */
|
|
706
|
+
message: string;
|
|
707
|
+
/** Semantic tone. Default `info`. */
|
|
708
|
+
tone?: MkToastTone;
|
|
709
|
+
/** Auto-dismiss delay in ms. `0` keeps the toast until dismissed. Default `5000`. */
|
|
710
|
+
duration?: number;
|
|
711
|
+
/** Show a close button. Default `true`. */
|
|
712
|
+
dismissible?: boolean;
|
|
713
|
+
/** Optional action button. */
|
|
714
|
+
action?: MkToastAction;
|
|
715
|
+
}
|
|
716
|
+
/** A live toast rendered by the container. */
|
|
717
|
+
interface MkToastItem {
|
|
718
|
+
readonly id: number;
|
|
719
|
+
readonly title?: string;
|
|
720
|
+
readonly message: string;
|
|
721
|
+
readonly tone: MkToastTone;
|
|
722
|
+
readonly duration: number;
|
|
723
|
+
readonly dismissible: boolean;
|
|
724
|
+
readonly action?: MkToastAction;
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* Toast service — enqueues transient notifications rendered by a single,
|
|
728
|
+
* lazily-mounted {@link MkToastContainer} at the bottom-right of the viewport.
|
|
729
|
+
* Each rendered toast is itself a live region (`role="alert"` for `danger`,
|
|
730
|
+
* else `role="status"`), so assistive tech announces it exactly once. Toasts
|
|
731
|
+
* auto-dismiss after `duration` ms unless it is `0`.
|
|
732
|
+
*
|
|
733
|
+
* ```ts
|
|
734
|
+
* toasts.success('Saved');
|
|
735
|
+
* toasts.show({ title: 'Upload failed', message: 'Retry?', tone: 'danger',
|
|
736
|
+
* duration: 0, action: { label: 'Retry', handler: () => retry() } });
|
|
737
|
+
* ```
|
|
738
|
+
*/
|
|
739
|
+
declare class MkToastService {
|
|
740
|
+
private readonly appRef;
|
|
741
|
+
private readonly envInjector;
|
|
742
|
+
private readonly document;
|
|
743
|
+
private readonly isBrowser;
|
|
744
|
+
private readonly _toasts;
|
|
745
|
+
/** Reactive list of currently visible toasts. */
|
|
746
|
+
readonly toasts: _angular_core.Signal<readonly MkToastItem[]>;
|
|
747
|
+
private readonly timers;
|
|
748
|
+
private containerRef?;
|
|
749
|
+
/** Show a toast, returning its id (usable with {@link dismiss}). */
|
|
750
|
+
show(config: MkToastConfig): number;
|
|
751
|
+
/** Show an `info` toast. */
|
|
752
|
+
info(message: string, config?: Partial<MkToastConfig>): number;
|
|
753
|
+
/** Show a `success` toast. */
|
|
754
|
+
success(message: string, config?: Partial<MkToastConfig>): number;
|
|
755
|
+
/** Show a `warning` toast. */
|
|
756
|
+
warning(message: string, config?: Partial<MkToastConfig>): number;
|
|
757
|
+
/** Show a `danger` toast. */
|
|
758
|
+
danger(message: string, config?: Partial<MkToastConfig>): number;
|
|
759
|
+
/** Show a `neutral` toast. */
|
|
760
|
+
neutral(message: string, config?: Partial<MkToastConfig>): number;
|
|
761
|
+
/** Dismiss a toast by id. */
|
|
762
|
+
dismiss(id: number): void;
|
|
763
|
+
/** Dismiss every visible toast. */
|
|
764
|
+
clear(): void;
|
|
765
|
+
/** Run a toast action, then dismiss it. */
|
|
766
|
+
runAction(item: MkToastItem): void;
|
|
767
|
+
/** Pause a toast's auto-dismiss countdown (e.g. on hover/focus). */
|
|
768
|
+
pause(id: number): void;
|
|
769
|
+
/** Resume a paused countdown. */
|
|
770
|
+
resume(id: number): void;
|
|
771
|
+
private startTimer;
|
|
772
|
+
private clearTimer;
|
|
773
|
+
private ensureContainer;
|
|
774
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkToastService, never>;
|
|
775
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<MkToastService>;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
/**
|
|
779
|
+
* A single toast card. Internal to the toast system — rendered by
|
|
780
|
+
* {@link MkToastContainer}. Displays a tone accent, optional title, message,
|
|
781
|
+
* optional action button, and (when dismissible) a close button. Auto-dismiss
|
|
782
|
+
* pauses while the toast is hovered or focused.
|
|
783
|
+
*/
|
|
784
|
+
declare class MkToast {
|
|
785
|
+
private readonly service;
|
|
786
|
+
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
787
|
+
/** The toast model to render. */
|
|
788
|
+
readonly item: _angular_core.InputSignal<MkToastItem>;
|
|
789
|
+
/** Assertive alert for danger, polite status otherwise. */
|
|
790
|
+
protected readonly role: _angular_core.Signal<"alert" | "status">;
|
|
791
|
+
protected dismiss(): void;
|
|
792
|
+
protected runAction(): void;
|
|
793
|
+
protected pause(): void;
|
|
794
|
+
protected resume(): void;
|
|
795
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkToast, never>;
|
|
796
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkToast, "mk-toast", never, { "item": { "alias": "item"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
/**
|
|
800
|
+
* Fixed, bottom-right stack that renders the active toasts from
|
|
801
|
+
* {@link MkToastService}. Mounted once, lazily, into `document.body` by the
|
|
802
|
+
* service — not intended for direct template use.
|
|
803
|
+
*/
|
|
804
|
+
declare class MkToastContainer {
|
|
805
|
+
private readonly service;
|
|
806
|
+
/** Live list of toasts to render. */
|
|
807
|
+
protected readonly toasts: _angular_core.Signal<readonly _mk_kit_ui_feedback.MkToastItem[]>;
|
|
808
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkToastContainer, never>;
|
|
809
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkToastContainer, "mk-toast-container", never, {}, {}, never, never, true, never>;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
/** Semantic tone of a snackbar. `neutral` is the default dark bar. */
|
|
813
|
+
type MkSnackbarTone = 'neutral' | 'info' | 'success' | 'warning' | 'danger';
|
|
814
|
+
/** Why a snackbar closed. */
|
|
815
|
+
type MkSnackbarDismissReason = 'action' | 'timeout' | 'dismiss';
|
|
816
|
+
/** Options for {@link MkSnackbarService.open}. */
|
|
817
|
+
interface MkSnackbarConfig {
|
|
818
|
+
/** Semantic tone. Default `neutral`. */
|
|
819
|
+
tone?: MkSnackbarTone;
|
|
820
|
+
/** Auto-dismiss delay in ms. `0` keeps it open until dismissed. Default `5000`. */
|
|
821
|
+
duration?: number;
|
|
822
|
+
/** Show a close (×) button. Default `false` (dismiss via action/timeout). */
|
|
823
|
+
dismissible?: boolean;
|
|
824
|
+
/**
|
|
825
|
+
* @deprecated The snackbar element is itself the live region — its
|
|
826
|
+
* politeness is derived from `tone` (`alert` for danger/warning, else
|
|
827
|
+
* `status`). This option is ignored.
|
|
828
|
+
*/
|
|
829
|
+
politeness?: 'polite' | 'assertive';
|
|
830
|
+
}
|
|
831
|
+
/** The live snackbar model rendered by the container. */
|
|
832
|
+
interface MkSnackbarItem {
|
|
833
|
+
readonly id: number;
|
|
834
|
+
readonly message: string;
|
|
835
|
+
readonly actionLabel?: string;
|
|
836
|
+
readonly tone: MkSnackbarTone;
|
|
837
|
+
readonly dismissible: boolean;
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* Handle to an opened snackbar. Await {@link onAction} to react to the action
|
|
841
|
+
* button, or {@link afterDismissed} to run code once it closes.
|
|
842
|
+
*/
|
|
843
|
+
declare class MkSnackbarRef {
|
|
844
|
+
/** Unique id of the snackbar this ref controls. */
|
|
845
|
+
readonly id: number;
|
|
846
|
+
private readonly service;
|
|
847
|
+
private actionResolve;
|
|
848
|
+
private dismissResolve;
|
|
849
|
+
private readonly actionPromise;
|
|
850
|
+
private readonly dismissPromise;
|
|
851
|
+
constructor(
|
|
852
|
+
/** Unique id of the snackbar this ref controls. */
|
|
853
|
+
id: number, service: MkSnackbarService);
|
|
854
|
+
/** Dismiss the snackbar programmatically. */
|
|
855
|
+
dismiss(): void;
|
|
856
|
+
/** Resolves when the action button is activated. */
|
|
857
|
+
onAction(): Promise<void>;
|
|
858
|
+
/** Resolves when the snackbar has closed, with the reason it closed. */
|
|
859
|
+
afterDismissed(): Promise<MkSnackbarDismissReason>;
|
|
860
|
+
/** @internal */
|
|
861
|
+
_notifyAction(): void;
|
|
862
|
+
/** @internal */
|
|
863
|
+
_notifyDismissed(reason: MkSnackbarDismissReason): void;
|
|
864
|
+
}
|
|
865
|
+
/**
|
|
866
|
+
* Snackbar service — shows a single, brief message at the bottom-centre of the
|
|
867
|
+
* viewport with an optional action button, following the Material snackbar
|
|
868
|
+
* model: only one is visible at a time, and opening a new one replaces the
|
|
869
|
+
* current. For stacked, persistent notifications use `MkToastService` instead.
|
|
870
|
+
*
|
|
871
|
+
* ```ts
|
|
872
|
+
* const ref = snackbar.open('Message archived', 'Undo');
|
|
873
|
+
* ref.onAction().then(() => restore());
|
|
874
|
+
*
|
|
875
|
+
* snackbar.open('Changes saved', undefined, { tone: 'success' });
|
|
876
|
+
* ```
|
|
877
|
+
*/
|
|
878
|
+
declare class MkSnackbarService {
|
|
879
|
+
private readonly appRef;
|
|
880
|
+
private readonly envInjector;
|
|
881
|
+
private readonly document;
|
|
882
|
+
private readonly isBrowser;
|
|
883
|
+
private readonly _active;
|
|
884
|
+
/** The currently visible snackbar, or `null`. */
|
|
885
|
+
readonly active: _angular_core.Signal<MkSnackbarItem | null>;
|
|
886
|
+
private readonly refs;
|
|
887
|
+
private timer?;
|
|
888
|
+
private remaining;
|
|
889
|
+
private startedAt;
|
|
890
|
+
private containerRef?;
|
|
891
|
+
/**
|
|
892
|
+
* Open a snackbar. `action` is the (optional) button label — react to it via
|
|
893
|
+
* the returned ref's {@link MkSnackbarRef.onAction}.
|
|
894
|
+
*/
|
|
895
|
+
open(message: string, action?: string, config?: MkSnackbarConfig): MkSnackbarRef;
|
|
896
|
+
/** Dismiss the snackbar with the given id (if it is the active one). */
|
|
897
|
+
dismiss(id: number): void;
|
|
898
|
+
/** Run the action for the active snackbar, then close it. */
|
|
899
|
+
runAction(id: number): void;
|
|
900
|
+
/** Pause the auto-dismiss countdown (e.g. on hover/focus). */
|
|
901
|
+
pause(): void;
|
|
902
|
+
/** Resume a paused countdown. */
|
|
903
|
+
resume(): void;
|
|
904
|
+
private close;
|
|
905
|
+
private startTimer;
|
|
906
|
+
private clearTimer;
|
|
907
|
+
private ensureContainer;
|
|
908
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkSnackbarService, never>;
|
|
909
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<MkSnackbarService>;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
/**
|
|
913
|
+
* The visual snackbar bar. Internal to the snackbar system — rendered by
|
|
914
|
+
* {@link MkSnackbarContainer}. Shows a message, an optional action button and
|
|
915
|
+
* (when `dismissible`) a close button. Auto-dismiss pauses on hover/focus.
|
|
916
|
+
*/
|
|
917
|
+
declare class MkSnackbar {
|
|
918
|
+
private readonly service;
|
|
919
|
+
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
920
|
+
/** The snackbar model to render. */
|
|
921
|
+
readonly item: _angular_core.InputSignal<MkSnackbarItem>;
|
|
922
|
+
/** Assertive alert for danger/warning, polite status otherwise. */
|
|
923
|
+
protected readonly role: _angular_core.Signal<"alert" | "status">;
|
|
924
|
+
protected runAction(): void;
|
|
925
|
+
protected dismiss(): void;
|
|
926
|
+
protected pause(): void;
|
|
927
|
+
protected resume(): void;
|
|
928
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkSnackbar, never>;
|
|
929
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkSnackbar, "mk-snackbar", never, { "item": { "alias": "item"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
/**
|
|
933
|
+
* Fixed, bottom-centre host that renders the single active snackbar from
|
|
934
|
+
* {@link MkSnackbarService}. Mounted once, lazily, into `document.body` by the
|
|
935
|
+
* service — not intended for direct template use.
|
|
936
|
+
*/
|
|
937
|
+
declare class MkSnackbarContainer {
|
|
938
|
+
private readonly service;
|
|
939
|
+
/** The active snackbar to render, or `null`. */
|
|
940
|
+
protected readonly active: _angular_core.Signal<_mk_kit_ui_feedback.MkSnackbarItem | null>;
|
|
941
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkSnackbarContainer, never>;
|
|
942
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkSnackbarContainer, "mk-snackbar-container", never, {}, {}, never, never, true, never>;
|
|
943
|
+
}
|
|
944
|
+
|
|
945
|
+
/**
|
|
946
|
+
* BottomSheet layout — the surface rendered inside an {@link MkOverlayService}
|
|
947
|
+
* panel by {@link MkBottomSheetService}. Provides a drag handle (swipe down to
|
|
948
|
+
* dismiss), an optional titled header with a close button, and a scrollable
|
|
949
|
+
* body for projected content.
|
|
950
|
+
*
|
|
951
|
+
* Slots: `[mkBottomSheetHeader]` (extra header content), default content
|
|
952
|
+
* (body), `[mkBottomSheetFooter]` (sticky footer).
|
|
953
|
+
*
|
|
954
|
+
* ```html
|
|
955
|
+
* <mk-bottom-sheet sheetTitle="Share">
|
|
956
|
+
* <button mkButton fullWidth variant="ghost">Copy link</button>
|
|
957
|
+
* <button mkButton fullWidth variant="ghost">Email</button>
|
|
958
|
+
* </mk-bottom-sheet>
|
|
959
|
+
* ```
|
|
960
|
+
*/
|
|
961
|
+
declare class MkBottomSheet {
|
|
962
|
+
private readonly host;
|
|
963
|
+
/** Localised strings (override globally via `provideMkI18n`). */
|
|
964
|
+
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
965
|
+
private readonly overlayRef;
|
|
966
|
+
/** Optional plain-text title rendered in the header. */
|
|
967
|
+
readonly sheetTitle: _angular_core.InputSignal<string | undefined>;
|
|
968
|
+
/** Stable id for the built-in title element. */
|
|
969
|
+
readonly titleId: _angular_core.InputSignal<string>;
|
|
970
|
+
/** Hide the drag handle (also disables swipe-to-dismiss). */
|
|
971
|
+
readonly hideHandle: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
972
|
+
/** Hide the header close button. */
|
|
973
|
+
readonly hideClose: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
974
|
+
private panel;
|
|
975
|
+
private dragging;
|
|
976
|
+
private startY;
|
|
977
|
+
constructor();
|
|
978
|
+
/** Close the surrounding overlay, if any. */
|
|
979
|
+
protected close(): void;
|
|
980
|
+
protected onHandlePointerDown(event: PointerEvent): void;
|
|
981
|
+
protected onHandlePointerMove(event: PointerEvent): void;
|
|
982
|
+
protected onHandlePointerUp(event: PointerEvent): void;
|
|
983
|
+
/** Point the owning panel's `aria-labelledby` at the title element. */
|
|
984
|
+
private wireLabelledBy;
|
|
985
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkBottomSheet, never>;
|
|
986
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkBottomSheet, "mk-bottom-sheet", never, { "sheetTitle": { "alias": "sheetTitle"; "required": false; "isSignal": true; }; "titleId": { "alias": "titleId"; "required": false; "isSignal": true; }; "hideHandle": { "alias": "hideHandle"; "required": false; "isSignal": true; }; "hideClose": { "alias": "hideClose"; "required": false; "isSignal": true; }; }, {}, never, ["[mkBottomSheetHeader]", "*", "[mkBottomSheetFooter]"], true, never>;
|
|
987
|
+
}
|
|
988
|
+
|
|
989
|
+
/** Configuration for `MkBottomSheetService.open`. Extends the overlay config. */
|
|
990
|
+
interface MkBottomSheetConfig<TData = unknown> extends MkOverlayConfig<TData> {
|
|
991
|
+
}
|
|
992
|
+
/**
|
|
993
|
+
* BottomSheet service — a thin layer over {@link MkOverlayService} that renders
|
|
994
|
+
* a component in a panel anchored to the bottom edge of the viewport: full
|
|
995
|
+
* width on small screens, a centred card capped at ~42rem on large ones. It
|
|
996
|
+
* slides up on open and can be swiped down to dismiss (via {@link MkBottomSheet}).
|
|
997
|
+
*
|
|
998
|
+
* Use it for contextual actions, pickers and mobile-style menus. For a centred
|
|
999
|
+
* modal use `MkDialogService` instead.
|
|
1000
|
+
*
|
|
1001
|
+
* ```ts
|
|
1002
|
+
* const ref = bottomSheet.open(ShareSheet, { data: { url } });
|
|
1003
|
+
* const choice = await ref.afterClosed;
|
|
1004
|
+
* ```
|
|
1005
|
+
*/
|
|
1006
|
+
declare class MkBottomSheetService {
|
|
1007
|
+
private readonly overlay;
|
|
1008
|
+
/** Open `component` inside a bottom-anchored sheet panel. */
|
|
1009
|
+
open<TComponent, TResult = unknown, TData = unknown>(component: Type<TComponent>, config?: MkBottomSheetConfig<TData>): MkOverlayRef<TResult, TComponent>;
|
|
1010
|
+
private mergePanelClass;
|
|
1011
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkBottomSheetService, never>;
|
|
1012
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<MkBottomSheetService>;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
/**
|
|
1016
|
+
* Banner — a persistent, full-width page/section message with a tone, optional
|
|
1017
|
+
* title, an actions slot and optional dismiss. Heavier than an inline
|
|
1018
|
+
* {@link MkAlert} toast; use it for standing notices ("Trial ends in 3 days").
|
|
1019
|
+
*
|
|
1020
|
+
* Project an icon with `[mkBannerIcon]` and buttons with `[mkBannerActions]`.
|
|
1021
|
+
* Danger/warning banners announce assertively (`role="alert"`).
|
|
1022
|
+
*
|
|
1023
|
+
* ```html
|
|
1024
|
+
* <mk-banner tone="warning" title="Storage almost full" dismissible>
|
|
1025
|
+
* You've used 90% of your quota.
|
|
1026
|
+
* <button mkButton size="sm" mkBannerActions>Upgrade</button>
|
|
1027
|
+
* </mk-banner>
|
|
1028
|
+
* ```
|
|
1029
|
+
*/
|
|
1030
|
+
declare class MkBanner {
|
|
1031
|
+
/** Localised strings (override globally via `provideMkI18n`). */
|
|
1032
|
+
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
1033
|
+
/** Semantic color tone. */
|
|
1034
|
+
readonly tone: _angular_core.InputSignal<MkTone>;
|
|
1035
|
+
/** Optional bold title above the message. */
|
|
1036
|
+
readonly title: _angular_core.InputSignal<string>;
|
|
1037
|
+
/** Show a dismiss (×) button. */
|
|
1038
|
+
readonly dismissible: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
1039
|
+
/** Two-way open state; set false to hide. */
|
|
1040
|
+
readonly open: _angular_core.ModelSignal<boolean>;
|
|
1041
|
+
/** Emitted when the banner is dismissed. */
|
|
1042
|
+
readonly dismissed: _angular_core.OutputEmitterRef<void>;
|
|
1043
|
+
protected readonly role: _angular_core.Signal<"alert" | "status">;
|
|
1044
|
+
protected dismiss(): void;
|
|
1045
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkBanner, never>;
|
|
1046
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkBanner, "mk-banner", never, { "tone": { "alias": "tone"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "dismissible": { "alias": "dismissible"; "required": false; "isSignal": true; }; "open": { "alias": "open"; "required": false; "isSignal": true; }; }, { "open": "openChange"; "dismissed": "dismissed"; }, never, ["[mkBannerIcon]", "*", "[mkBannerActions]"], true, never>;
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
/**
|
|
1050
|
+
* LoadingBar — a thin progress bar fixed to the top of the viewport, driven by
|
|
1051
|
+
* {@link MkLoadingBarService}. Place it once (e.g. in the app shell) and call
|
|
1052
|
+
* `start()` / `complete()` on navigation or async work.
|
|
1053
|
+
*
|
|
1054
|
+
* ```html
|
|
1055
|
+
* <mk-loading-bar />
|
|
1056
|
+
* ```
|
|
1057
|
+
*/
|
|
1058
|
+
declare class MkLoadingBar {
|
|
1059
|
+
private readonly service;
|
|
1060
|
+
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
1061
|
+
/** Bar colour. */
|
|
1062
|
+
readonly color: _angular_core.InputSignal<string>;
|
|
1063
|
+
/** Bar thickness in px. */
|
|
1064
|
+
readonly height: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
1065
|
+
protected readonly progress: _angular_core.Signal<number>;
|
|
1066
|
+
protected readonly active: _angular_core.Signal<boolean>;
|
|
1067
|
+
/**
|
|
1068
|
+
* The fill is a full-width bar scaled from the inline start — `transform`
|
|
1069
|
+
* animates on the compositor, so each trickle tick avoids the layout+paint
|
|
1070
|
+
* cost that animating `width` incurred. Origin flips for RTL in the styles.
|
|
1071
|
+
*/
|
|
1072
|
+
protected readonly fillTransform: _angular_core.Signal<string>;
|
|
1073
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkLoadingBar, never>;
|
|
1074
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkLoadingBar, "mk-loading-bar", never, { "color": { "alias": "color"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
/**
|
|
1078
|
+
* Drives a global {@link MkLoadingBar} — the thin top-of-page progress bar for
|
|
1079
|
+
* route changes and background work. `start()` shows it and trickles toward 90%;
|
|
1080
|
+
* `complete()` finishes and hides it. Also supports a determinate `set(value)`.
|
|
1081
|
+
*
|
|
1082
|
+
* ```ts
|
|
1083
|
+
* const bar = inject(MkLoadingBarService);
|
|
1084
|
+
* router.events.subscribe(e => {
|
|
1085
|
+
* if (e instanceof NavigationStart) bar.start();
|
|
1086
|
+
* if (e instanceof NavigationEnd) bar.complete();
|
|
1087
|
+
* });
|
|
1088
|
+
* ```
|
|
1089
|
+
*/
|
|
1090
|
+
declare class MkLoadingBarService {
|
|
1091
|
+
private readonly isBrowser;
|
|
1092
|
+
private readonly _progress;
|
|
1093
|
+
private readonly _active;
|
|
1094
|
+
/** Current progress, 0–100. */
|
|
1095
|
+
readonly progress: _angular_core.Signal<number>;
|
|
1096
|
+
/** Whether the bar is visible. */
|
|
1097
|
+
readonly active: _angular_core.Signal<boolean>;
|
|
1098
|
+
private timer?;
|
|
1099
|
+
private doneTimer?;
|
|
1100
|
+
/** Show the bar and start trickling toward 90%. */
|
|
1101
|
+
start(): void;
|
|
1102
|
+
/** Set an explicit determinate value (0–100). */
|
|
1103
|
+
set(value: number): void;
|
|
1104
|
+
/** Nudge progress up by `amount` (default 5), capped at 90%. */
|
|
1105
|
+
inc(amount?: number): void;
|
|
1106
|
+
/** Finish (jump to 100%) then fade out. */
|
|
1107
|
+
complete(): void;
|
|
1108
|
+
/** Hide immediately without finishing. */
|
|
1109
|
+
stop(): void;
|
|
1110
|
+
/**
|
|
1111
|
+
* Auto-slowing trickle so the bar keeps moving without ever completing.
|
|
1112
|
+
* Stops its own interval at the 90% ceiling — otherwise a navigation that
|
|
1113
|
+
* never `complete()`s would leave a timer firing (and, in a zoneless app,
|
|
1114
|
+
* scheduling change detection) forever. `start()`/`inc()` re-arm it.
|
|
1115
|
+
*/
|
|
1116
|
+
private trickle;
|
|
1117
|
+
/** Start the 350ms trickle interval unless it is already running. */
|
|
1118
|
+
private armTrickle;
|
|
1119
|
+
private stopTrickle;
|
|
1120
|
+
private clearTimers;
|
|
1121
|
+
/** True while finishing (progress full but not yet hidden). */
|
|
1122
|
+
readonly finishing: _angular_core.Signal<boolean>;
|
|
1123
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkLoadingBarService, never>;
|
|
1124
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<MkLoadingBarService>;
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
/**
|
|
1128
|
+
* A single coach-mark step in a product tour. The `target` is the element the
|
|
1129
|
+
* step points at — either a live `HTMLElement` or a CSS selector resolved
|
|
1130
|
+
* against the document when the step is shown.
|
|
1131
|
+
*/
|
|
1132
|
+
interface MkTourStep {
|
|
1133
|
+
/** Element (or selector) the popover anchors to and highlights. */
|
|
1134
|
+
target: string | HTMLElement;
|
|
1135
|
+
/** Optional heading shown above the body. */
|
|
1136
|
+
title?: string;
|
|
1137
|
+
/** The explanatory copy for this step. */
|
|
1138
|
+
body: string;
|
|
1139
|
+
/** Preferred placement of the popover relative to the target. */
|
|
1140
|
+
placement?: MkPlacement;
|
|
1141
|
+
}
|
|
1142
|
+
/** Navigation callbacks the popup invokes on the owning {@link MkTourService}. */
|
|
1143
|
+
interface MkTourController {
|
|
1144
|
+
next(): void;
|
|
1145
|
+
prev(): void;
|
|
1146
|
+
end(): void;
|
|
1147
|
+
}
|
|
1148
|
+
/** Per-step data injected into {@link MkTourPopup} via {@link MK_TOUR_DATA}. */
|
|
1149
|
+
interface MkTourData {
|
|
1150
|
+
/** The step being shown. */
|
|
1151
|
+
step: MkTourStep;
|
|
1152
|
+
/** Zero-based index of this step. */
|
|
1153
|
+
index: number;
|
|
1154
|
+
/** Total number of steps in the tour. */
|
|
1155
|
+
total: number;
|
|
1156
|
+
/** The resolved target element to anchor against. */
|
|
1157
|
+
anchor: HTMLElement;
|
|
1158
|
+
/** Navigation handle back to the service. */
|
|
1159
|
+
controller: MkTourController;
|
|
1160
|
+
}
|
|
1161
|
+
/** DI token carrying the current {@link MkTourData} to the popup. */
|
|
1162
|
+
declare const MK_TOUR_DATA: InjectionToken<MkTourData>;
|
|
1163
|
+
/**
|
|
1164
|
+
* The floating coach-mark popover for one tour step. Rendered dynamically by
|
|
1165
|
+
* {@link MkTourService} (one instance per step) and anchored to the step's
|
|
1166
|
+
* target through {@link MkAnchoredPanel}, so it lives in the browser top layer
|
|
1167
|
+
* and is never clipped by an ancestor's `overflow`/`transform`.
|
|
1168
|
+
*/
|
|
1169
|
+
declare class MkTourPopup {
|
|
1170
|
+
private readonly injector;
|
|
1171
|
+
private readonly panelRef;
|
|
1172
|
+
protected readonly i18n: _mk_kit_ui_core.MkI18nStrings;
|
|
1173
|
+
/** The step + navigation data for this popup. */
|
|
1174
|
+
protected readonly data: MkTourData;
|
|
1175
|
+
/** Whether this is the final step (Next becomes "Done"). */
|
|
1176
|
+
protected readonly isLast: _angular_core.Signal<boolean>;
|
|
1177
|
+
constructor();
|
|
1178
|
+
protected next(): void;
|
|
1179
|
+
protected prev(): void;
|
|
1180
|
+
protected skip(): void;
|
|
1181
|
+
protected onEscape(event: Event): void;
|
|
1182
|
+
/**
|
|
1183
|
+
* Ignore anchored-panel dismisses (outside pointerdown / window blur): a tour
|
|
1184
|
+
* should stay put while the user reads it — it ends only via the buttons or
|
|
1185
|
+
* Escape.
|
|
1186
|
+
*/
|
|
1187
|
+
protected onDismiss(): void;
|
|
1188
|
+
/**
|
|
1189
|
+
* Trap Tab inside the popup (the dialog is `aria-modal` over a scrim): wrap
|
|
1190
|
+
* from the last tabbable back to the first and vice versa, and pull focus in
|
|
1191
|
+
* if it somehow ended up outside.
|
|
1192
|
+
*/
|
|
1193
|
+
protected onTab(event: Event): void;
|
|
1194
|
+
private focusInitial;
|
|
1195
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkTourPopup, never>;
|
|
1196
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MkTourPopup, "mk-tour-popup", never, {}, {}, never, never, true, never>;
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
/**
|
|
1200
|
+
* Product-onboarding tour service — walks the user through a sequence of
|
|
1201
|
+
* {@link MkTourStep}s. For each step it scrolls the target into view, dims the
|
|
1202
|
+
* page behind a scrim, highlights the target with a bright ring, and anchors a
|
|
1203
|
+
* coach-mark popover ({@link MkTourPopup}) to it in the browser top layer via
|
|
1204
|
+
* `MkAnchoredPanel`.
|
|
1205
|
+
*
|
|
1206
|
+
* ```ts
|
|
1207
|
+
* const tour = inject(MkTourService);
|
|
1208
|
+
* await tour.start([
|
|
1209
|
+
* { target: '#new-btn', title: 'Create', body: 'Start a project here.' },
|
|
1210
|
+
* { target: '#inbox', body: 'Your notifications land here.', placement: 'left' },
|
|
1211
|
+
* ]);
|
|
1212
|
+
* ```
|
|
1213
|
+
*/
|
|
1214
|
+
declare class MkTourService {
|
|
1215
|
+
private readonly appRef;
|
|
1216
|
+
private readonly envInjector;
|
|
1217
|
+
private readonly document;
|
|
1218
|
+
private readonly isBrowser;
|
|
1219
|
+
private readonly _steps;
|
|
1220
|
+
private readonly _index;
|
|
1221
|
+
private readonly _running;
|
|
1222
|
+
/** Zero-based index of the current step, or `-1` when no tour is running. */
|
|
1223
|
+
readonly index: _angular_core.Signal<number>;
|
|
1224
|
+
/** Whether a tour is currently active. */
|
|
1225
|
+
readonly running: _angular_core.Signal<boolean>;
|
|
1226
|
+
/** Total number of steps in the active tour. */
|
|
1227
|
+
readonly total: _angular_core.Signal<number>;
|
|
1228
|
+
/** The current step, or `null`. */
|
|
1229
|
+
readonly currentStep: _angular_core.Signal<MkTourStep | null>;
|
|
1230
|
+
private popupRef?;
|
|
1231
|
+
private scrim?;
|
|
1232
|
+
private snapshot?;
|
|
1233
|
+
private endResolve?;
|
|
1234
|
+
private endPromise;
|
|
1235
|
+
/** Element focused before start(); focus is restored to it on end(). */
|
|
1236
|
+
private previouslyFocused;
|
|
1237
|
+
constructor();
|
|
1238
|
+
/**
|
|
1239
|
+
* Begin a tour at step 0. Returns a promise that resolves when the tour ends
|
|
1240
|
+
* (finished, skipped, or Escaped).
|
|
1241
|
+
*/
|
|
1242
|
+
start(steps: MkTourStep[]): Promise<void>;
|
|
1243
|
+
/** Resolves when the active (or next) tour ends. */
|
|
1244
|
+
afterEnd(): Promise<void>;
|
|
1245
|
+
/** Advance to the next step, or finish on the last step. */
|
|
1246
|
+
next(): void;
|
|
1247
|
+
/** Return to the previous step (no-op at the first step). */
|
|
1248
|
+
prev(): void;
|
|
1249
|
+
/** End the tour and clean up all DOM, highlight, and listeners. */
|
|
1250
|
+
end(): void;
|
|
1251
|
+
private readonly onKeydown;
|
|
1252
|
+
/**
|
|
1253
|
+
* Render the step at `index`. Missing targets are skipped by continuing in
|
|
1254
|
+
* `dir` (+1 forward, -1 back); if none remain the tour ends.
|
|
1255
|
+
*/
|
|
1256
|
+
private showStep;
|
|
1257
|
+
/** Destroy the current popup and restore the current target's styles. */
|
|
1258
|
+
private teardownStep;
|
|
1259
|
+
private resolveTarget;
|
|
1260
|
+
/** Raise the target above the scrim and draw a bright ring around it. */
|
|
1261
|
+
private highlight;
|
|
1262
|
+
private unhighlight;
|
|
1263
|
+
private ensureScrim;
|
|
1264
|
+
private removeScrim;
|
|
1265
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MkTourService, never>;
|
|
1266
|
+
static ɵprov: _angular_core.ɵɵInjectableDeclaration<MkTourService>;
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
export { MK_TOUR_DATA, MkAlert, MkBanner, MkBottomSheet, MkBottomSheetService, MkConfirmDialog, MkDialog, MkDialogService, MkDialogTitle, MkHovercard, MkHovercardTrigger, MkLoadingBar, MkLoadingBarService, MkNotificationCenter, MkPopconfirm, MkPopconfirmTrigger, MkPopover, MkPopoverTrigger, MkPromptDialog, MkResult, MkSnackbar, MkSnackbarContainer, MkSnackbarRef, MkSnackbarService, MkToast, MkToastContainer, MkToastService, MkTooltip, MkTooltipPanel, MkTourPopup, MkTourService };
|
|
1270
|
+
export type { MkAlertTone, MkAlertVariant, MkBottomSheetConfig, MkConfirmDialogData, MkDialogConfig, MkDialogSize, MkNotification, MkPromptDialogData, MkResultIconVariant, MkResultStatus, MkResultTone, MkSnackbarConfig, MkSnackbarDismissReason, MkSnackbarItem, MkSnackbarTone, MkToastAction, MkToastConfig, MkToastItem, MkToastTone, MkTourController, MkTourData, MkTourStep };
|