@zeyos/zx 4.4.0 → 5.0.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 (182) hide show
  1. package/CHANGELOG.md +283 -0
  2. package/README.md +42 -10
  3. package/dist/types/components/activity-list/activity-list.d.ts +22 -0
  4. package/dist/types/components/app-sidebar/app-sidebar.d.ts +5 -3
  5. package/dist/types/components/avatar/avatar.d.ts +46 -7
  6. package/dist/types/components/badge/badge.d.ts +21 -1
  7. package/dist/types/components/button/button.d.ts +15 -0
  8. package/dist/types/components/chart/chart.d.ts +10 -0
  9. package/dist/types/components/checklist/checklist.d.ts +9 -0
  10. package/dist/types/components/code-editor/code-editor.d.ts +6 -17
  11. package/dist/types/components/datebox/date-range-box.d.ts +5 -1
  12. package/dist/types/components/datebox/datebox.d.ts +7 -2
  13. package/dist/types/components/dialog/dialog.d.ts +46 -6
  14. package/dist/types/components/dropdown/dropdown.d.ts +2 -2
  15. package/dist/types/components/entity-ref/entity-ref.d.ts +2 -2
  16. package/dist/types/components/field/field.d.ts +24 -2
  17. package/dist/types/components/fieldset/fieldset.d.ts +19 -1
  18. package/dist/types/components/file-item/file-item.d.ts +34 -6
  19. package/dist/types/components/form/form.d.ts +12 -1
  20. package/dist/types/components/kanban-view/kanban-card.d.ts +8 -0
  21. package/dist/types/components/launcher/launcher.d.ts +260 -15
  22. package/dist/types/components/list-toolbar/list-toolbar.d.ts +1 -1
  23. package/dist/types/components/menu-button/menu-button.d.ts +33 -5
  24. package/dist/types/components/message/message.d.ts +119 -17
  25. package/dist/types/components/modal/modal.d.ts +13 -2
  26. package/dist/types/components/select/color.d.ts +12 -0
  27. package/dist/types/components/select/glyphs.d.ts +124 -0
  28. package/dist/types/components/select/select.d.ts +11 -3
  29. package/dist/types/components/stat-tile/stat-tile.d.ts +16 -5
  30. package/dist/types/components/tabbox/tabbox.d.ts +9 -0
  31. package/dist/types/components/table/table.d.ts +46 -1
  32. package/dist/types/components/tag-picker/tag-picker.d.ts +21 -4
  33. package/dist/types/components/tree/tree.d.ts +13 -0
  34. package/dist/types/core/breakpoint.d.ts +1 -1
  35. package/dist/types/core/icons.d.ts +23 -25
  36. package/dist/types/core/motion.d.ts +59 -0
  37. package/dist/types/core/overlay-host.d.ts +15 -1
  38. package/dist/types/index.d.ts +5 -3
  39. package/dist/types/zeyos/connect.d.ts +6 -0
  40. package/dist/types/zeyos/form.d.ts +50 -9
  41. package/dist/types/zeyos/index.d.ts +1 -1
  42. package/dist/types/zeyos/query.d.ts +79 -0
  43. package/dist/types/zeyos/schema.d.ts +24 -1
  44. package/dist/types/zeyos/table.d.ts +100 -14
  45. package/dist/types/zeyos/view.d.ts +10 -0
  46. package/dist/zx-zeyos.esm.js +1621 -443
  47. package/dist/zx-zeyos.esm.min.js +53 -5
  48. package/dist/zx.css +1411 -660
  49. package/dist/zx.esm.js +1976 -703
  50. package/dist/zx.esm.min.js +56 -8
  51. package/dist/zx.global.js +1978 -705
  52. package/dist/zx.global.min.js +56 -8
  53. package/dist/zx.min.css +1 -1
  54. package/docs/api.json +219 -34
  55. package/docs/llms.md +472 -110
  56. package/docs/llms.txt +3 -3
  57. package/package.json +1 -1
  58. package/src/components/account-menu/account-menu.css +35 -10
  59. package/src/components/activity-item/activity-item.css +1 -1
  60. package/src/components/activity-item/activity-item.js +3 -0
  61. package/src/components/activity-list/activity-list.css +38 -3
  62. package/src/components/activity-list/activity-list.js +34 -0
  63. package/src/components/app-icon/app-icon.css +1 -1
  64. package/src/components/app-rail/app-rail.css +40 -79
  65. package/src/components/app-sidebar/app-sidebar.css +109 -174
  66. package/src/components/app-sidebar/app-sidebar.js +21 -6
  67. package/src/components/aurora/aurora.css +5 -3
  68. package/src/components/avatar/avatar.css +32 -7
  69. package/src/components/avatar/avatar.js +72 -8
  70. package/src/components/badge/badge.css +54 -2
  71. package/src/components/badge/badge.js +29 -2
  72. package/src/components/button/button.css +67 -9
  73. package/src/components/button/button.js +38 -0
  74. package/src/components/calendar/calendar.css +46 -46
  75. package/src/components/card/card.css +2 -2
  76. package/src/components/card-view/card-view.css +9 -7
  77. package/src/components/chart/chart.css +4 -1
  78. package/src/components/chart/chart.js +12 -0
  79. package/src/components/check-button/check-button.css +10 -2
  80. package/src/components/checklist/checklist.css +9 -2
  81. package/src/components/checklist/checklist.js +11 -5
  82. package/src/components/checklist/field-adapter.js +3 -1
  83. package/src/components/code-editor/code-editor.css +6 -5
  84. package/src/components/code-editor/code-editor.js +19 -1
  85. package/src/components/context-menu/context-menu.css +9 -4
  86. package/src/components/copy/copy-button.css +6 -0
  87. package/src/components/copy/copy-input.css +8 -3
  88. package/src/components/data-filter/data-filter.css +5 -4
  89. package/src/components/date-picker/date-picker.css +6 -6
  90. package/src/components/date-picker/date-range-picker.css +3 -3
  91. package/src/components/date-picker/time-picker.css +1 -1
  92. package/src/components/datebox/date-range-box.css +79 -2
  93. package/src/components/datebox/date-range-box.js +13 -2
  94. package/src/components/datebox/datebox.css +79 -2
  95. package/src/components/datebox/datebox.js +13 -2
  96. package/src/components/dialog/dialog.css +26 -0
  97. package/src/components/dialog/dialog.js +99 -17
  98. package/src/components/dropdown/dropdown.css +1 -1
  99. package/src/components/dropdown/dropdown.js +5 -3
  100. package/src/components/empty-state/empty-state.css +2 -2
  101. package/src/components/entity-ref/entity-ref.css +1 -1
  102. package/src/components/entity-ref/entity-ref.js +1 -1
  103. package/src/components/field/field.css +28 -9
  104. package/src/components/field/field.js +68 -26
  105. package/src/components/field-upload/field-upload.css +1 -1
  106. package/src/components/fieldset/fieldset.css +5 -3
  107. package/src/components/fieldset/fieldset.js +28 -5
  108. package/src/components/file-item/file-item.js +144 -10
  109. package/src/components/filter/filter.js +7 -3
  110. package/src/components/filter-panel/filter-panel.css +1 -1
  111. package/src/components/finder/finder.css +15 -13
  112. package/src/components/form/form.css +5 -4
  113. package/src/components/form/form.js +11 -2
  114. package/src/components/grid/grid.css +1 -1
  115. package/src/components/groupbox/groupbox.css +1 -1
  116. package/src/components/kanban-view/kanban-card.js +11 -3
  117. package/src/components/kanban-view/kanban-view.css +39 -15
  118. package/src/components/kanban-view/kanban-view.js +4 -4
  119. package/src/components/launcher/launcher.css +107 -25
  120. package/src/components/launcher/launcher.js +503 -41
  121. package/src/components/list-toolbar/list-toolbar.css +13 -8
  122. package/src/components/list-toolbar/list-toolbar.js +1 -1
  123. package/src/components/master-panel/master-panel.css +2 -0
  124. package/src/components/menu-button/menu-button.css +9 -4
  125. package/src/components/menu-button/menu-button.js +65 -9
  126. package/src/components/message/message.css +33 -3
  127. package/src/components/message/message.js +217 -15
  128. package/src/components/modal/modal.js +18 -3
  129. package/src/components/navigation-bar/navigation-bar.css +18 -9
  130. package/src/components/number-field/field-adapter.js +1 -0
  131. package/src/components/number-field/number-field.css +70 -0
  132. package/src/components/number-field/number-field.js +2 -0
  133. package/src/components/pagination/pagination.css +8 -6
  134. package/src/components/panel/panel.css +1 -1
  135. package/src/components/rating/rating.css +7 -0
  136. package/src/components/select/color.js +22 -0
  137. package/src/components/select/field-adapter.js +2 -0
  138. package/src/components/select/glyphs.js +165 -0
  139. package/src/components/select/select.css +138 -45
  140. package/src/components/select/select.js +83 -47
  141. package/src/components/sheet/sheet.css +11 -8
  142. package/src/components/slider/slider.css +16 -2
  143. package/src/components/slider/slider.js +1 -1
  144. package/src/components/sort-control/sort-control.css +4 -1
  145. package/src/components/stat-tile/stat-tile.css +41 -46
  146. package/src/components/stat-tile/stat-tile.js +17 -6
  147. package/src/components/tabbox/tabbox.css +32 -27
  148. package/src/components/tabbox/tabbox.js +5 -1
  149. package/src/components/table/table.css +104 -29
  150. package/src/components/table/table.js +90 -16
  151. package/src/components/tag-picker/tag-picker.css +83 -5
  152. package/src/components/tag-picker/tag-picker.js +25 -8
  153. package/src/components/timebox/timebox.css +22 -2
  154. package/src/components/toggle/toggle.css +12 -1
  155. package/src/components/toolbar/toolbar.js +2 -2
  156. package/src/components/tooltip/tooltip.css +4 -0
  157. package/src/components/tooltip/tooltip.js +10 -3
  158. package/src/components/tree/tree.css +25 -16
  159. package/src/components/tree/tree.js +31 -0
  160. package/src/components/value-list/value-list.css +3 -3
  161. package/src/components/view/record-view.js +1 -1
  162. package/src/core/breakpoint.js +1 -1
  163. package/src/core/icons.js +193 -60
  164. package/src/core/motion.js +147 -0
  165. package/src/core/overlay-host.js +21 -2
  166. package/src/index.js +5 -3
  167. package/src/internal/app-rail.js +1 -2
  168. package/src/zeyos/connect.js +6 -2
  169. package/src/zeyos/form.js +67 -27
  170. package/src/zeyos/index.js +1 -1
  171. package/src/zeyos/query.js +153 -0
  172. package/src/zeyos/schema.js +144 -27
  173. package/src/zeyos/table.js +68 -5
  174. package/src/zeyos/view.js +6 -0
  175. package/styles/base.css +56 -0
  176. package/styles/icons.css +11 -1
  177. package/styles/tokens/dark.css +113 -37
  178. package/styles/tokens/global.css +121 -27
  179. package/styles/tokens/semantic.css +100 -31
  180. package/styles/tokens/themes.css +7 -6
  181. package/styles/zx.css +0 -1
  182. package/styles/tokens/density.css +0 -9
@@ -28,6 +28,23 @@ export type LauncherItem = {
28
28
  * Compact metadata.
29
29
  */
30
30
  badge?: string | number;
31
+ /**
32
+ * Muted text at the end of the row, such as a current value or a project.
33
+ */
34
+ hint?: string | number;
35
+ /**
36
+ * Key labels drawn as
37
+ * key caps (`['⌘', 'K']`), or Button's `{label, keys}` shape. Display only: the Launcher binds nothing.
38
+ */
39
+ shortcut?: string | string[] | {
40
+ label: string | string[];
41
+ keys?: string;
42
+ };
43
+ /**
44
+ * The same shortcut in `aria-keyshortcuts` syntax (`'Meta+K'`), exposed on
45
+ * the option for assistive technology.
46
+ */
47
+ keys?: string;
31
48
  /**
32
49
  * Tile or row presentation.
33
50
  */
@@ -72,6 +89,40 @@ export type LauncherItem = {
72
89
  * Whether activation is unavailable.
73
90
  */
74
91
  disabled?: boolean;
92
+ /**
93
+ * Child items. An item with `items` opens them
94
+ * as a page instead of being selected: an array, or a loader called with the page's query.
95
+ */
96
+ items?: LauncherItem[] | LauncherPageLoader;
97
+ /**
98
+ * Search-field placeholder while this item's page is open.
99
+ */
100
+ placeholder?: string;
101
+ /**
102
+ * For a page whose `items` is a loader: whether Zx ranks
103
+ * the loaded items by the query, or keeps the loader's order.
104
+ */
105
+ order?: 'rank' | 'source';
106
+ };
107
+ export type LauncherPageLoader = (query: string, context: {
108
+ signal: AbortSignal;
109
+ }) => LauncherItem[] | Promise<LauncherItem[]>;
110
+ export type LauncherOpenOptions = {
111
+ /**
112
+ * Opens straight into a page: the id of a local item
113
+ * with `items` (at any depth of array pages, whose path becomes the back stack), or a page item.
114
+ */
115
+ page?: string | number | LauncherItem;
116
+ };
117
+ export type LauncherPageDetail = {
118
+ /**
119
+ * The page now shown; null on the root.
120
+ */
121
+ page: LauncherItem | null;
122
+ /**
123
+ * Every open page from the root down, the shown one last.
124
+ */
125
+ path: LauncherItem[];
75
126
  };
76
127
  export type LauncherSource = {
77
128
  /**
@@ -160,6 +211,7 @@ export type LauncherOptions = {
160
211
  hints?: false | {
161
212
  move?: string;
162
213
  open?: string;
214
+ back?: string;
163
215
  close?: string;
164
216
  };
165
217
  /**
@@ -176,6 +228,10 @@ export type LauncherOptions = {
176
228
  onquery?: (event: CustomEvent<{
177
229
  query: string;
178
230
  }>) => void;
231
+ /**
232
+ * Page-navigation listener.
233
+ */
234
+ onpage?: (event: CustomEvent<LauncherPageDetail>) => void;
179
235
  /**
180
236
  * Open listener.
181
237
  */
@@ -187,21 +243,49 @@ export type LauncherOptions = {
187
243
  /**
188
244
  * Source error listener.
189
245
  */
190
- onerror?: (event: CustomEvent<{
191
- source: LauncherSource;
192
- error: unknown;
193
- }>) => void;
246
+ onerror?: (event: CustomEvent<LauncherErrorDetail>) => void;
194
247
  };
195
248
  export type LauncherSelectDetail = {
196
249
  item: LauncherItem;
197
250
  value: unknown;
198
251
  source: string | null;
199
252
  query: string;
253
+ page: LauncherItem | null;
254
+ };
255
+ export type LauncherErrorDetail = {
256
+ source: LauncherSource;
257
+ error: unknown;
258
+ page: LauncherItem | null;
200
259
  };
201
260
  export type RankedLauncherItem = LauncherItem & {
202
261
  _source?: string | null;
203
262
  _score?: number;
204
263
  };
264
+ export type LevelSource = LauncherSource & {
265
+ _page?: boolean;
266
+ };
267
+ export type LauncherPageEntry = {
268
+ /**
269
+ * The page item.
270
+ */
271
+ page: LauncherItem;
272
+ /**
273
+ * Its normalized local items (an array page).
274
+ */
275
+ items: LauncherItem[];
276
+ /**
277
+ * Its loader as a source (a loader page).
278
+ */
279
+ sources: LevelSource[];
280
+ /**
281
+ * The level beneath: its query, its highlighted option, and its loaded results when they were complete.
282
+ */
283
+ parent: {
284
+ query: string;
285
+ activeId: string | null;
286
+ sourceItems: Map<string, RankedLauncherItem[]> | null;
287
+ };
288
+ };
205
289
  /**
206
290
  * @typedef {Object} LauncherItem
207
291
  * @property {string|number} id Stable item identifier.
@@ -211,6 +295,11 @@ export type RankedLauncherItem = LauncherItem & {
211
295
  * @property {string} [group] Result group.
212
296
  * @property {string|Node|((item: LauncherItem) => Node|null)} [icon] Decorative icon name, node, or factory.
213
297
  * @property {string|number} [badge] Compact metadata.
298
+ * @property {string|number} [hint] Muted text at the end of the row, such as a current value or a project.
299
+ * @property {string|string[]|{label: string|string[], keys?: string}} [shortcut] Key labels drawn as
300
+ * key caps (`['⌘', 'K']`), or Button's `{label, keys}` shape. Display only: the Launcher binds nothing.
301
+ * @property {string} [keys] The same shortcut in `aria-keyshortcuts` syntax (`'Meta+K'`), exposed on
302
+ * the option for assistive technology.
214
303
  * @property {'application'|'record'|'action'} [kind='action'] Tile or row presentation.
215
304
  * @property {boolean} [current=false] Whether this is the current application or destination.
216
305
  * @property {'always'|'empty'|'query'} [when='always'] Query state in which the item is visible.
@@ -222,6 +311,26 @@ export type RankedLauncherItem = LauncherItem & {
222
311
  * @property {() => void} [invoke] Application-owned callback for non-link actions.
223
312
  * @property {boolean|number} [pinned] Pinned state or explicit pinned order.
224
313
  * @property {boolean} [disabled] Whether activation is unavailable.
314
+ * @property {LauncherItem[]|LauncherPageLoader} [items] Child items. An item with `items` opens them
315
+ * as a page instead of being selected: an array, or a loader called with the page's query.
316
+ * @property {string} [placeholder] Search-field placeholder while this item's page is open.
317
+ * @property {'rank'|'source'} [order='rank'] For a page whose `items` is a loader: whether Zx ranks
318
+ * the loaded items by the query, or keeps the loader's order.
319
+ */
320
+ /**
321
+ * Loads a page's items for its current query. It runs when the page opens and again, debounced, as
322
+ * the query changes; a newer query aborts `signal`.
323
+ * @typedef {(query: string, context: {signal: AbortSignal}) => LauncherItem[]|Promise<LauncherItem[]>} LauncherPageLoader
324
+ */
325
+ /**
326
+ * @typedef {Object} LauncherOpenOptions
327
+ * @property {string|number|LauncherItem} [page] Opens straight into a page: the id of a local item
328
+ * with `items` (at any depth of array pages, whose path becomes the back stack), or a page item.
329
+ */
330
+ /**
331
+ * @typedef {Object} LauncherPageDetail
332
+ * @property {LauncherItem|null} page The page now shown; null on the root.
333
+ * @property {LauncherItem[]} path Every open page from the root down, the shown one last.
225
334
  */
226
335
  /**
227
336
  * @typedef {Object} LauncherSource
@@ -247,20 +356,40 @@ export type RankedLauncherItem = LauncherItem & {
247
356
  * @property {string} [emptyText] Empty-state text. Omitted resolves `launcher.empty`, English `No results`.
248
357
  * @property {string} [loadingText] Loading-state text. Omitted resolves `launcher.loading`, English `Searching…`.
249
358
  * @property {'mod+k'|false} [shortcut='mod+k'] Optional global keyboard shortcut.
250
- * @property {false|{move?: string, open?: string, close?: string}} [hints] Visible keyboard hints, or false.
359
+ * @property {false|{move?: string, open?: string, back?: string, close?: string}} [hints] Visible keyboard hints, or false.
251
360
  * @property {Element|string|null} [scope=null] Element whose nearest Zx theme scope owns an internally created launcher; defaults to the opener.
252
361
  * @property {(event: CustomEvent<LauncherSelectDetail>) => void} [onselect] Preventable selection listener.
253
362
  * @property {(event: CustomEvent<{query: string}>) => void} [onquery] Query-change listener.
363
+ * @property {(event: CustomEvent<LauncherPageDetail>) => void} [onpage] Page-navigation listener.
254
364
  * @property {(event: CustomEvent<Record<string, never>>) => void} [onopen] Open listener.
255
365
  * @property {(event: CustomEvent<Record<string, never>>) => void} [onclose] Close listener.
256
- * @property {(event: CustomEvent<{source: LauncherSource, error: unknown}>) => void} [onerror] Source error listener.
366
+ * @property {(event: CustomEvent<LauncherErrorDetail>) => void} [onerror] Source error listener.
367
+ */
368
+ /**
369
+ * A selection. `page` is the page the item was chosen on, null on the root.
370
+ * @typedef {{item: LauncherItem, value: unknown, source: string|null, query: string, page: LauncherItem|null}} LauncherSelectDetail
371
+ */
372
+ /**
373
+ * A failed load. A page loader reports as a source whose id is `page:<page id>`, with `page` set.
374
+ * @typedef {{source: LauncherSource, error: unknown, page: LauncherItem|null}} LauncherErrorDetail
257
375
  */
258
- /** @typedef {{item: LauncherItem, value: unknown, source: string|null, query: string}} LauncherSelectDetail */
259
376
  /** @typedef {LauncherItem & {_source?: string|null, _score?: number}} RankedLauncherItem */
377
+ /** @typedef {LauncherSource & {_page?: boolean}} LevelSource */
378
+ /**
379
+ * One open page and the level beneath it, kept so going back restores that level as it was.
380
+ * @typedef {Object} LauncherPageEntry
381
+ * @property {LauncherItem} page The page item.
382
+ * @property {LauncherItem[]} items Its normalized local items (an array page).
383
+ * @property {LevelSource[]} sources Its loader as a source (a loader page).
384
+ * @property {{query: string, activeId: string|null, sourceItems: Map<string, RankedLauncherItem[]>|null}} parent
385
+ * The level beneath: its query, its highlighted option, and its loaded results when they were complete.
386
+ */
260
387
  /**
261
388
  * Abortable command/search dialog that emits application-owned actions without routing itself.
389
+ * Items with `items` open nested pages: an APG combobox whose listbox shows one page at a time.
262
390
  * @fires Launcher#select
263
391
  * @fires Launcher#query
392
+ * @fires Launcher#page
264
393
  * @fires Launcher#open
265
394
  * @fires Launcher#close
266
395
  * @fires Launcher#error
@@ -283,7 +412,15 @@ export declare class Launcher extends Component<LauncherOptions> {
283
412
  _requestSequence: number;
284
413
  _queryTimer: number;
285
414
  _busy: boolean;
415
+ _settled: boolean;
416
+ /** @type {LauncherPageEntry[]} */
417
+ _pages: LauncherPageEntry[];
418
+ _restoreActiveId: string;
419
+ _announcePending: boolean;
420
+ _announceToggle: boolean;
286
421
  _destroyed: boolean;
422
+ _label: string;
423
+ _placeholder: string;
287
424
  static cssName: string;
288
425
  /** @type {Readonly<LauncherOptions>} */
289
426
  static defaults: Readonly<LauncherOptions>;
@@ -295,8 +432,24 @@ export declare class Launcher extends Component<LauncherOptions> {
295
432
  constructor(target?: HTMLDialogElement | string | null, options?: LauncherOptions);
296
433
  /** @returns {HTMLDialogElement} */
297
434
  render(): HTMLDialogElement;
298
- /** Opens the launcher and focuses/selects its query. @returns {this} @fires Launcher#open */
299
- open(): this;
435
+ /**
436
+ * Opens the launcher and focuses/selects its query. It opens on the root unless `page` names one;
437
+ * already open, `page` navigates there.
438
+ * @param {LauncherOpenOptions} [options={}] Open options.
439
+ * @returns {this}
440
+ * @fires Launcher#open
441
+ * @fires Launcher#page
442
+ */
443
+ open(options?: LauncherOpenOptions): this;
444
+ /**
445
+ * Goes back one page, restoring the level beneath with its query and highlighted option. Does
446
+ * nothing on the root.
447
+ * @returns {this}
448
+ * @fires Launcher#page
449
+ */
450
+ back(): this;
451
+ /** Returns the page shown, or null on the root. @returns {LauncherItem|null} */
452
+ getPage(): LauncherItem | null;
300
453
  /** Closes the launcher. @returns {this} */
301
454
  close(): this;
302
455
  /** Toggles the launcher. @returns {this} */
@@ -309,18 +462,80 @@ export declare class Launcher extends Component<LauncherOptions> {
309
462
  setQuery(query: string): this;
310
463
  /** Returns the untrimmed query. @returns {string} */
311
464
  getQuery(): string;
312
- /** Replaces local catalogue items. @param {LauncherItem[]} items @returns {this} */
465
+ /** Replaces the root's local catalogue items; an open page keeps its own. @param {LauncherItem[]} items @returns {this} */
313
466
  setItems(items: LauncherItem[]): this;
314
467
  /** Marks one local item as the current destination. @param {string|number|null} id Item id. @returns {this} */
315
468
  setCurrent(id: string | number | null): this;
316
- /** Replaces asynchronous sources and aborts work from the old set. @param {LauncherSource[]} sources @returns {this} */
469
+ /** Replaces the root's asynchronous sources and aborts work from the old set; on a page they load once the root is back. @param {LauncherSource[]} sources @returns {this} */
317
470
  setSources(sources: LauncherSource[]): this;
318
471
  /** Aborts sources and removes the owned dialog. @returns {void} */
319
472
  destroy(): void;
320
- /** @returns {void} */
321
- _refresh(): void;
473
+ /**
474
+ * Re-renders the current level and reloads its sources: debounced while typing, at once when a
475
+ * page opens (so its loading state shows instead of a passing "No results").
476
+ * @param {boolean} [immediate=false] Load without the debounce.
477
+ * @returns {void}
478
+ */
479
+ _refresh(immediate?: boolean): void;
322
480
  /** @returns {Promise<void>} */
323
481
  _loadSources(): Promise<void>;
482
+ /**
483
+ * The level on screen: the root's items and sources, or the open page's.
484
+ * @returns {{items: LauncherItem[], sources: LevelSource[]}}
485
+ */
486
+ _level(): {
487
+ items: LauncherItem[];
488
+ sources: LevelSource[];
489
+ };
490
+ /**
491
+ * Opens a page on top of the current level: what the user activated, or ArrowRight on its row.
492
+ * @param {LauncherItem} item Page item.
493
+ * @returns {void}
494
+ */
495
+ _openPage(item: LauncherItem): void;
496
+ /**
497
+ * Replaces the whole stack with `path` (empty for the root) and refreshes what it lands on.
498
+ * @param {LauncherItem[]} path Pages from the root down.
499
+ * @param {{emit?: boolean}} [options={}] Whether to report a change through `page`.
500
+ * @returns {void}
501
+ */
502
+ _goTo(path: LauncherItem[], { emit }?: {
503
+ emit?: boolean;
504
+ }): void;
505
+ /** Pops every page, restoring the root's query, without rendering. @returns {void} */
506
+ _unwind(): void;
507
+ /**
508
+ * Pushes a page, remembering the level beneath, and clears the query for it.
509
+ * @param {LauncherItem} item Page item.
510
+ * @returns {void}
511
+ */
512
+ _pushPage(item: LauncherItem): void;
513
+ /**
514
+ * Pops the top page and restores the level beneath.
515
+ * @returns {boolean} Whether that level's results came back complete (no reload needed).
516
+ */
517
+ _popPage(): boolean;
518
+ /** @param {string} query @returns {void} */
519
+ _setInputQuery(query: string): void;
520
+ /**
521
+ * Shows the open page in the search row: the chip, the combobox name and placeholder, and the
522
+ * footer's Back hint.
523
+ * @returns {void}
524
+ */
525
+ _syncPage(): void;
526
+ /** @returns {void} @fires Launcher#page */
527
+ _emitPage(): void;
528
+ /**
529
+ * Resolves `open({ page })`: a page item as given, or the path to a local page by id.
530
+ * @param {string|number|LauncherItem} target Page id or item.
531
+ * @returns {LauncherItem[]}
532
+ */
533
+ _pagePath(target: string | number | LauncherItem): LauncherItem[];
534
+ /**
535
+ * The polite line a page change ends on: where the user is and how much is there.
536
+ * @returns {string}
537
+ */
538
+ _pageStatus(): string;
324
539
  /** @param {boolean} busy @returns {void} */
325
540
  _setBusy(busy: boolean): void;
326
541
  /** @returns {void} */
@@ -335,6 +550,14 @@ export declare class Launcher extends Component<LauncherOptions> {
335
550
  _syncActive(): void;
336
551
  /** @param {KeyboardEvent} event @returns {void} */
337
552
  _onKeydown(event: KeyboardEvent): void;
553
+ /**
554
+ * ArrowRight on a page row opens it once the caret is at the end of the query (before that it
555
+ * moves the caret); ArrowLeft on an empty query goes back. Application tiles keep both arrows
556
+ * for moving through their grid, which the caller tries first.
557
+ * @param {string} key ArrowLeft or ArrowRight.
558
+ * @returns {boolean} Whether the key navigated.
559
+ */
560
+ _pageKey(key: string): boolean;
338
561
  /** @param {string} direction @param {number[]} enabled @returns {number|null} */
339
562
  _spatialIndex(direction: string, enabled: number[]): number | null;
340
563
  /** @param {number} index @param {Event} event @returns {void} */
@@ -345,10 +568,31 @@ export declare class Launcher extends Component<LauncherOptions> {
345
568
  * Resolves a message through the host translator, falling back to the built-in English text.
346
569
  * @param {string} key Message key.
347
570
  * @param {string} fallback English default.
571
+ * @param {...unknown} args Positional `%1`, `%2` values.
348
572
  * @returns {string}
349
573
  */
350
- _message(key: string, fallback: string): string;
574
+ _message(key: string, fallback: string, ...args: unknown[]): string;
351
575
  }
576
+ /**
577
+ * Whether an item opens a page rather than being selected.
578
+ * @param {unknown} item Candidate item.
579
+ * @returns {boolean}
580
+ */
581
+ export declare function isLauncherPage(item: unknown): boolean;
582
+ /**
583
+ * Finds a page among local items by id, descending through array pages (a loader's items are not
584
+ * known until it runs).
585
+ * @param {LauncherItem[]} items Root items.
586
+ * @param {string|number} id Page item id.
587
+ * @returns {LauncherItem[]} The pages from the root down to the match, or an empty array.
588
+ */
589
+ export declare function findLauncherPage(items: LauncherItem[], id: string | number): LauncherItem[];
590
+ /**
591
+ * Normalizes an item's `shortcut` into the key labels drawn as caps.
592
+ * @param {unknown} shortcut `['⌘', 'K']`, one label, or `{label, keys}`.
593
+ * @returns {string[]}
594
+ */
595
+ export declare function launcherShortcutCaps(shortcut: unknown): string[];
352
596
  /**
353
597
  * Ranks launcher items using the current ZeyOS application tiers.
354
598
  * @param {RankedLauncherItem[]} items Items to rank.
@@ -366,6 +610,7 @@ export declare function rankLauncherItems(items: RankedLauncherItem[], query: st
366
610
  export declare function orderedLauncherSourceItems(sources: LauncherSource[], sourceItems: Map<string, RankedLauncherItem[]>): RankedLauncherItem[];
367
611
  /** Fired when a result is activated. @event Launcher#select @type {CustomEvent<LauncherSelectDetail>} */
368
612
  /** Fired when the query changes. @event Launcher#query @type {CustomEvent<{query: string}>} */
613
+ /** Fired after a page opens or closes, or `open()` lands on a different page. @event Launcher#page @type {CustomEvent<LauncherPageDetail>} */
369
614
  /** Fired after the dialog opens. @event Launcher#open @type {CustomEvent<Record<string, never>>} */
370
615
  /** Fired after the dialog closes. @event Launcher#close @type {CustomEvent<Record<string, never>>} */
371
- /** Fired when one asynchronous source fails. @event Launcher#error @type {CustomEvent<{source: LauncherSource, error: unknown}>} */
616
+ /** Fired when one asynchronous source or page loader fails. @event Launcher#error @type {CustomEvent<LauncherErrorDetail>} */
@@ -193,7 +193,7 @@ export type ListToolbarOptions = {
193
193
  * control, rather than found separately beside it.
194
194
  * - **The count line is a live region**, and `setCount(null)` clears it. The previous number
195
195
  * describes the previous filters, and a stale count during a load is worse than none.
196
- * - **Tool buttons meet the 44 px target** in both densities. An icon button sized to its glyph is
196
+ * - **Tool buttons meet the 44 px target** at any spacing. An icon button sized to its glyph is
197
197
  * the control people miss twice before hitting once.
198
198
  *
199
199
  * `bind()` is optional sugar; the toolbar is fully functional without it.
@@ -38,6 +38,14 @@ export type MenuButtonOptions = {
38
38
  */
39
39
  onclose?: (event: CustomEvent<Record<string, never>>) => void;
40
40
  };
41
+ export type MenuButtonOpenOptions = {
42
+ /**
43
+ * Where focus goes when this opening ends with a
44
+ * selection or Escape: `true` is the trigger, an element is that element (the trigger again if
45
+ * it has left the document), and `false` leaves focus alone.
46
+ */
47
+ returnFocus?: boolean | HTMLElement;
48
+ };
41
49
  /** @typedef {import('../../internal/menu-items.js').MenuItem} MenuItem */
42
50
  /** @typedef {import('../../internal/menu-items.js').MenuEntry} MenuButtonItem */
43
51
  /**
@@ -51,8 +59,18 @@ export type MenuButtonOptions = {
51
59
  * @property {(event: CustomEvent<Record<string, never>>) => void} [onopen] Open event listener.
52
60
  * @property {(event: CustomEvent<Record<string, never>>) => void} [onclose] Close event listener.
53
61
  */
62
+ /**
63
+ * @typedef {Object} MenuButtonOpenOptions
64
+ * @property {boolean|HTMLElement} [returnFocus=true] Where focus goes when this opening ends with a
65
+ * selection or Escape: `true` is the trigger, an element is that element (the trigger again if
66
+ * it has left the document), and `false` leaves focus alone.
67
+ */
54
68
  /**
55
69
  * APG menu-button trigger backed by an anchored Dropdown.
70
+ *
71
+ * Choosing an item closes the menu and puts focus back on the trigger before the `select` event
72
+ * and the item's `onselect` run, so whatever they open — a dialog, a sheet — records the trigger
73
+ * as the place to return to, and focus they move themselves stays where they put it.
56
74
  * @fires MenuButton#select
57
75
  * @fires MenuButton#open
58
76
  * @fires MenuButton#close
@@ -82,9 +100,11 @@ export declare class MenuButton extends Component<MenuButtonOptions> {
82
100
  setItems(items: MenuButtonItem[]): this;
83
101
  /**
84
102
  * Opens the menu.
103
+ * @param {MenuButtonOpenOptions} [options={}] Where focus returns when this opening ends; ignored
104
+ * while the menu is already open.
85
105
  * @returns {this}
86
106
  */
87
- open(): this;
107
+ open(options?: MenuButtonOpenOptions): this;
88
108
  /**
89
109
  * Closes the menu.
90
110
  * @returns {this}
@@ -99,10 +119,18 @@ export declare class MenuButton extends Component<MenuButtonOptions> {
99
119
  getTrigger(): HTMLElement;
100
120
  /** Returns the owned menu panel. @returns {HTMLElement} */
101
121
  getPanel(): HTMLElement;
102
- /** Opens the menu and focuses its first enabled item. @returns {this} */
103
- focusFirst(): this;
104
- /** Opens the menu and focuses its last enabled item. @returns {this} */
105
- focusLast(): this;
122
+ /**
123
+ * Opens the menu and focuses its first enabled item.
124
+ * @param {MenuButtonOpenOptions} [options={}] Passed to `open()`.
125
+ * @returns {this}
126
+ */
127
+ focusFirst(options?: MenuButtonOpenOptions): this;
128
+ /**
129
+ * Opens the menu and focuses its last enabled item.
130
+ * @param {MenuButtonOpenOptions} [options={}] Passed to `open()`.
131
+ * @returns {this}
132
+ */
133
+ focusLast(options?: MenuButtonOpenOptions): this;
106
134
  /**
107
135
  * Sets the visible trigger label.
108
136
  * @param {string} label Trigger label.