@zeyos/zx 4.3.0 → 4.4.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 (136) hide show
  1. package/CHANGELOG.md +266 -1
  2. package/README.md +7 -3
  3. package/dist/types/components/activity-item/activity-item.d.ts +351 -0
  4. package/dist/types/components/activity-list/activity-list.d.ts +195 -0
  5. package/dist/types/components/app-sidebar/app-sidebar.d.ts +28 -0
  6. package/dist/types/components/button/button.d.ts +8 -0
  7. package/dist/types/components/calendar/calendar-model.d.ts +22 -0
  8. package/dist/types/components/calendar/calendar.d.ts +19 -0
  9. package/dist/types/components/card/card.d.ts +7 -0
  10. package/dist/types/components/card-view/card-view.d.ts +12 -4
  11. package/dist/types/components/card-view/record-card.d.ts +53 -5
  12. package/dist/types/components/code-editor/code-editor.d.ts +160 -0
  13. package/dist/types/components/code-editor/field-adapter.d.ts +5 -0
  14. package/dist/types/components/context-menu/context-menu.d.ts +18 -2
  15. package/dist/types/components/date-picker/date-picker.d.ts +8 -0
  16. package/dist/types/components/date-picker/time-picker.d.ts +7 -0
  17. package/dist/types/components/dialog/dialog.d.ts +29 -0
  18. package/dist/types/components/entity-ref/entity-ref.d.ts +331 -0
  19. package/dist/types/components/file-item/file-item.d.ts +234 -0
  20. package/dist/types/components/file-list/file-list.d.ts +171 -0
  21. package/dist/types/components/filter/filter.d.ts +91 -36
  22. package/dist/types/components/filter-panel/filter-panel.d.ts +449 -0
  23. package/dist/types/components/kanban-view/kanban-card.d.ts +138 -0
  24. package/dist/types/components/kanban-view/kanban-policy.d.ts +268 -0
  25. package/dist/types/components/kanban-view/kanban-view.d.ts +837 -26
  26. package/dist/types/components/launcher/launcher.d.ts +19 -12
  27. package/dist/types/components/list-toolbar/list-toolbar.d.ts +599 -0
  28. package/dist/types/components/menu-button/menu-button.d.ts +4 -37
  29. package/dist/types/components/message/message.d.ts +7 -0
  30. package/dist/types/components/modal/modal.d.ts +48 -0
  31. package/dist/types/components/navigation-bar/navigation-bar.d.ts +105 -21
  32. package/dist/types/components/panel/panel.d.ts +7 -0
  33. package/dist/types/components/search/search.d.ts +7 -0
  34. package/dist/types/components/select/select.d.ts +4 -0
  35. package/dist/types/components/sort-control/sort-control.d.ts +105 -0
  36. package/dist/types/components/stat-tile/stat-tile.d.ts +277 -0
  37. package/dist/types/components/tabbox/tabbox.d.ts +7 -0
  38. package/dist/types/components/table/table.d.ts +144 -0
  39. package/dist/types/components/table-view/table-view.d.ts +11 -5
  40. package/dist/types/components/timebox/timebox.d.ts +7 -0
  41. package/dist/types/components/value-list/value-list.d.ts +8 -0
  42. package/dist/types/components/view/record-view.d.ts +96 -5
  43. package/dist/types/core/component.d.ts +6 -1
  44. package/dist/types/core/icons.d.ts +17 -0
  45. package/dist/types/index.d.ts +13 -1
  46. package/dist/types/internal/app-rail.d.ts +10 -0
  47. package/dist/types/internal/menu-items.d.ts +134 -0
  48. package/dist/zx-zeyos.esm.js +651 -88
  49. package/dist/zx-zeyos.esm.min.js +8 -1
  50. package/dist/zx.css +6266 -3900
  51. package/dist/zx.esm.js +8487 -1805
  52. package/dist/zx.esm.min.js +10 -3
  53. package/dist/zx.global.js +8487 -1805
  54. package/dist/zx.global.min.js +10 -3
  55. package/dist/zx.min.css +1 -1
  56. package/docs/api.json +1811 -247
  57. package/docs/llms.md +345 -40
  58. package/docs/llms.txt +11 -7
  59. package/package.json +1 -2
  60. package/src/components/activity-item/activity-item.css +137 -0
  61. package/src/components/activity-item/activity-item.js +599 -0
  62. package/src/components/activity-list/activity-list.css +64 -0
  63. package/src/components/activity-list/activity-list.js +375 -0
  64. package/src/components/app-rail/app-rail.css +227 -19
  65. package/src/components/app-sidebar/app-sidebar.css +414 -24
  66. package/src/components/app-sidebar/app-sidebar.js +65 -5
  67. package/src/components/button/button.css +8 -0
  68. package/src/components/button/button.js +6 -1
  69. package/src/components/calendar/calendar-model.js +45 -0
  70. package/src/components/calendar/calendar.css +30 -10
  71. package/src/components/calendar/calendar.js +41 -13
  72. package/src/components/card/card.js +12 -1
  73. package/src/components/card-view/card-view.css +212 -9
  74. package/src/components/card-view/card-view.js +32 -16
  75. package/src/components/card-view/record-card.js +98 -21
  76. package/src/components/code-editor/code-editor.css +67 -0
  77. package/src/components/code-editor/code-editor.js +288 -0
  78. package/src/components/code-editor/field-adapter.js +34 -0
  79. package/src/components/context-menu/context-menu.css +80 -3
  80. package/src/components/context-menu/context-menu.js +22 -30
  81. package/src/components/date-picker/date-picker.js +22 -8
  82. package/src/components/date-picker/month-picker.js +3 -3
  83. package/src/components/date-picker/time-picker.js +20 -8
  84. package/src/components/dialog/dialog.js +88 -66
  85. package/src/components/dropdown/dropdown.js +2 -2
  86. package/src/components/entity-ref/entity-ref.css +182 -0
  87. package/src/components/entity-ref/entity-ref.js +496 -0
  88. package/src/components/file-item/file-item.css +88 -0
  89. package/src/components/file-item/file-item.js +371 -0
  90. package/src/components/file-list/file-list.css +51 -0
  91. package/src/components/file-list/file-list.js +320 -0
  92. package/src/components/filter/filter.css +27 -1
  93. package/src/components/filter/filter.js +199 -45
  94. package/src/components/filter-panel/filter-panel.css +104 -0
  95. package/src/components/filter-panel/filter-panel.js +964 -0
  96. package/src/components/kanban-view/kanban-card.js +239 -0
  97. package/src/components/kanban-view/kanban-policy.js +412 -0
  98. package/src/components/kanban-view/kanban-view.css +674 -36
  99. package/src/components/kanban-view/kanban-view.js +1762 -240
  100. package/src/components/launcher/launcher.js +59 -27
  101. package/src/components/list-toolbar/list-toolbar.css +189 -0
  102. package/src/components/list-toolbar/list-toolbar.js +851 -0
  103. package/src/components/menu-button/menu-button.css +80 -3
  104. package/src/components/menu-button/menu-button.js +21 -37
  105. package/src/components/message/message.css +14 -12
  106. package/src/components/message/message.js +13 -2
  107. package/src/components/modal/modal.css +15 -0
  108. package/src/components/modal/modal.js +141 -0
  109. package/src/components/navigation-bar/navigation-bar.css +77 -2
  110. package/src/components/navigation-bar/navigation-bar.js +171 -4
  111. package/src/components/panel/panel.js +13 -2
  112. package/src/components/search/search.js +17 -5
  113. package/src/components/select/field-adapter.js +4 -1
  114. package/src/components/select/select.js +3 -0
  115. package/src/components/sort-control/sort-control.css +17 -0
  116. package/src/components/sort-control/sort-control.js +140 -0
  117. package/src/components/stat-tile/stat-tile.css +213 -0
  118. package/src/components/stat-tile/stat-tile.js +590 -0
  119. package/src/components/tabbox/tabbox.js +12 -1
  120. package/src/components/table/table.css +51 -2
  121. package/src/components/table/table.js +298 -19
  122. package/src/components/table-view/table-view.css +8 -2
  123. package/src/components/table-view/table-view.js +21 -6
  124. package/src/components/tag-picker/tag-picker.css +3 -1
  125. package/src/components/timebox/timebox.js +18 -5
  126. package/src/components/value-list/value-list.js +22 -6
  127. package/src/components/view/record-view.css +5 -0
  128. package/src/components/view/record-view.js +100 -7
  129. package/src/core/component.js +8 -3
  130. package/src/core/icons.js +74 -5
  131. package/src/index.js +33 -3
  132. package/src/internal/app-rail.js +19 -1
  133. package/src/internal/menu-items.js +142 -0
  134. package/styles/print.css +192 -0
  135. package/styles/zx.css +11 -0
  136. package/DESIGN-SYSTEM.md +0 -182
@@ -0,0 +1,351 @@
1
+ import { Component } from '../../core/component.js';
2
+ import { Avatar } from '../avatar/avatar.js';
3
+ export type ActivityContent = string | number | Node | Component | null;
4
+ export type AvatarOptions = import('../avatar/avatar.js').AvatarOptions;
5
+ export type ActivityAvatar = AvatarOptions | Element | null;
6
+ export type ActivityAction = {
7
+ /**
8
+ * Stable action identifier.
9
+ */
10
+ id: string | number;
11
+ /**
12
+ * Visible label.
13
+ */
14
+ label?: string;
15
+ /**
16
+ * Icon name.
17
+ */
18
+ icon?: string | null;
19
+ /**
20
+ * Optional safe native-link destination.
21
+ */
22
+ href?: string | null;
23
+ /**
24
+ * Native browsing context.
25
+ */
26
+ target?: string;
27
+ /**
28
+ * Native link relationship.
29
+ */
30
+ rel?: string;
31
+ /**
32
+ * Native title and icon-only accessible label.
33
+ */
34
+ title?: string;
35
+ /**
36
+ * Whether the action is unavailable.
37
+ */
38
+ disabled?: boolean;
39
+ /**
40
+ * Visual intent.
41
+ */
42
+ kind?: 'default' | 'primary' | 'danger' | 'ghost';
43
+ /**
44
+ * Host-owned activation callback.
45
+ */
46
+ onselect?: (event: MouseEvent) => void;
47
+ };
48
+ export type ActivityActionSlot = Element | ActivityAction;
49
+ export type NormalizedActivityAction = {
50
+ /**
51
+ * Stable action identifier.
52
+ */
53
+ id: string;
54
+ /**
55
+ * Visible label.
56
+ */
57
+ label: string;
58
+ /**
59
+ * Icon name.
60
+ */
61
+ icon: string | null;
62
+ /**
63
+ * Safe native-link destination.
64
+ */
65
+ href: string | null;
66
+ /**
67
+ * Native browsing context.
68
+ */
69
+ target: string | undefined;
70
+ /**
71
+ * Native link relationship.
72
+ */
73
+ rel: string | undefined;
74
+ /**
75
+ * Native title.
76
+ */
77
+ title: string | undefined;
78
+ /**
79
+ * Whether the action is unavailable.
80
+ */
81
+ disabled: boolean;
82
+ /**
83
+ * Visual intent.
84
+ */
85
+ kind: 'default' | 'primary' | 'danger' | 'ghost';
86
+ /**
87
+ * Host callback.
88
+ */
89
+ onselect: ((event: MouseEvent) => void) | undefined;
90
+ };
91
+ export type ActivityTime = {
92
+ /**
93
+ * Machine-readable ISO timestamp when valid.
94
+ */
95
+ dateTime: string | null;
96
+ /**
97
+ * Human-readable timestamp.
98
+ */
99
+ label: string;
100
+ };
101
+ export type ActivityState = 'default' | 'pending' | 'failed';
102
+ export type ActivityStateDescriptor = {
103
+ /**
104
+ * Resolved state.
105
+ */
106
+ state: ActivityState;
107
+ /**
108
+ * Whether the entry is still waiting on its request.
109
+ */
110
+ busy: boolean;
111
+ /**
112
+ * Message key for the built-in word, or null when no badge is shown.
113
+ */
114
+ key: string | null;
115
+ /**
116
+ * Built-in English word, or null when no badge is shown.
117
+ */
118
+ fallback: string | null;
119
+ /**
120
+ * Badge intent.
121
+ */
122
+ kind: 'neutral' | 'danger';
123
+ /**
124
+ * Host-supplied word replacing the built-in one.
125
+ */
126
+ label: string | null;
127
+ };
128
+ export type ActivityItemOptions = {
129
+ /**
130
+ * Host-owned activity identifier.
131
+ */
132
+ id?: unknown;
133
+ /**
134
+ * Actor identity text or presentation slot.
135
+ */
136
+ actor?: ActivityContent;
137
+ /**
138
+ * Avatar descriptor or host-owned avatar element.
139
+ */
140
+ avatar?: ActivityAvatar;
141
+ /**
142
+ * Activity summary.
143
+ */
144
+ title?: ActivityContent;
145
+ /**
146
+ * Optional body slot.
147
+ */
148
+ content?: ActivityContent;
149
+ /**
150
+ * Date, parseable date string, or epoch milliseconds.
151
+ */
152
+ timestamp?: Date | string | number | null;
153
+ /**
154
+ * Explicit human-readable timestamp.
155
+ */
156
+ timeLabel?: string | null;
157
+ /**
158
+ * Compact metadata slots.
159
+ */
160
+ metadata?: ActivityContent[];
161
+ /**
162
+ * Attachment presentation slots, commonly FileItem elements.
163
+ */
164
+ attachments?: ActivityContent[];
165
+ /**
166
+ * Native action descriptors or host-owned controls.
167
+ */
168
+ actions?: ActivityActionSlot[];
169
+ /**
170
+ * Product-neutral activity kind exposed as `data-kind`.
171
+ */
172
+ kind?: string;
173
+ /**
174
+ * Delivery state exposed as `data-state`.
175
+ */
176
+ state?: ActivityState;
177
+ /**
178
+ * Word shown in the state badge instead of the built-in one.
179
+ */
180
+ stateLabel?: string | null;
181
+ /**
182
+ * Semantic heading level for the activity summary.
183
+ */
184
+ headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
185
+ onaction?: (event: CustomEvent<{
186
+ id: string;
187
+ action: NormalizedActivityAction;
188
+ event: MouseEvent;
189
+ }>) => void;
190
+ };
191
+ /** @typedef {string|number|Node|Component|null} ActivityContent */
192
+ /** @typedef {import('../avatar/avatar.js').AvatarOptions} AvatarOptions */
193
+ /** @typedef {AvatarOptions|Element|null} ActivityAvatar */
194
+ /**
195
+ * @typedef {Object} ActivityAction
196
+ * @property {string|number} id Stable action identifier.
197
+ * @property {string} [label=''] Visible label.
198
+ * @property {string|null} [icon=null] Icon name.
199
+ * @property {string|null} [href=null] Optional safe native-link destination.
200
+ * @property {string} [target] Native browsing context.
201
+ * @property {string} [rel] Native link relationship.
202
+ * @property {string} [title] Native title and icon-only accessible label.
203
+ * @property {boolean} [disabled=false] Whether the action is unavailable.
204
+ * @property {'default'|'primary'|'danger'|'ghost'} [kind='ghost'] Visual intent.
205
+ * @property {(event:MouseEvent)=>void} [onselect] Host-owned activation callback.
206
+ */
207
+ /** @typedef {Element|ActivityAction} ActivityActionSlot */
208
+ /**
209
+ * @typedef {Object} NormalizedActivityAction
210
+ * @property {string} id Stable action identifier.
211
+ * @property {string} label Visible label.
212
+ * @property {string|null} icon Icon name.
213
+ * @property {string|null} href Safe native-link destination.
214
+ * @property {string|undefined} target Native browsing context.
215
+ * @property {string|undefined} rel Native link relationship.
216
+ * @property {string|undefined} title Native title.
217
+ * @property {boolean} disabled Whether the action is unavailable.
218
+ * @property {'default'|'primary'|'danger'|'ghost'} kind Visual intent.
219
+ * @property {((event:MouseEvent)=>void)|undefined} onselect Host callback.
220
+ */
221
+ /**
222
+ * @typedef {Object} ActivityTime
223
+ * @property {string|null} dateTime Machine-readable ISO timestamp when valid.
224
+ * @property {string} label Human-readable timestamp.
225
+ */
226
+ /** @typedef {'default'|'pending'|'failed'} ActivityState Delivery state of one entry. */
227
+ /**
228
+ * @typedef {Object} ActivityStateDescriptor
229
+ * @property {ActivityState} state Resolved state.
230
+ * @property {boolean} busy Whether the entry is still waiting on its request.
231
+ * @property {string|null} key Message key for the built-in word, or null when no badge is shown.
232
+ * @property {string|null} fallback Built-in English word, or null when no badge is shown.
233
+ * @property {'neutral'|'danger'} kind Badge intent.
234
+ * @property {string|null} label Host-supplied word replacing the built-in one.
235
+ */
236
+ /**
237
+ * @typedef {Object} ActivityItemOptions
238
+ * @property {unknown} [id=null] Host-owned activity identifier.
239
+ * @property {ActivityContent} [actor=''] Actor identity text or presentation slot.
240
+ * @property {ActivityAvatar} [avatar=null] Avatar descriptor or host-owned avatar element.
241
+ * @property {ActivityContent} [title=''] Activity summary.
242
+ * @property {ActivityContent} [content=null] Optional body slot.
243
+ * @property {Date|string|number|null} [timestamp=null] Date, parseable date string, or epoch milliseconds.
244
+ * @property {string|null} [timeLabel=null] Explicit human-readable timestamp.
245
+ * @property {ActivityContent[]} [metadata=[]] Compact metadata slots.
246
+ * @property {ActivityContent[]} [attachments=[]] Attachment presentation slots, commonly FileItem elements.
247
+ * @property {ActivityActionSlot[]} [actions=[]] Native action descriptors or host-owned controls.
248
+ * @property {string} [kind='default'] Product-neutral activity kind exposed as `data-kind`.
249
+ * @property {ActivityState} [state='default'] Delivery state exposed as `data-state`.
250
+ * @property {string|null} [stateLabel=null] Word shown in the state badge instead of the built-in one.
251
+ * @property {1|2|3|4|5|6} [headingLevel=3] Semantic heading level for the activity summary.
252
+ * @property {(event:CustomEvent<{id:string,action:NormalizedActivityAction,event:MouseEvent}>)=>void} [onaction]
253
+ */
254
+ /**
255
+ * One chronological activity entry with safe content slots, timestamp semantics, and native
256
+ * actions. Posting, reactions, routing, permissions, persistence, and content sanitization remain
257
+ * host responsibilities; server HTML is never interpreted by this component.
258
+ *
259
+ * @fires ActivityItem#action
260
+ * @extends {Component<ActivityItemOptions>}
261
+ */
262
+ export declare class ActivityItem extends Component<ActivityItemOptions> {
263
+ _createdRoot: boolean;
264
+ _original: import("../../core/dom.js").TargetSnapshot;
265
+ _cleaned: boolean;
266
+ _headingId: string;
267
+ _avatarComponent: Avatar;
268
+ _actionsByKey: Map<any, any>;
269
+ _activity: ActivityItemOptions;
270
+ static cssName: string;
271
+ /** @type {Readonly<ActivityItemOptions>} */
272
+ static defaults: Readonly<ActivityItemOptions>;
273
+ /**
274
+ * Creates or enhances an activity item.
275
+ * @param {Element|string|null} [target=null] Existing list item/container, selector, or null.
276
+ * @param {ActivityItemOptions} [options={}] Activity presentation options.
277
+ */
278
+ constructor(target?: Element | string | null, options?: ActivityItemOptions);
279
+ /** @returns {HTMLElement} */
280
+ render(): HTMLElement;
281
+ /**
282
+ * Replaces any subset of the activity presentation.
283
+ * @param {Partial<ActivityItemOptions>} values New values.
284
+ * @returns {this}
285
+ */
286
+ setActivity(values?: Partial<ActivityItemOptions>): this;
287
+ /** Returns a shallow, host-safe copy of the current descriptor. @returns {ActivityItemOptions} */
288
+ getActivity(): ActivityItemOptions;
289
+ /** Restores an enhanced target exactly, or removes an owned item. @returns {void} */
290
+ destroy(): void;
291
+ /** @private @returns {void} */
292
+ private _renderActivity;
293
+ /**
294
+ * Builds the delivery badge, or nothing for an ordinary entry.
295
+ * @private
296
+ * @param {ActivityStateDescriptor} state Resolved state.
297
+ * @returns {HTMLElement|null}
298
+ */
299
+ private _createStateBadge;
300
+ /** @private @param {ActivityAvatar} value @param {ActivityContent} actor @returns {Element|null} */
301
+ private _createAvatar;
302
+ /** @private @param {ActivityActionSlot[]} value @returns {HTMLElement|null} */
303
+ private _createActions;
304
+ /**
305
+ * Resolves a message through the host translator, falling back to the built-in English text.
306
+ * @param {string} key Message key.
307
+ * @param {string} fallback Built-in text, with `%1`-style placeholders.
308
+ * @param {...unknown} args Interpolation values.
309
+ * @returns {string}
310
+ */
311
+ _message(key: string, fallback: string, ...args: unknown[]): string;
312
+ /** @private @param {MouseEvent} event @returns {void} */
313
+ private _onClick;
314
+ }
315
+ /**
316
+ * Normalizes action descriptors without mutating the caller's array or objects. Invalid entries
317
+ * and duplicate descriptor IDs are discarded; host-owned Elements pass through unchanged.
318
+ * @param {unknown} value Candidate action array.
319
+ * @returns {Array<Element|NormalizedActivityAction>}
320
+ */
321
+ export declare function resolveActivityActions(value: unknown): Array<Element | NormalizedActivityAction>;
322
+ /**
323
+ * Normalizes one action descriptor and rejects unsafe native destinations.
324
+ * @param {unknown} value Candidate action.
325
+ * @returns {NormalizedActivityAction|null}
326
+ */
327
+ export declare function normalizeActivityAction(value: unknown): NormalizedActivityAction | null;
328
+ /**
329
+ * Resolves the delivery state of one entry.
330
+ *
331
+ * `failed` is a first-class state and not the absence of `pending`: an optimistic entry that
332
+ * simply disappears when its request fails tells the customer their message was sent when nobody
333
+ * was told, so the component keeps the entry and says what happened to it.
334
+ * @param {unknown} state Requested state.
335
+ * @param {unknown} stateLabel Host-supplied word replacing the built-in one.
336
+ * @returns {ActivityStateDescriptor}
337
+ */
338
+ export declare function resolveActivityState(state: unknown, stateLabel: unknown): ActivityStateDescriptor;
339
+ /**
340
+ * Resolves a timestamp for native `<time>` markup without treating invalid input as a real date.
341
+ * @param {Date|string|number|null|undefined} timestamp Date-like value.
342
+ * @param {string|null|undefined} timeLabel Explicit display label.
343
+ * @returns {ActivityTime|null}
344
+ */
345
+ export declare function normalizeActivityTimestamp(timestamp: Date | string | number | null | undefined, timeLabel: string | null | undefined): ActivityTime | null;
346
+ /**
347
+ * Activity action selected before the host callback or native navigation runs. Cancellation from
348
+ * either the component event or bubbling `zx-action` event prevents both callback and navigation.
349
+ * @event ActivityItem#action
350
+ * @type {CustomEvent<{id:string,action:NormalizedActivityAction,event:MouseEvent}>}
351
+ */
@@ -0,0 +1,195 @@
1
+ import { Component } from '../../core/component.js';
2
+ export type ActivityItemOptions = import('../activity-item/activity-item.js').ActivityItemOptions;
3
+ export type ActivityListContent = string | number | Node | Component | null;
4
+ export type ActivityGroupReader = string | ((item: ActivityItemOptions, index: number) => unknown) | null;
5
+ export type ActivityGroupLabel = (group: unknown, items: ActivityItemOptions[]) => ActivityListContent;
6
+ export type ActivityGroup = {
7
+ /**
8
+ * Group identity returned by the configured reader.
9
+ */
10
+ id: unknown;
11
+ /**
12
+ * Activities in stable source order.
13
+ */
14
+ items: ActivityItemOptions[];
15
+ };
16
+ export type ActivityListOptions = {
17
+ /**
18
+ * Initial activities in host-supplied chronological order.
19
+ */
20
+ items?: ActivityItemOptions[];
21
+ /**
22
+ * Property or resolver used for stable grouping.
23
+ */
24
+ groupBy?: ActivityGroupReader;
25
+ /**
26
+ * Group-heading renderer.
27
+ */
28
+ groupLabel?: ActivityGroupLabel | null;
29
+ /**
30
+ * Accessible collection name.
31
+ */
32
+ label?: string;
33
+ /**
34
+ * Whether initial or incremental activity is loading.
35
+ */
36
+ loading?: boolean;
37
+ /**
38
+ * Placeholder rows shown for an empty loading list.
39
+ */
40
+ loadingCount?: number;
41
+ /**
42
+ * Loading status text.
43
+ */
44
+ loadingText?: string;
45
+ /**
46
+ * Empty-state content.
47
+ */
48
+ emptyText?: ActivityListContent;
49
+ /**
50
+ * Semantic group-heading level.
51
+ */
52
+ groupHeadingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
53
+ /**
54
+ * Default item-heading level.
55
+ */
56
+ itemHeadingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
57
+ ondatachange?: (event: CustomEvent<{
58
+ items: ActivityItemOptions[];
59
+ }>) => void;
60
+ };
61
+ /** @typedef {import('../activity-item/activity-item.js').ActivityItemOptions} ActivityItemOptions */
62
+ /** @typedef {string|number|Node|Component|null} ActivityListContent */
63
+ /** @typedef {string|((item:ActivityItemOptions,index:number)=>unknown)|null} ActivityGroupReader */
64
+ /** @typedef {(group:unknown,items:ActivityItemOptions[])=>ActivityListContent} ActivityGroupLabel */
65
+ /**
66
+ * @typedef {Object} ActivityGroup
67
+ * @property {unknown} id Group identity returned by the configured reader.
68
+ * @property {ActivityItemOptions[]} items Activities in stable source order.
69
+ */
70
+ /**
71
+ * @typedef {Object} ActivityListOptions
72
+ * @property {ActivityItemOptions[]} [items=[]] Initial activities in host-supplied chronological order.
73
+ * @property {ActivityGroupReader} [groupBy=null] Property or resolver used for stable grouping.
74
+ * @property {ActivityGroupLabel|null} [groupLabel=null] Group-heading renderer.
75
+ * @property {string} [label='Activity'] Accessible collection name.
76
+ * @property {boolean} [loading=false] Whether initial or incremental activity is loading.
77
+ * @property {number} [loadingCount=3] Placeholder rows shown for an empty loading list.
78
+ * @property {string} [loadingText='Loading activity'] Loading status text.
79
+ * @property {ActivityListContent} [emptyText='No activity yet'] Empty-state content.
80
+ * @property {1|2|3|4|5|6} [groupHeadingLevel=2] Semantic group-heading level.
81
+ * @property {1|2|3|4|5|6} [itemHeadingLevel=3] Default item-heading level.
82
+ * @property {(event:CustomEvent<{items:ActivityItemOptions[]}>)=>void} [ondatachange]
83
+ */
84
+ /**
85
+ * Accessible chronological activity collection with stable grouping, loading/empty states, and
86
+ * incremental update methods. Ordering stays host-controlled so paginated and live server results
87
+ * are never silently re-sorted. Item `zx-action` events bubble through the list naturally.
88
+ *
89
+ * @fires ActivityList#datachange
90
+ * @extends {Component<ActivityListOptions>}
91
+ */
92
+ export declare class ActivityList extends Component<ActivityListOptions> {
93
+ _createdRoot: boolean;
94
+ _original: import("../../core/dom.js").TargetSnapshot;
95
+ _cleaned: boolean;
96
+ _items: any;
97
+ _loading: any;
98
+ _itemComponents: any[];
99
+ _groupSequence: number;
100
+ static cssName: string;
101
+ /** @type {Readonly<ActivityListOptions>} */
102
+ static defaults: Readonly<ActivityListOptions>;
103
+ /**
104
+ * Creates or enhances an activity collection.
105
+ * @param {Element|string|null} [target=null] Existing container, selector, or null.
106
+ * @param {ActivityListOptions} [options={}] Collection options.
107
+ */
108
+ constructor(target?: Element | string | null, options?: ActivityListOptions);
109
+ /** @returns {HTMLElement} */
110
+ render(): HTMLElement;
111
+ /**
112
+ * Replaces all activities.
113
+ * @param {ActivityItemOptions[]} items Activities in desired chronological order.
114
+ * @param {{silent?:boolean}} [options={}] Event behavior.
115
+ * @returns {this}
116
+ */
117
+ setItems(items: ActivityItemOptions[], options?: {
118
+ silent?: boolean;
119
+ }): this;
120
+ /** Returns shallow descriptor copies in current display order. @returns {ActivityItemOptions[]} */
121
+ getItems(): ActivityItemOptions[];
122
+ /** Returns a shallow descriptor copy by stable host ID. @param {unknown} id @returns {ActivityItemOptions|null} */
123
+ getItem(id: unknown): ActivityItemOptions | null;
124
+ /**
125
+ * Adds activities after the current source order for older-page or forward-stream updates.
126
+ * @param {ActivityItemOptions|ActivityItemOptions[]} items New activities.
127
+ * @param {{silent?:boolean}} [options={}] Event behavior.
128
+ * @returns {this}
129
+ */
130
+ appendItems(items: ActivityItemOptions | ActivityItemOptions[], options?: {
131
+ silent?: boolean;
132
+ }): this;
133
+ /**
134
+ * Adds activities before the current source order for newest-first live updates.
135
+ * @param {ActivityItemOptions|ActivityItemOptions[]} items New activities.
136
+ * @param {{silent?:boolean}} [options={}] Event behavior.
137
+ * @returns {this}
138
+ */
139
+ prependItems(items: ActivityItemOptions | ActivityItemOptions[], options?: {
140
+ silent?: boolean;
141
+ }): this;
142
+ /**
143
+ * Patches the first activity whose ID is `Object.is`-equal to the requested ID.
144
+ * @param {unknown} id Stable host identifier.
145
+ * @param {Partial<ActivityItemOptions>} values Replacement fields.
146
+ * @param {{silent?:boolean}} [options={}] Event behavior.
147
+ * @returns {this}
148
+ */
149
+ updateItem(id: unknown, values: Partial<ActivityItemOptions>, options?: {
150
+ silent?: boolean;
151
+ }): this;
152
+ /**
153
+ * Removes the first activity whose ID is `Object.is`-equal to the requested ID.
154
+ * @param {unknown} id Stable host identifier.
155
+ * @param {{silent?:boolean}} [options={}] Event behavior.
156
+ * @returns {this}
157
+ */
158
+ removeItem(id: unknown, options?: {
159
+ silent?: boolean;
160
+ }): this;
161
+ /** Sets initial/incremental loading presentation. @param {boolean} loading @returns {this} */
162
+ setLoading(loading: boolean): this;
163
+ /** Restores an enhanced target exactly, or removes an owned list. @returns {void} */
164
+ destroy(): void;
165
+ /** @private @returns {void} */
166
+ private _renderList;
167
+ /** @private @param {ActivityGroup} group @param {boolean} grouped @returns {HTMLElement} */
168
+ private _createGroup;
169
+ /** @private @param {boolean} placeholders @returns {HTMLElement} */
170
+ private _createLoading;
171
+ /** @private @returns {void} */
172
+ private _destroyItems;
173
+ /** @private @returns {void} */
174
+ private _emitDataChange;
175
+ }
176
+ /**
177
+ * Groups descriptors in first-seen group order while preserving source order within every group.
178
+ * A null reader returns one ungrouped collection. Neither descriptors nor the input array mutate.
179
+ * @param {ActivityItemOptions[]} items Activity descriptors.
180
+ * @param {ActivityGroupReader} groupBy Group reader.
181
+ * @returns {ActivityGroup[]}
182
+ */
183
+ export declare function groupActivityItems(items: ActivityItemOptions[], groupBy?: ActivityGroupReader): ActivityGroup[];
184
+ /**
185
+ * Validates and shallow-clones activity descriptors, including each slot array. Explicit
186
+ * duplicate IDs are rejected while id-less entries remain valid.
187
+ * @param {unknown} value Candidate descriptor array.
188
+ * @returns {ActivityItemOptions[]}
189
+ */
190
+ export declare function normalizeActivityItems(value: unknown): ActivityItemOptions[];
191
+ /**
192
+ * Activity descriptors changed through a list mutation method.
193
+ * @event ActivityList#datachange
194
+ * @type {CustomEvent<{items:ActivityItemOptions[]}>}
195
+ */
@@ -220,6 +220,16 @@ export declare class AppSidebar extends Component<AppSidebarOptions> {
220
220
  _renderExpanded(): void;
221
221
  /** @returns {void} */
222
222
  _renderRail(): void;
223
+ /**
224
+ * Keeps a minimized rail's counts readable and audible.
225
+ *
226
+ * A rail destination is icon-only, so its accessible name is the label alone and the badge the
227
+ * expanded tree showed as text is announced by nothing. Here the figure is folded back into the
228
+ * name, and `data-zx-badge` tells the stylesheet whether the count still fits the target or has
229
+ * to be drawn as a dot. Presentation only: no item, option, event, or listener is touched.
230
+ * @returns {void}
231
+ */
232
+ _decorateRail(): void;
223
233
  /** @param {EventTarget} target @param {string} type @param {EventListener} listener @returns {void} */
224
234
  _listenMode(target: EventTarget, type: string, listener: EventListener): void;
225
235
  /** @returns {void} */
@@ -234,6 +244,24 @@ export declare class AppSidebar extends Component<AppSidebarOptions> {
234
244
  _select(item: AppNavItem, event: Event): void;
235
245
  /** @returns {void} */
236
246
  _syncActive(): void;
247
+ /**
248
+ * Flags the sublist a branch toggle just opened so the stylesheet can animate that one branch.
249
+ *
250
+ * `_renderTree()` rebuilds every row on every toggle, so a transition declared on the sublist
251
+ * alone would replay on branches that never moved. The attribute is written after the rebuild
252
+ * and disappears with the element on the next one, which is why it needs no teardown.
253
+ * @param {string} key Branch id as a string.
254
+ * @returns {void}
255
+ */
256
+ _markBranchMotion(key: string): void;
257
+ /**
258
+ * Resolves a message through the host translator, falling back to the built-in English text.
259
+ * @param {string} key Message key.
260
+ * @param {string} fallback Built-in text, with `%1`-style placeholders.
261
+ * @param {...unknown} args Interpolation values.
262
+ * @returns {string}
263
+ */
264
+ _message(key: string, fallback: string, ...args: unknown[]): string;
237
265
  /** @returns {void} */
238
266
  _reconcileExpanded(): void;
239
267
  }
@@ -1,3 +1,7 @@
1
+ export type ButtonShortcut = {
2
+ label: string;
3
+ keys: string;
4
+ };
1
5
  export type ButtonOptions = {
2
6
  /**
3
7
  * Visible button label.
@@ -23,6 +27,10 @@ export type ButtonOptions = {
23
27
  * Native title text.
24
28
  */
25
29
  title?: string;
30
+ /**
31
+ * Keyboard hint; does not register a keyboard handler.
32
+ */
33
+ shortcut?: ButtonShortcut;
26
34
  /**
27
35
  * Click callback.
28
36
  */
@@ -128,6 +128,28 @@ export declare function calendarRange(view: CalendarView, anchor: Date, options?
128
128
  start: Date;
129
129
  end: Date;
130
130
  };
131
+ /**
132
+ * Returns the anchor date one visible period away from `anchor`.
133
+ *
134
+ * Month and year steps clamp the day of month into the target month instead of letting it
135
+ * overflow: `setMonth()` alone turns 31 January into 3 March, which makes February unreachable
136
+ * from a month-end anchor and leaves `prev()` on 31 March landing back inside March.
137
+ * @param {CalendarView} view Current view.
138
+ * @param {Date} anchor Current anchor date.
139
+ * @param {number} direction -1 for the previous period, 1 for the next.
140
+ * @param {{agendaDays?: number}} [options={}] Paging options.
141
+ * @returns {Date}
142
+ */
143
+ export declare function calendarPageDate(view: CalendarView, anchor: Date, direction: number, options?: {
144
+ agendaDays?: number;
145
+ }): Date;
146
+ /**
147
+ * Adds whole months, clamping the day of month to the last day the target month actually has.
148
+ * @param {Date} value Local date.
149
+ * @param {number} months Months to add.
150
+ * @returns {Date}
151
+ */
152
+ export declare function addCalendarMonths(value: Date, months: number): Date;
131
153
  /**
132
154
  * Normalizes caller records atomically into the Calendar event contract.
133
155
  * @param {Record<string, any>[]} records Source records.
@@ -504,6 +504,25 @@ export declare class Calendar extends Component<CalendarOptions> {
504
504
  _refreshNowIndicator(): void;
505
505
  /** @param {string} message @returns {void} */
506
506
  _announce(message: string): void;
507
+ /**
508
+ * Names a month or year cell by its date and how many events it holds. Singular and plural are
509
+ * separate keys because a language that inflects the noun cannot reach it from one template.
510
+ * @param {Date} day Day the cell stands for.
511
+ * @param {number} count Events on that day.
512
+ * @returns {string}
513
+ */
514
+ _dayCountLabel(day: Date, count: number): string;
515
+ /**
516
+ * Resolves a message through the host translator, falling back to the built-in English text.
517
+ *
518
+ * Distinct from `msg()`: the built-in `msg` option answers the calendar's own vocabulary, so a
519
+ * dotted key falls past it to the host translator, which is what these strings never had.
520
+ * @param {string} key Message key.
521
+ * @param {string} fallback Built-in text, with `%1`-style placeholders.
522
+ * @param {...unknown} args Interpolation values.
523
+ * @returns {string}
524
+ */
525
+ _message(key: string, fallback: string, ...args: unknown[]): string;
507
526
  }
508
527
  /** @event Calendar#viewchange @type {CustomEvent<{view: CalendarView, oldView: CalendarView}>} */
509
528
  /** @event Calendar#dateschange @type {CustomEvent<{view: CalendarView, start: Date, end: Date}>} */
@@ -125,4 +125,11 @@ export declare class Card extends Component<CardOptions> {
125
125
  _renderHeading(): void;
126
126
  /** @returns {void} */
127
127
  _syncHeader(): void;
128
+ /**
129
+ * Resolves a message through the host translator, falling back to the built-in English text.
130
+ * @param {string} key Message key.
131
+ * @param {string} fallback English default.
132
+ * @returns {string}
133
+ */
134
+ _message(key: string, fallback: string): string;
128
135
  }