mn-angular-lib 1.0.177 → 1.0.179

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/fesm2022/mn-angular-lib-alert.mjs +535 -0
  2. package/fesm2022/mn-angular-lib-alert.mjs.map +1 -0
  3. package/fesm2022/mn-angular-lib-bottom-sheet.mjs +356 -0
  4. package/fesm2022/mn-angular-lib-bottom-sheet.mjs.map +1 -0
  5. package/fesm2022/mn-angular-lib-button.mjs +382 -0
  6. package/fesm2022/mn-angular-lib-button.mjs.map +1 -0
  7. package/fesm2022/mn-angular-lib-calendar-core.mjs +377 -0
  8. package/fesm2022/mn-angular-lib-calendar-core.mjs.map +1 -0
  9. package/fesm2022/mn-angular-lib-calendar.mjs +1513 -0
  10. package/fesm2022/mn-angular-lib-calendar.mjs.map +1 -0
  11. package/fesm2022/mn-angular-lib-collection.mjs +2277 -0
  12. package/fesm2022/mn-angular-lib-collection.mjs.map +1 -0
  13. package/fesm2022/mn-angular-lib-core.mjs +1232 -0
  14. package/fesm2022/mn-angular-lib-core.mjs.map +1 -0
  15. package/fesm2022/mn-angular-lib-display.mjs +728 -0
  16. package/fesm2022/mn-angular-lib-display.mjs.map +1 -0
  17. package/fesm2022/mn-angular-lib-forms.mjs +4260 -0
  18. package/fesm2022/mn-angular-lib-forms.mjs.map +1 -0
  19. package/fesm2022/mn-angular-lib-keyboard.mjs +195 -0
  20. package/fesm2022/mn-angular-lib-keyboard.mjs.map +1 -0
  21. package/fesm2022/mn-angular-lib-modal-core.mjs +945 -0
  22. package/fesm2022/mn-angular-lib-modal-core.mjs.map +1 -0
  23. package/fesm2022/mn-angular-lib-modal-ui.mjs +2016 -0
  24. package/fesm2022/mn-angular-lib-modal-ui.mjs.map +1 -0
  25. package/fesm2022/mn-angular-lib-modal.mjs +126 -0
  26. package/fesm2022/mn-angular-lib-modal.mjs.map +1 -0
  27. package/fesm2022/mn-angular-lib-rich-text-editor.mjs +275 -0
  28. package/fesm2022/mn-angular-lib-rich-text-editor.mjs.map +1 -0
  29. package/fesm2022/mn-angular-lib-segmented.mjs +246 -0
  30. package/fesm2022/mn-angular-lib-segmented.mjs.map +1 -0
  31. package/fesm2022/mn-angular-lib-tab.mjs +573 -0
  32. package/fesm2022/mn-angular-lib-tab.mjs.map +1 -0
  33. package/fesm2022/mn-angular-lib.mjs +21 -15509
  34. package/fesm2022/mn-angular-lib.mjs.map +1 -1
  35. package/package.json +66 -1
  36. package/src/lib/styles/index.css +2 -2
  37. package/types/mn-angular-lib-alert.d.ts +258 -0
  38. package/types/mn-angular-lib-bottom-sheet.d.ts +173 -0
  39. package/types/mn-angular-lib-button.d.ts +318 -0
  40. package/types/mn-angular-lib-calendar-core.d.ts +378 -0
  41. package/types/mn-angular-lib-calendar.d.ts +636 -0
  42. package/types/mn-angular-lib-collection.d.ts +1550 -0
  43. package/types/mn-angular-lib-core.d.ts +756 -0
  44. package/types/mn-angular-lib-display.d.ts +1075 -0
  45. package/types/mn-angular-lib-forms.d.ts +3235 -0
  46. package/types/mn-angular-lib-keyboard.d.ts +128 -0
  47. package/types/mn-angular-lib-modal-core.d.ts +1130 -0
  48. package/types/mn-angular-lib-modal-ui.d.ts +492 -0
  49. package/types/mn-angular-lib-modal.d.ts +27 -0
  50. package/types/mn-angular-lib-rich-text-editor.d.ts +157 -0
  51. package/types/mn-angular-lib-segmented.d.ts +395 -0
  52. package/types/mn-angular-lib-tab.d.ts +313 -0
  53. package/types/mn-angular-lib.d.ts +16 -10816
  54. /package/{src/lib/features → alert/src}/mn-alert/mn-alert-outlet/mn-alert-outlet.css +0 -0
  55. /package/{src/lib/features → bottom-sheet/src}/mn-bottom-sheet/mn-bottom-sheet.component.css +0 -0
  56. /package/{src/lib/features → button/src}/mn-skeleton/mn-skeleton.css +0 -0
  57. /package/{src/lib/features → collection/src}/mn-list/mn-list.component.css +0 -0
  58. /package/{src/lib/features → forms/src}/mn-checkbox/mn-checkbox.css +0 -0
  59. /package/{src/lib/features → forms/src}/mn-dropdown/mn-dropdown.css +0 -0
  60. /package/{src/lib/features → forms/src}/mn-multi-select/mn-multi-select.css +0 -0
  61. /package/{src/lib/features → keyboard/src}/mn-keyboard/mn-keyboard.component.css +0 -0
  62. /package/{src/lib/features → modal-ui/src}/mn-modal/components/mn-confirmation-body/mn-confirmation-body.component.css +0 -0
  63. /package/{src/lib/features → modal-ui/src}/mn-modal/components/mn-form-body/mn-form-body.component.css +0 -0
  64. /package/{src/lib/features → modal-ui/src}/mn-modal/components/mn-modal-shell/mn-modal-shell.component.css +0 -0
  65. /package/{src/lib/features → modal-ui/src}/mn-modal/components/mn-wizard-body/mn-wizard-body.component.css +0 -0
  66. /package/{src/lib/features → rich-text-editor/src}/mn-rich-text-editor/mn-rich-text-editor.component.css +0 -0
@@ -0,0 +1,395 @@
1
+ import * as tailwind_variants from 'tailwind-variants';
2
+ import { VariantProps } from 'tailwind-variants';
3
+ import * as tailwind_merge from 'tailwind-merge';
4
+ import * as i0 from '@angular/core';
5
+ import { EventEmitter, TemplateRef } from '@angular/core';
6
+ import { MnButtonTypes } from 'mn-angular-lib/button';
7
+ import { MnActionIcon } from 'mn-angular-lib/forms';
8
+
9
+ /**
10
+ * Styling for {@link MnSegmented}, expressed as tailwind-variants slots so the
11
+ * template pulls one class string per role.
12
+ *
13
+ * The control is a track with the active choice raised out of it, rather than a
14
+ * row of loose buttons: the segments share one bordered surface, so they read as
15
+ * one control with one answer instead of several independent actions. Theme
16
+ * tokens only, so it holds up in both light and dark.
17
+ *
18
+ * Each segment is an `mnButton`, which owns its own size, colour, radius and
19
+ * disabled look; the `segment` slot adds only what the button does not know
20
+ * about — how it sits inside the track.
21
+ */
22
+ declare const mnSegmentedVariants: tailwind_variants.TVReturnType<{
23
+ /**
24
+ * Corner rounding of the track. The segments are rounded one step tighter
25
+ * (see `SEGMENT_RADIUS` on the component) so a filled segment nests inside
26
+ * the track's own corner instead of poking out of it. Token names match
27
+ * mn-button's; `full` makes a pill, where track and segment share the same
28
+ * fully-rounded ends.
29
+ */
30
+ borderRadius: {
31
+ none: {
32
+ root: string;
33
+ };
34
+ xs: {
35
+ root: string;
36
+ };
37
+ sm: {
38
+ root: string;
39
+ };
40
+ md: {
41
+ root: string;
42
+ };
43
+ lg: {
44
+ root: string;
45
+ };
46
+ xl: {
47
+ root: string;
48
+ };
49
+ two_xl: {
50
+ root: string;
51
+ };
52
+ three_xl: {
53
+ root: string;
54
+ };
55
+ four_xl: {
56
+ root: string;
57
+ };
58
+ full: {
59
+ root: string;
60
+ };
61
+ };
62
+ /**
63
+ * Stretch the track and share its width evenly between the segments.
64
+ *
65
+ * The segments grow from a zero basis but keep their automatic minimum, so a
66
+ * justified control inside an auto-width parent still asks for the room its
67
+ * labels need. Letting them shrink below their content (`min-w-0`) made the
68
+ * parent resolve to a narrower box and truncated the labels instead.
69
+ */
70
+ justified: {
71
+ true: {
72
+ root: string;
73
+ segment: string;
74
+ };
75
+ false: {};
76
+ };
77
+ /**
78
+ * Whether the segment is the picked one. The colours come from the button
79
+ * itself (a filled primary button when active, a ghost one otherwise); this
80
+ * only keeps an inactive segment's box the same size as an active one, whose
81
+ * fill variant carries a real border.
82
+ */
83
+ active: {
84
+ true: {};
85
+ false: {
86
+ segment: string;
87
+ };
88
+ };
89
+ }, {
90
+ root: string;
91
+ segment: string;
92
+ }, undefined, {
93
+ /**
94
+ * Corner rounding of the track. The segments are rounded one step tighter
95
+ * (see `SEGMENT_RADIUS` on the component) so a filled segment nests inside
96
+ * the track's own corner instead of poking out of it. Token names match
97
+ * mn-button's; `full` makes a pill, where track and segment share the same
98
+ * fully-rounded ends.
99
+ */
100
+ borderRadius: {
101
+ none: {
102
+ root: string;
103
+ };
104
+ xs: {
105
+ root: string;
106
+ };
107
+ sm: {
108
+ root: string;
109
+ };
110
+ md: {
111
+ root: string;
112
+ };
113
+ lg: {
114
+ root: string;
115
+ };
116
+ xl: {
117
+ root: string;
118
+ };
119
+ two_xl: {
120
+ root: string;
121
+ };
122
+ three_xl: {
123
+ root: string;
124
+ };
125
+ four_xl: {
126
+ root: string;
127
+ };
128
+ full: {
129
+ root: string;
130
+ };
131
+ };
132
+ /**
133
+ * Stretch the track and share its width evenly between the segments.
134
+ *
135
+ * The segments grow from a zero basis but keep their automatic minimum, so a
136
+ * justified control inside an auto-width parent still asks for the room its
137
+ * labels need. Letting them shrink below their content (`min-w-0`) made the
138
+ * parent resolve to a narrower box and truncated the labels instead.
139
+ */
140
+ justified: {
141
+ true: {
142
+ root: string;
143
+ segment: string;
144
+ };
145
+ false: {};
146
+ };
147
+ /**
148
+ * Whether the segment is the picked one. The colours come from the button
149
+ * itself (a filled primary button when active, a ghost one otherwise); this
150
+ * only keeps an inactive segment's box the same size as an active one, whose
151
+ * fill variant carries a real border.
152
+ */
153
+ active: {
154
+ true: {};
155
+ false: {
156
+ segment: string;
157
+ };
158
+ };
159
+ }, {
160
+ root: string;
161
+ segment: string;
162
+ }, tailwind_variants.TVReturnType<{
163
+ /**
164
+ * Corner rounding of the track. The segments are rounded one step tighter
165
+ * (see `SEGMENT_RADIUS` on the component) so a filled segment nests inside
166
+ * the track's own corner instead of poking out of it. Token names match
167
+ * mn-button's; `full` makes a pill, where track and segment share the same
168
+ * fully-rounded ends.
169
+ */
170
+ borderRadius: {
171
+ none: {
172
+ root: string;
173
+ };
174
+ xs: {
175
+ root: string;
176
+ };
177
+ sm: {
178
+ root: string;
179
+ };
180
+ md: {
181
+ root: string;
182
+ };
183
+ lg: {
184
+ root: string;
185
+ };
186
+ xl: {
187
+ root: string;
188
+ };
189
+ two_xl: {
190
+ root: string;
191
+ };
192
+ three_xl: {
193
+ root: string;
194
+ };
195
+ four_xl: {
196
+ root: string;
197
+ };
198
+ full: {
199
+ root: string;
200
+ };
201
+ };
202
+ /**
203
+ * Stretch the track and share its width evenly between the segments.
204
+ *
205
+ * The segments grow from a zero basis but keep their automatic minimum, so a
206
+ * justified control inside an auto-width parent still asks for the room its
207
+ * labels need. Letting them shrink below their content (`min-w-0`) made the
208
+ * parent resolve to a narrower box and truncated the labels instead.
209
+ */
210
+ justified: {
211
+ true: {
212
+ root: string;
213
+ segment: string;
214
+ };
215
+ false: {};
216
+ };
217
+ /**
218
+ * Whether the segment is the picked one. The colours come from the button
219
+ * itself (a filled primary button when active, a ghost one otherwise); this
220
+ * only keeps an inactive segment's box the same size as an active one, whose
221
+ * fill variant carries a real border.
222
+ */
223
+ active: {
224
+ true: {};
225
+ false: {
226
+ segment: string;
227
+ };
228
+ };
229
+ }, {
230
+ root: string;
231
+ segment: string;
232
+ }, undefined, unknown, unknown, undefined>>;
233
+ type MnSegmentedVariants = VariantProps<typeof mnSegmentedVariants>;
234
+
235
+ /**
236
+ * One choice in a {@link MnSegmented} control.
237
+ *
238
+ * A segment is a label, an icon, or both. Icon-only segments carry no visible
239
+ * text, so they need an {@link ariaLabel} to stay reachable by name.
240
+ */
241
+ type MnSegmentedItem = {
242
+ /** Value emitted when this segment is picked; also identifies the active one. */
243
+ value: string;
244
+ /** Translation key or literal label. Omit for an icon-only segment. */
245
+ label?: string;
246
+ /**
247
+ * Optional leading icon: a `TemplateRef` (full control over the icon set — an
248
+ * `<mn-icon>`, an emoji, a bespoke `<svg>`) or lucide icon *data* such as
249
+ * `LucideList.icon`. The same convention the dropdown's actions use; see
250
+ * {@link MnActionIcon}.
251
+ */
252
+ icon?: MnActionIcon;
253
+ /**
254
+ * Accessible name of the segment. Required when {@link label} is omitted,
255
+ * since an icon alone names nothing; ignored otherwise — the label is the name.
256
+ */
257
+ ariaLabel?: string;
258
+ /** Whether this choice cannot be picked. Defaults to false. */
259
+ disabled?: boolean;
260
+ };
261
+ /**
262
+ * Data source for {@link MnSegmented}.
263
+ *
264
+ * The control is a single-choice switch: exactly one of {@link items} is active
265
+ * at a time, and which one is decided by the consumer through
266
+ * {@link MnSegmented.value} rather than by the control itself.
267
+ */
268
+ type MnSegmentedDataSource = {
269
+ /** The choices, in the order they are shown. Two or three read best. */
270
+ items: MnSegmentedItem[];
271
+ /** Visual scale. Defaults to `'md'`. */
272
+ size?: 'sm' | 'md';
273
+ /**
274
+ * Corner rounding, in mn-button's radius tokens plus `'full'` for a pill.
275
+ * Defaults to `'lg'`. The segments follow the track one step tighter, so the
276
+ * active segment stays nested inside the track's corner.
277
+ */
278
+ borderRadius?: MnSegmentedVariants['borderRadius'];
279
+ /**
280
+ * Translation key or literal naming what the group switches, e.g. "View".
281
+ * Without it the group is an unnamed set of buttons to a screen reader.
282
+ */
283
+ ariaLabel?: string;
284
+ };
285
+
286
+ /**
287
+ * A segmented control: two or three mutually exclusive choices sharing one
288
+ * track, of which exactly one is active — a view switch (list ⇄ calendar), a
289
+ * scope switch (mine ⇄ everyone), a range switch (week ⇄ month).
290
+ *
291
+ * The selection is **controlled**: the component renders whatever
292
+ * {@link value} says and emits {@link valueChange} on a click, so the consumer's
293
+ * own state stays the single source of truth for what is on screen. It keeps no
294
+ * copy of the selection, and — unlike `mn-tab` — it does not mirror one into the
295
+ * URL, so it can sit on a page that already has a tab bar without the two
296
+ * fighting over the query string.
297
+ *
298
+ * Each segment is an `mnButton` — a filled primary one when active, a ghost one
299
+ * otherwise — so the control inherits the button's sizes, colours and disabled
300
+ * look rather than maintaining a parallel set.
301
+ *
302
+ * For switching between panes of a page, reach for `mn-tab`; this is for
303
+ * switching how one pane is rendered.
304
+ */
305
+ declare class MnSegmented {
306
+ /** The choices and how the group is labelled and scaled. */
307
+ dataSource: MnSegmentedDataSource;
308
+ /**
309
+ * Value of the active segment. No value (or one naming no segment) leaves the
310
+ * control with nothing active, which is what an unresolved selection should
311
+ * look like — the component never picks one on the consumer's behalf.
312
+ */
313
+ value?: string;
314
+ /**
315
+ * Whether the segments stretch to fill the available width. Defaults to false,
316
+ * so the control hugs its content and can be parked at the end of a row; turn
317
+ * it on where it should span its container, typically on a narrow screen.
318
+ */
319
+ justified: boolean;
320
+ /** Emits the picked segment's value. The consumer decides what to do with it. */
321
+ valueChange: EventEmitter<string>;
322
+ /** Resolves this control's own accessible names against the app's bundle. */
323
+ private readonly lang;
324
+ /** Resolved slot classes for the current rounding and layout. */
325
+ get styles(): {
326
+ root: (slotProps?: ({
327
+ borderRadius?: "lg" | "none" | "xs" | "sm" | "md" | "xl" | "two_xl" | "three_xl" | "four_xl" | "full" | undefined;
328
+ justified?: boolean | undefined;
329
+ active?: boolean | undefined;
330
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string;
331
+ segment: (slotProps?: ({
332
+ borderRadius?: "lg" | "none" | "xs" | "sm" | "md" | "xl" | "two_xl" | "three_xl" | "four_xl" | "full" | undefined;
333
+ justified?: boolean | undefined;
334
+ active?: boolean | undefined;
335
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string;
336
+ } & {
337
+ root: (slotProps?: ({
338
+ borderRadius?: "lg" | "none" | "xs" | "sm" | "md" | "xl" | "two_xl" | "three_xl" | "four_xl" | "full" | undefined;
339
+ justified?: boolean | undefined;
340
+ active?: boolean | undefined;
341
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string;
342
+ segment: (slotProps?: ({
343
+ borderRadius?: "lg" | "none" | "xs" | "sm" | "md" | "xl" | "two_xl" | "three_xl" | "four_xl" | "full" | undefined;
344
+ justified?: boolean | undefined;
345
+ active?: boolean | undefined;
346
+ } & tailwind_variants.ClassProp<tailwind_merge.ClassNameValue>) | undefined) => string;
347
+ } & {};
348
+ /** Icon edge length matching the control's text size. */
349
+ get iconSize(): number;
350
+ /** Accessible name of the group, or null when the consumer named nothing. */
351
+ get groupLabel(): string | null;
352
+ /**
353
+ * Whether `item` is the active choice.
354
+ * @param item - The segment to test.
355
+ */
356
+ isActive(item: MnSegmentedItem): boolean;
357
+ /**
358
+ * Layout classes for one segment — how it sits in the track. Its size, colour,
359
+ * radius and disabled look come from the button itself; see
360
+ * {@link segmentButton}.
361
+ * @param item - The segment to style.
362
+ */
363
+ segmentClass(item: MnSegmentedItem): string;
364
+ /**
365
+ * The `mnButton` configuration of one segment: a filled primary button when it
366
+ * is the active choice, a ghost button otherwise, at the control's size and one
367
+ * radius step inside the track. The active segment has no hover — re-picking it
368
+ * does nothing, so nothing should invite the click.
369
+ * @param item - The segment to configure.
370
+ */
371
+ segmentButton(item: MnSegmentedItem): Partial<MnButtonTypes>;
372
+ /**
373
+ * Accessible name for an icon-only segment, or null when the segment shows a
374
+ * label — that label already names it, and a second name would only compete.
375
+ * @param item - The segment to name.
376
+ */
377
+ segmentLabel(item: MnSegmentedItem): string | null;
378
+ /**
379
+ * Whether an icon was supplied as a `TemplateRef` rather than lucide icon data.
380
+ * @param value - The icon to test.
381
+ */
382
+ isTemplateRef(value: unknown): value is TemplateRef<unknown>;
383
+ /**
384
+ * Announces a click. Re-picking the active segment is silent: it is not a
385
+ * change, and a consumer that reloads on every emission would refetch for
386
+ * nothing.
387
+ * @param item - The segment that was clicked.
388
+ */
389
+ select(item: MnSegmentedItem): void;
390
+ static ɵfac: i0.ɵɵFactoryDeclaration<MnSegmented, never>;
391
+ static ɵcmp: i0.ɵɵComponentDeclaration<MnSegmented, "mn-segmented", never, { "dataSource": { "alias": "dataSource"; "required": true; }; "value": { "alias": "value"; "required": false; }; "justified": { "alias": "justified"; "required": false; }; }, { "valueChange": "valueChange"; }, never, never, true, never>;
392
+ }
393
+
394
+ export { MnSegmented, mnSegmentedVariants };
395
+ export type { MnSegmentedDataSource, MnSegmentedItem, MnSegmentedVariants };