@nanahoshi/mona-ui 0.40.0 → 0.42.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/docs/api/auto-complete.md +2 -0
  2. package/docs/api/combo-box.md +2 -0
  3. package/docs/api/common.md +1 -1
  4. package/docs/api/dropdowns.md +3 -1
  5. package/docs/api/i18n.md +54 -0
  6. package/docs/api/kanban.md +222 -0
  7. package/docs/api/locales.md +14 -14
  8. package/docs/api/sortable.md +189 -0
  9. package/docs/api/sparkline.md +85 -0
  10. package/docs/api/tabs.md +20 -0
  11. package/docs/auto-complete.md +64 -0
  12. package/docs/combo-box.md +65 -0
  13. package/docs/kanban.md +293 -0
  14. package/docs/sortable.md +320 -0
  15. package/docs/sparkline.md +303 -0
  16. package/docs/tabs.md +59 -10
  17. package/fesm2022/nanahoshi-mona-ui-auto-complete.mjs +95 -30
  18. package/fesm2022/nanahoshi-mona-ui-combo-box.mjs +58 -5
  19. package/fesm2022/nanahoshi-mona-ui-dropdowns.mjs +64 -29
  20. package/fesm2022/nanahoshi-mona-ui-i18n-icu.mjs +87 -0
  21. package/fesm2022/nanahoshi-mona-ui-kanban.mjs +660 -0
  22. package/fesm2022/nanahoshi-mona-ui-locales-ar-sa.mjs +14 -0
  23. package/fesm2022/nanahoshi-mona-ui-locales-de-de.mjs +14 -0
  24. package/fesm2022/nanahoshi-mona-ui-locales-es-es.mjs +14 -0
  25. package/fesm2022/nanahoshi-mona-ui-locales-fr-fr.mjs +14 -0
  26. package/fesm2022/nanahoshi-mona-ui-locales-id-id.mjs +14 -0
  27. package/fesm2022/nanahoshi-mona-ui-locales-it-it.mjs +14 -0
  28. package/fesm2022/nanahoshi-mona-ui-locales-ja-jp.mjs +14 -0
  29. package/fesm2022/nanahoshi-mona-ui-locales-ko-kr.mjs +14 -0
  30. package/fesm2022/nanahoshi-mona-ui-locales-pl-pl.mjs +44 -0
  31. package/fesm2022/nanahoshi-mona-ui-locales-pt-br.mjs +14 -0
  32. package/fesm2022/nanahoshi-mona-ui-locales-ru-ru.mjs +44 -0
  33. package/fesm2022/nanahoshi-mona-ui-locales-tr-tr.mjs +14 -0
  34. package/fesm2022/nanahoshi-mona-ui-locales-zh-cn.mjs +14 -0
  35. package/fesm2022/nanahoshi-mona-ui-locales-zh-tw.mjs +14 -0
  36. package/fesm2022/nanahoshi-mona-ui-sortable.mjs +733 -0
  37. package/fesm2022/nanahoshi-mona-ui-sparkline.mjs +573 -0
  38. package/fesm2022/nanahoshi-mona-ui-tabs.mjs +112 -5
  39. package/i18n/catalogs/en-US.messages.json +14 -0
  40. package/kanban/package.json +4 -0
  41. package/llms.txt +8 -2
  42. package/locales/ar-sa/ar-sa.messages.json +14 -0
  43. package/locales/de-de/de-de.messages.json +14 -0
  44. package/locales/es-es/es-es.messages.json +14 -0
  45. package/locales/fr-fr/fr-fr.messages.json +14 -0
  46. package/locales/id-id/id-id.messages.json +14 -0
  47. package/locales/it-it/it-it.messages.json +14 -0
  48. package/locales/ja-jp/ja-jp.messages.json +14 -0
  49. package/locales/ko-kr/ko-kr.messages.json +14 -0
  50. package/locales/pl-pl/pl-pl.messages.json +14 -0
  51. package/locales/pt-br/pt-br.messages.json +14 -0
  52. package/locales/ru-ru/ru-ru.messages.json +14 -0
  53. package/locales/tr-tr/tr-tr.messages.json +14 -0
  54. package/locales/zh-cn/zh-cn.messages.json +14 -0
  55. package/locales/zh-tw/zh-tw.messages.json +14 -0
  56. package/package.json +13 -1
  57. package/sortable/package.json +4 -0
  58. package/sparkline/package.json +4 -0
  59. package/types/nanahoshi-mona-ui-auto-complete.d.ts +42 -1
  60. package/types/nanahoshi-mona-ui-combo-box.d.ts +37 -1
  61. package/types/nanahoshi-mona-ui-dropdowns.d.ts +54 -4
  62. package/types/nanahoshi-mona-ui-i18n.d.ts +31 -0
  63. package/types/nanahoshi-mona-ui-kanban.d.ts +270 -0
  64. package/types/nanahoshi-mona-ui-locales-ar-sa.d.ts +14 -0
  65. package/types/nanahoshi-mona-ui-locales-de-de.d.ts +14 -0
  66. package/types/nanahoshi-mona-ui-locales-es-es.d.ts +14 -0
  67. package/types/nanahoshi-mona-ui-locales-fr-fr.d.ts +14 -0
  68. package/types/nanahoshi-mona-ui-locales-id-id.d.ts +14 -0
  69. package/types/nanahoshi-mona-ui-locales-it-it.d.ts +14 -0
  70. package/types/nanahoshi-mona-ui-locales-ja-jp.d.ts +14 -0
  71. package/types/nanahoshi-mona-ui-locales-ko-kr.d.ts +14 -0
  72. package/types/nanahoshi-mona-ui-locales-pl-pl.d.ts +14 -0
  73. package/types/nanahoshi-mona-ui-locales-pt-br.d.ts +14 -0
  74. package/types/nanahoshi-mona-ui-locales-ru-ru.d.ts +14 -0
  75. package/types/nanahoshi-mona-ui-locales-tr-tr.d.ts +14 -0
  76. package/types/nanahoshi-mona-ui-locales-zh-cn.d.ts +14 -0
  77. package/types/nanahoshi-mona-ui-locales-zh-tw.d.ts +14 -0
  78. package/types/nanahoshi-mona-ui-sortable.d.ts +245 -0
  79. package/types/nanahoshi-mona-ui-sparkline.d.ts +228 -0
  80. package/types/nanahoshi-mona-ui-tabs.d.ts +46 -0
@@ -0,0 +1,245 @@
1
+ import { PreventableEvent } from "@nanahoshi/mona-ui/common";
2
+ import * as i0 from "@angular/core";
3
+ import * as i1 from "@angular/cdk/drag-drop";
4
+ import { MonaSortableMessages } from "@nanahoshi/mona-ui/i18n";
5
+ /**
6
+ * A move of an item, by pointer or keyboard, within a sortable list or into another list of its group. The list the
7
+ * item lands in emits it. Call `preventDefault()` to refuse the move: the lists then don't emit their new items, and
8
+ * the item goes back where it was.
9
+ */
10
+ export declare class SortableMoveEvent<T = unknown> extends PreventableEvent {
11
+ #private;
12
+ constructor(options: SortableMoveEventOptions<T>, originalEvent?: Event);
13
+ /** The item's index in `currentItems`. */
14
+ get currentIndex(): number;
15
+ /** The items of the list the item lands in, after the move. */
16
+ get currentItems(): readonly T[];
17
+ /** The list the item lands in: the one that emits this event. */
18
+ get currentList(): SortableDirective<T>;
19
+ /** The item that moves. */
20
+ get item(): T;
21
+ /** The item's index in its list before the move. */
22
+ get previousIndex(): number;
23
+ /**
24
+ * The items of the list the item comes from, after the move. For a move within one list, the same array as
25
+ * `currentItems`.
26
+ */
27
+ get previousItems(): readonly T[];
28
+ /** The list the item comes from. The same as `currentList` for a move within one list. */
29
+ get previousList(): SortableDirective<T>;
30
+ }
31
+ interface SortableMoveEventOptions<T> {
32
+ readonly currentIndex: number;
33
+ readonly currentItems: readonly T[];
34
+ readonly currentList: SortableDirective<T>;
35
+ readonly item: T;
36
+ readonly previousIndex: number;
37
+ readonly previousItems: readonly T[];
38
+ readonly previousList: SortableDirective<T>;
39
+ }
40
+ /**
41
+ * How a sortable list lays out its items: in a column (`vertical`), in a row (`horizontal`), or in rows that wrap
42
+ * (`mixed`), such as a grid of cards.
43
+ */
44
+ type SortableOrientation = "horizontal" | "mixed" | "vertical";
45
+ /** The keys that move an item, held with Control and Shift (Command and Shift on macOS). */
46
+ type SortableMoveKey = "ArrowDown" | "ArrowLeft" | "ArrowRight" | "ArrowUp" | "End" | "Home";
47
+ /**
48
+ * @description
49
+ * Lets the user reorder a list's items by dragging them, or with Control+Shift and the arrow keys (Command+Shift on
50
+ * macOS), and announces each move. Mark each item with `monaSortableItem`, render every item of the array in order,
51
+ * and bind the array two-way, `[(monaSortable)]`, or handle `sortableMove`. The list doesn't reorder its elements
52
+ * itself. Lists inside one `monaSortableGroup` exchange items.
53
+ */
54
+ export declare class SortableDirective<T = unknown> {
55
+ #private;
56
+ /**
57
+ * @description Whether an item from another list of the group may come into this one, such as to keep a list
58
+ * under a limit. The list's own items can always move within it. Without it, every item may come in.
59
+ * @default null
60
+ */
61
+ readonly canEnter: import("@angular/core").InputSignal<((item: T) => boolean) | null>;
62
+ /**
63
+ * @description Stops items from moving within the list, out of it or into it.
64
+ * @default false
65
+ */
66
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
67
+ /**
68
+ * @description The list's items, in the order they're shown. Bind it two-way, `[(monaSortable)]`, to take each
69
+ * new order.
70
+ */
71
+ readonly items: import("@angular/core").InputSignal<readonly T[]>;
72
+ /**
73
+ * @description The shortcuts that move an item, in `aria-keyshortcuts` form, or `null` while the list is
74
+ * disabled. Items put it on themselves; an item that's presentational can bind it on the element in it that takes
75
+ * focus.
76
+ */
77
+ readonly keyShortcuts: import("@angular/core").Signal<string | null>;
78
+ /**
79
+ * @description The list's name in the announcement of a move into it from another list. Without it, the list's
80
+ * `aria-label` or `aria-labelledby` text.
81
+ * @default ""
82
+ */
83
+ readonly label: import("@angular/core").InputSignal<string>;
84
+ /**
85
+ * @description Keeps a dragged item on the list's axis: across for a horizontal list, up and down for a vertical
86
+ * one. A list whose rows wrap doesn't lock.
87
+ * @default false
88
+ */
89
+ readonly lockAxis: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
90
+ /**
91
+ * @description Emitted with the list's new items after an item moves within it, out of it or into it, unless the
92
+ * move was refused.
93
+ */
94
+ readonly monaSortableChange: import("@angular/core").OutputEmitterRef<T[]>;
95
+ /**
96
+ * @description How the items are laid out, which sets the keys that move them: Up and Down in a column, Left and
97
+ * Right in a row, and all four in rows that wrap.
98
+ * @default "vertical"
99
+ */
100
+ readonly orientation: import("@angular/core").InputSignal<SortableOrientation>;
101
+ /**
102
+ * @description Emitted with a {@link SortableMoveEvent} when an item moves within this list or into it from
103
+ * another list, before the lists emit their new items. This event is preventable.
104
+ */
105
+ readonly sortableMove: import("@angular/core").OutputEmitterRef<SortableMoveEvent<T>>;
106
+ constructor();
107
+ /** The first list after (`step` 1) or before (`step` -1) this one in the group that the item may move into. */
108
+ private findAdjacentList;
109
+ private findMoveTarget;
110
+ /**
111
+ * Puts focus back on the moved item once the new order has rendered: on the element that had it, when that's
112
+ * still in the item, else on the item or the first control in it, as when the item was rendered anew elsewhere.
113
+ */
114
+ private restoreFocus;
115
+ static ɵfac: i0.ɵɵFactoryDeclaration<SortableDirective<any>, never>;
116
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SortableDirective<any>, "[monaSortable]", ["monaSortable"], {
117
+ "canEnter": {
118
+ "alias": "sortableCanEnter";
119
+ "required": false;
120
+ "isSignal": true;
121
+ };
122
+ "disabled": {
123
+ "alias": "sortableDisabled";
124
+ "required": false;
125
+ "isSignal": true;
126
+ };
127
+ "items": {
128
+ "alias": "monaSortable";
129
+ "required": true;
130
+ "isSignal": true;
131
+ };
132
+ "label": {
133
+ "alias": "sortableLabel";
134
+ "required": false;
135
+ "isSignal": true;
136
+ };
137
+ "lockAxis": {
138
+ "alias": "sortableLockAxis";
139
+ "required": false;
140
+ "isSignal": true;
141
+ };
142
+ "orientation": {
143
+ "alias": "sortableOrientation";
144
+ "required": false;
145
+ "isSignal": true;
146
+ };
147
+ }, {
148
+ "monaSortableChange": "monaSortableChange";
149
+ "sortableMove": "sortableMove";
150
+ }, never, never, true, [{
151
+ directive: typeof i1.CdkDropList;
152
+ inputs: {};
153
+ outputs: {};
154
+ }]>;
155
+ }
156
+ /**
157
+ * @description
158
+ * Connects the sortable lists inside it, so an item can move from one to another: dragged, or with Control+Shift and
159
+ * the arrow keys that cross the lists, such as Left and Right between columns. The lists keep their own items; the
160
+ * one an item lands in emits the move.
161
+ */
162
+ export declare class SortableGroupDirective {
163
+ #private;
164
+ static ɵfac: i0.ɵɵFactoryDeclaration<SortableGroupDirective, never>;
165
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SortableGroupDirective, "[monaSortableGroup]", ["monaSortableGroup"], {}, {}, never, never, true, [{
166
+ directive: typeof i1.CdkDropListGroup;
167
+ inputs: {};
168
+ outputs: {};
169
+ }]>;
170
+ }
171
+ /**
172
+ * @description
173
+ * Marks the part of a sortable item that starts a drag, such as a grip icon. With a handle, the rest of the item
174
+ * doesn't start one, so its text can be selected. The keyboard still moves the item from anywhere in it.
175
+ */
176
+ export declare class SortableHandleDirective {
177
+ static ɵfac: i0.ɵɵFactoryDeclaration<SortableHandleDirective, never>;
178
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SortableHandleDirective, "[monaSortableHandle]", never, {}, {}, never, never, true, [{
179
+ directive: typeof i1.CdkDragHandle;
180
+ inputs: {};
181
+ outputs: {};
182
+ }]>;
183
+ }
184
+ /**
185
+ * @description
186
+ * An item of a `monaSortable` list, given the array element it shows. Drag it, or focus it, or a control in it, and
187
+ * press Control+Shift with an arrow key, Home or End (Command+Shift on macOS) to move it. On a touch screen, press and
188
+ * hold it first, so a swipe still scrolls.
189
+ */
190
+ export declare class SortableItemDirective<T = unknown> {
191
+ #private;
192
+ protected readonly hostKeyShortcuts: import("@angular/core").Signal<string | null>;
193
+ /**
194
+ * @description Stops this item from moving. Other items still move past it.
195
+ * @default false
196
+ */
197
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
198
+ /**
199
+ * @description The element of the list's array that this item shows.
200
+ */
201
+ readonly item: import("@angular/core").InputSignal<T>;
202
+ /**
203
+ * @description The shortcuts that move this item, in `aria-keyshortcuts` form, or `null` when it can't move. The
204
+ * item sets them on itself, unless it has `role="presentation"` or `role="none"`: then bind them on the element in
205
+ * it that takes focus.
206
+ */
207
+ readonly keyShortcuts: import("@angular/core").Signal<string | null>;
208
+ /**
209
+ * @description The item's name in announcements of its moves. Without it, the item's `aria-label`,
210
+ * `aria-labelledby` text or own text.
211
+ * @default ""
212
+ */
213
+ readonly label: import("@angular/core").InputSignal<string>;
214
+ constructor();
215
+ protected onKeydown(event: KeyboardEvent): void;
216
+ static ɵfac: i0.ɵɵFactoryDeclaration<SortableItemDirective<any>, never>;
217
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SortableItemDirective<any>, "[monaSortableItem]", ["monaSortableItem"], {
218
+ "disabled": {
219
+ "alias": "sortableDisabled";
220
+ "required": false;
221
+ "isSignal": true;
222
+ };
223
+ "item": {
224
+ "alias": "monaSortableItem";
225
+ "required": true;
226
+ "isSignal": true;
227
+ };
228
+ "label": {
229
+ "alias": "sortableLabel";
230
+ "required": false;
231
+ "isSignal": true;
232
+ };
233
+ }, {}, never, never, true, [{
234
+ directive: typeof i1.CdkDrag;
235
+ inputs: {};
236
+ outputs: {};
237
+ }]>;
238
+ }
239
+ /**
240
+ * A copy of `items` with the item at `from` moved to `to`, the index it has afterwards. Use it to apply a move that a
241
+ * list reports by index, such as a reordered tab. Indexes out of range are clamped; the array isn't changed.
242
+ */
243
+ export declare function moveItem<T>(items: readonly T[], from: number, to: number): T[];
244
+ export declare const SORTABLE_DEFAULT_MESSAGES: MonaSortableMessages;
245
+ export type { SortableMoveEventOptions, SortableMoveKey, SortableOrientation };
@@ -0,0 +1,228 @@
1
+ import * as i0 from "@angular/core";
2
+ import { MonaSparklineMessages } from "@nanahoshi/mona-ui/i18n";
3
+ /**
4
+ * How a line or an area sparkline joins its values, as a chart's line series does: `"linear"` with straight segments,
5
+ * `"monotone-x"` with a smooth curve that never swings past the values, `"natural"` with a smoother curve that can,
6
+ * `"step"` in steps that change halfway between values, and `"step-after"` in steps that hold each value until the
7
+ * next one.
8
+ */
9
+ type SparklineCurve = "linear" | "monotone-x" | "natural" | "step" | "step-after";
10
+ /** A value a line or area sparkline marks with a dot: its first, its last, its lowest or its highest. */
11
+ type SparklineMarker = "first" | "last" | "max" | "min";
12
+ /**
13
+ * How a sparkline draws its values: `"line"` joins them, `"area"` fills under the line, `"column"` draws a bar for
14
+ * each from zero, and `"win-loss"` draws a bar up for each positive value, down for each negative one and a short tick
15
+ * for each zero, all of one height.
16
+ */
17
+ type SparklineType = "area" | "column" | "line" | "win-loss";
18
+ type SparklineBarKind = "negative" | "positive" | "zero";
19
+ interface SparklineBar {
20
+ readonly height: number;
21
+ readonly kind: SparklineBarKind;
22
+ readonly width: number;
23
+ readonly x: number;
24
+ readonly y: number;
25
+ }
26
+ /** What a sparkline draws, in the drawing's coordinates. */
27
+ interface SparklineGeometry {
28
+ /** The area under the line of an area sparkline, one closed shape for each run of values. */
29
+ readonly areaPath: string;
30
+ /** The bars of a column or win-loss sparkline. */
31
+ readonly bars: readonly SparklineBar[];
32
+ /** Where zero is, for a column sparkline with values on both sides of it; `null` otherwise. */
33
+ readonly baselineY: number | null;
34
+ /** Dots for the values a line has no segment for, between gaps or alone. */
35
+ readonly dotsPath: string;
36
+ /** The line through the values, joined by the curve and broken where a value is missing. */
37
+ readonly linePath: string;
38
+ /** Dots for the marked values. */
39
+ readonly markersPath: string;
40
+ /** Where the reference value is; `null` without one, or for a win-loss sparkline. */
41
+ readonly referenceY: number | null;
42
+ }
43
+ /**
44
+ * A word-sized chart of a series of values, to sit on a line of text or in a table cell: a line, an area, columns or
45
+ * wins and losses. It's an image to assistive technology, which reads its name and a summary of its values: how many,
46
+ * the first, the last, the lowest and the highest, or how many wins, losses and draws.
47
+ *
48
+ * Values run from left to right, also in a right-to-left layout, as on a chart's axis.
49
+ */
50
+ export declare class SparklineComponent {
51
+ #private;
52
+ /** Its name, or without one, the summary of its values. */
53
+ protected readonly accessibleName: import("@angular/core").Signal<string | null>;
54
+ protected readonly areaClass = "fill-(--mona-sparkline-color) stroke-none [fill-opacity:0.2]";
55
+ protected readonly barClasses: {
56
+ readonly negative: "fill-(--mona-sparkline-negative-color)";
57
+ readonly positive: "fill-(--mona-sparkline-color)";
58
+ readonly zero: "fill-muted-foreground forced-colors:fill-[CanvasText]";
59
+ };
60
+ protected readonly baseClass: import("@angular/core").Signal<string>;
61
+ protected readonly baselineClass = "fill-none stroke-border [stroke-width:1px] forced-colors:stroke-[GrayText]";
62
+ /** With a name, the summary of its values is its description, after any the application gives. */
63
+ protected readonly describedBy: import("@angular/core").Signal<string | null>;
64
+ protected readonly descriptionId: string;
65
+ protected readonly dotClass = "fill-none stroke-(--mona-sparkline-color) [stroke-linecap:round] [stroke-width:5px]";
66
+ protected readonly geometry: import("@angular/core").Signal<SparklineGeometry>;
67
+ protected readonly lineClass = "fill-none stroke-(--mona-sparkline-color) [stroke-linecap:round] [stroke-linejoin:round] [stroke-width:1.5px]";
68
+ protected readonly referenceClass = "fill-none stroke-muted-foreground [stroke-dasharray:3_2] [stroke-width:1px] forced-colors:stroke-[GrayText]";
69
+ protected readonly showDescription: import("@angular/core").Signal<boolean>;
70
+ protected readonly summary: import("@angular/core").Signal<string>;
71
+ protected readonly svgClass = "\n block size-full overflow-visible forced-color-adjust-none\n forced-colors:[--mona-sparkline-color:CanvasText] forced-colors:[--mona-sparkline-negative-color:CanvasText]\n";
72
+ /**
73
+ * @description Ids of elements that describe the sparkline further. The summary of its values is added after them
74
+ * when it has a name.
75
+ * @default ""
76
+ */
77
+ readonly ariaDescribedBy: import("@angular/core").InputSignal<string>;
78
+ /**
79
+ * @description The sparkline's name, what its values are, such as "Weekly sales". Assistive technology reads the
80
+ * summary of its values after it. Without a name, the summary is the name.
81
+ * @default ""
82
+ */
83
+ readonly ariaLabel: import("@angular/core").InputSignal<string>;
84
+ /**
85
+ * @description The color of the line, the area and the bars, as a CSS color. The first chart color when empty.
86
+ * The `--mona-sparkline-color` custom property sets it from a style sheet.
87
+ * @default ""
88
+ */
89
+ readonly color: import("@angular/core").InputSignal<string>;
90
+ /**
91
+ * @description How a line or an area joins its values, as a chart's line series does: `"linear"`, `"monotone-x"`
92
+ * (smooth, never past the values), `"natural"` (smoother, but it can swing past them), `"step"` (changing halfway
93
+ * between values) or `"step-after"` (holding each value until the next). Columns and win-loss bars ignore it.
94
+ * @default "linear"
95
+ */
96
+ readonly curve: import("@angular/core").InputSignal<SparklineCurve>;
97
+ /**
98
+ * @description The values, in order. A `null`, or anything that isn't a finite number, leaves a gap.
99
+ * @default []
100
+ */
101
+ readonly data: import("@angular/core").InputSignal<Iterable<number | null | undefined>>;
102
+ /**
103
+ * @description Hides the sparkline from assistive technology, for one beside text that already gives its values.
104
+ * @default false
105
+ */
106
+ readonly decorative: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
107
+ /**
108
+ * @description How the values are formatted in the summary assistive technology reads, such as
109
+ * `{ style: "currency", currency: "EUR" }`. The locale's number format when `null`.
110
+ * @default null
111
+ */
112
+ readonly format: import("@angular/core").InputSignal<Intl.NumberFormatOptions | null>;
113
+ /**
114
+ * @description Values a line or area sparkline marks with a dot: `"first"`, `"last"`, `"min"` and `"max"`.
115
+ * @default []
116
+ */
117
+ readonly markers: import("@angular/core").InputSignal<readonly SparklineMarker[]>;
118
+ /**
119
+ * @description The value at the top of the sparkline. Give several sparklines the same `min` and `max` to compare
120
+ * them. When `null`, the highest value, or zero for columns, or the reference value when it's higher.
121
+ * @default null
122
+ */
123
+ readonly max: import("@angular/core").InputSignal<number | null>;
124
+ /**
125
+ * @description The value at the bottom of the sparkline. When `null`, the lowest value, or zero for columns, or the
126
+ * reference value when it's lower.
127
+ * @default null
128
+ */
129
+ readonly min: import("@angular/core").InputSignal<number | null>;
130
+ /**
131
+ * @description The color of column bars below zero and of losses, as a CSS color. The error color when empty. The
132
+ * `--mona-sparkline-negative-color` custom property sets it from a style sheet.
133
+ * @default ""
134
+ */
135
+ readonly negativeColor: import("@angular/core").InputSignal<string>;
136
+ /**
137
+ * @description A value to draw a dashed line at, such as a target or an average. Not drawn on a win-loss
138
+ * sparkline.
139
+ * @default null
140
+ */
141
+ readonly referenceValue: import("@angular/core").InputSignal<number | null>;
142
+ /**
143
+ * @description How the values are drawn: `"line"`, `"area"`, `"column"` or `"win-loss"`.
144
+ * @default "line"
145
+ */
146
+ readonly type: import("@angular/core").InputSignal<SparklineType>;
147
+ /**
148
+ * @description Additional CSS classes merged onto the host element via `tailwind-merge`, such as a size: it's
149
+ * 6rem wide and 1.5rem tall by default.
150
+ * @default ""
151
+ */
152
+ readonly userClass: import("@angular/core").InputSignal<string>;
153
+ static ɵfac: i0.ɵɵFactoryDeclaration<SparklineComponent, never>;
154
+ static ɵcmp: i0.ɵɵComponentDeclaration<SparklineComponent, "mona-sparkline", never, {
155
+ "ariaDescribedBy": {
156
+ "alias": "aria-describedby";
157
+ "required": false;
158
+ "isSignal": true;
159
+ };
160
+ "ariaLabel": {
161
+ "alias": "aria-label";
162
+ "required": false;
163
+ "isSignal": true;
164
+ };
165
+ "color": {
166
+ "alias": "color";
167
+ "required": false;
168
+ "isSignal": true;
169
+ };
170
+ "curve": {
171
+ "alias": "curve";
172
+ "required": false;
173
+ "isSignal": true;
174
+ };
175
+ "data": {
176
+ "alias": "data";
177
+ "required": false;
178
+ "isSignal": true;
179
+ };
180
+ "decorative": {
181
+ "alias": "decorative";
182
+ "required": false;
183
+ "isSignal": true;
184
+ };
185
+ "format": {
186
+ "alias": "format";
187
+ "required": false;
188
+ "isSignal": true;
189
+ };
190
+ "markers": {
191
+ "alias": "markers";
192
+ "required": false;
193
+ "isSignal": true;
194
+ };
195
+ "max": {
196
+ "alias": "max";
197
+ "required": false;
198
+ "isSignal": true;
199
+ };
200
+ "min": {
201
+ "alias": "min";
202
+ "required": false;
203
+ "isSignal": true;
204
+ };
205
+ "negativeColor": {
206
+ "alias": "negativeColor";
207
+ "required": false;
208
+ "isSignal": true;
209
+ };
210
+ "referenceValue": {
211
+ "alias": "referenceValue";
212
+ "required": false;
213
+ "isSignal": true;
214
+ };
215
+ "type": {
216
+ "alias": "type";
217
+ "required": false;
218
+ "isSignal": true;
219
+ };
220
+ "userClass": {
221
+ "alias": "class";
222
+ "required": false;
223
+ "isSignal": true;
224
+ };
225
+ }, {}, never, never, true, never>;
226
+ }
227
+ export declare const SPARKLINE_DEFAULT_MESSAGES: MonaSparklineMessages;
228
+ export type { SparklineCurve, SparklineMarker, SparklineType };
@@ -4,6 +4,7 @@ import { ElementRef, TemplateRef } from "@angular/core";
4
4
  import { ImmutableSet } from "@mirei/ts-collections";
5
5
  import { VariantInputs } from "@nanahoshi/mona-ui/internal";
6
6
  import { VariantProps } from "class-variance-authority";
7
+ import { SortableMoveEvent } from "@nanahoshi/mona-ui/sortable";
7
8
  import { MonaTabsMessages } from "@nanahoshi/mona-ui/i18n";
8
9
  export declare class TabCloseEvent extends PreventableEvent {
9
10
  #private;
@@ -13,6 +14,21 @@ export declare class TabCloseEvent extends PreventableEvent {
13
14
  /** Whether the tab a close was requested for was the selected tab. */
14
15
  get selected(): boolean;
15
16
  }
17
+ /**
18
+ * A tab dragged, or moved with Control+Shift and an arrow key, Home or End, to a new place in a sortable tab strip.
19
+ * The component doesn't reorder the tabs: move the tab in whatever renders the `mona-tab` elements, such as with
20
+ * `moveItem` from `@nanahoshi/mona-ui/sortable`.
21
+ */
22
+ export declare class TabReorderEvent {
23
+ #private;
24
+ constructor(previousIndex: number, currentIndex: number, originalEvent?: Event);
25
+ /** The index the tab moves to. */
26
+ get currentIndex(): number;
27
+ /** The DOM event that moved the tab: the key press, or the pointer release that dropped it. */
28
+ get originalEvent(): Event | undefined;
29
+ /** The index the tab had. */
30
+ get previousIndex(): number;
31
+ }
16
32
  export declare class TabSelectEvent extends PreventableEvent {
17
33
  #private;
18
34
  constructor(index: number, originalEvent?: Event);
@@ -45,6 +61,7 @@ declare const tabListListWrapperThemeVariants: (props?: import("class-variance-a
45
61
  declare const tabListListThemeVariants: (props?: ({
46
62
  position?: "top" | "bottom" | "left" | "right" | null | undefined;
47
63
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
64
+ /** A tab being dragged to a new place floats as a raised copy of itself. */
48
65
  declare const tabListListItemThemeVariants: (props?: ({
49
66
  active?: boolean | null | undefined;
50
67
  disabled?: boolean | null | undefined;
@@ -86,6 +103,7 @@ declare class TabListComponent implements TabListVariantInput {
86
103
  protected readonly orientation: import("@angular/core").Signal<TabOrientation>;
87
104
  protected readonly overflowControlsVisible: import("@angular/core").WritableSignal<boolean>;
88
105
  protected readonly scrollButtonClass: import("@angular/core").Signal<string>;
106
+ protected readonly sortableTabs: import("@angular/core").Signal<TabItem[]>;
89
107
  protected readonly tabClass: import("@angular/core").Signal<string>;
90
108
  protected readonly tabElements: import("@angular/core").Signal<readonly ElementRef<HTMLElement>[]>;
91
109
  protected readonly tabListElement: import("@angular/core").Signal<ElementRef<HTMLUListElement>>;
@@ -104,8 +122,10 @@ declare class TabListComponent implements TabListVariantInput {
104
122
  * @default "medium"
105
123
  */
106
124
  readonly size: import("@angular/core").InputSignal<"small" | "medium" | "large" | null | undefined>;
125
+ readonly sortable: import("@angular/core").InputSignal<boolean>;
107
126
  readonly tabClose: import("@angular/core").OutputEmitterRef<TabCloseEvent>;
108
127
  readonly tabList: import("@angular/core").InputSignal<Iterable<TabItem>>;
128
+ readonly tabReorder: import("@angular/core").OutputEmitterRef<TabReorderEvent>;
109
129
  readonly tabSelect: import("@angular/core").OutputEmitterRef<TabSelectEvent>;
110
130
  constructor();
111
131
  focusSelectedTab(): void;
@@ -114,9 +134,12 @@ declare class TabListComponent implements TabListVariantInput {
114
134
  protected onKeydown(event: KeyboardEvent): void;
115
135
  protected onTabClick(tab: TabItem, event: MouseEvent): void;
116
136
  protected onTabClose(tab: TabItem, event: MouseEvent): void;
137
+ protected onTabMove(event: SortableMoveEvent<TabItem>): void;
117
138
  protected startContinuousScroll(event: PointerEvent, element: HTMLElement, direction: TabScrollDirection): void;
118
139
  protected startScrolling(element: HTMLElement, direction: TabScrollDirection, type: "single" | "continuous"): void;
119
140
  protected stopScrolling(): void;
141
+ /** A tab's shortcuts: Delete and Backspace when it can be closed, and the sortable strip's moves. */
142
+ protected tabKeyShortcuts(closable: boolean, moveShortcuts: string | null): string | null;
120
143
  /**
121
144
  * Selects the tab and moves focus to it. A vetoed selection still moves focus, so the keyboard can get past a tab it
122
145
  * isn't allowed to select.
@@ -184,6 +207,11 @@ declare class TabListComponent implements TabListVariantInput {
184
207
  "required": true;
185
208
  "isSignal": true;
186
209
  };
210
+ "sortable": {
211
+ "alias": "sortable";
212
+ "required": false;
213
+ "isSignal": true;
214
+ };
187
215
  "tabList": {
188
216
  "alias": "tabList";
189
217
  "required": true;
@@ -192,6 +220,7 @@ declare class TabListComponent implements TabListVariantInput {
192
220
  }, {
193
221
  "selectedTabId": "selectedTabIdChange";
194
222
  "tabClose": "tabClose";
223
+ "tabReorder": "tabReorder";
195
224
  "tabSelect": "tabSelect";
196
225
  }, never, never, true, never>;
197
226
  }
@@ -299,11 +328,22 @@ export declare class TabsComponent implements TabsVariantInput {
299
328
  * @default "medium"
300
329
  */
301
330
  readonly size: import("@angular/core").InputSignal<"small" | "medium" | "large" | null | undefined>;
331
+ /**
332
+ * @description Lets the user reorder the tabs: by dragging them, or with Control+Shift and the arrow keys along the
333
+ * strip, Home or End (Command+Shift on macOS). The component emits `tabReorder` and doesn't move the tabs itself.
334
+ * @default false
335
+ */
336
+ readonly sortable: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
302
337
  /**
303
338
  * @description Emitted with a {@link TabCloseEvent} when a close is requested. The component doesn't remove the tab:
304
339
  * remove it from whatever renders the `mona-tab` elements.
305
340
  */
306
341
  readonly tabClose: import("@angular/core").OutputEmitterRef<TabCloseEvent>;
342
+ /**
343
+ * @description Emitted with a {@link TabReorderEvent} when a tab of a `sortable` strip is moved. The component doesn't
344
+ * reorder the tabs: move the tab in whatever renders the `mona-tab` elements. The selected tab stays selected.
345
+ */
346
+ readonly tabReorder: import("@angular/core").OutputEmitterRef<TabReorderEvent>;
307
347
  /**
308
348
  * @description Emitted with a {@link TabSelectEvent} before a click or key selects a tab. This event is preventable.
309
349
  * It doesn't fire for selections made through `selectedIndex` or `selected`, or when the selected tab is removed.
@@ -366,6 +406,11 @@ export declare class TabsComponent implements TabsVariantInput {
366
406
  "required": false;
367
407
  "isSignal": true;
368
408
  };
409
+ "sortable": {
410
+ "alias": "sortable";
411
+ "required": false;
412
+ "isSignal": true;
413
+ };
369
414
  "userClass": {
370
415
  "alias": "class";
371
416
  "required": false;
@@ -374,6 +419,7 @@ export declare class TabsComponent implements TabsVariantInput {
374
419
  }, {
375
420
  "selectedIndex": "selectedIndexChange";
376
421
  "tabClose": "tabClose";
422
+ "tabReorder": "tabReorder";
377
423
  "tabSelect": "tabSelect";
378
424
  }, ["tabs"], never, true, never>;
379
425
  }