@zeyos/zx 4.1.1 → 4.3.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 (102) hide show
  1. package/CHANGELOG.md +81 -0
  2. package/DESIGN-SYSTEM.md +33 -3
  3. package/README.md +22 -5
  4. package/dist/types/components/app-icon/app-icon.d.ts +8 -1
  5. package/dist/types/components/aurora/aurora.d.ts +72 -0
  6. package/dist/types/components/calendar/calendar-model.d.ts +202 -0
  7. package/dist/types/components/calendar/calendar.d.ts +517 -0
  8. package/dist/types/components/card-view/card-view.d.ts +303 -0
  9. package/dist/types/components/card-view/record-card.d.ts +242 -0
  10. package/dist/types/components/dialog/dialog.d.ts +6 -1
  11. package/dist/types/components/dropdown/dropdown.d.ts +5 -0
  12. package/dist/types/components/kanban-view/kanban-view.d.ts +572 -0
  13. package/dist/types/components/launcher/launcher.d.ts +5 -0
  14. package/dist/types/components/message/message.d.ts +9 -1
  15. package/dist/types/components/modal/modal.d.ts +44 -7
  16. package/dist/types/components/sheet/sheet.d.ts +22 -12
  17. package/dist/types/components/table/table.d.ts +120 -31
  18. package/dist/types/components/table-view/table-view.d.ts +192 -0
  19. package/dist/types/components/view/record-view.d.ts +464 -0
  20. package/dist/types/core/overlay-host.d.ts +12 -0
  21. package/dist/types/index.d.ts +7 -0
  22. package/dist/types/zeyos/calendar.d.ts +91 -0
  23. package/dist/types/zeyos/icons.d.ts +18 -2
  24. package/dist/types/zeyos/index.d.ts +4 -0
  25. package/dist/types/zeyos/legacy-saved-views.d.ts +66 -0
  26. package/dist/types/zeyos/saved-views.d.ts +331 -0
  27. package/dist/types/zeyos/view.d.ts +305 -0
  28. package/dist/zx-zeyos.esm.js +4742 -1470
  29. package/dist/zx-zeyos.esm.min.js +1 -1
  30. package/dist/zx.css +2536 -471
  31. package/dist/zx.esm.js +5193 -223
  32. package/dist/zx.esm.min.js +3 -3
  33. package/dist/zx.global.js +5193 -223
  34. package/dist/zx.global.min.js +3 -3
  35. package/dist/zx.min.css +1 -1
  36. package/docs/api.json +1729 -182
  37. package/docs/llms.md +236 -32
  38. package/docs/llms.txt +16 -6
  39. package/package.json +1 -1
  40. package/src/components/account-menu/account-menu.css +1 -1
  41. package/src/components/app-icon/app-icon.css +77 -51
  42. package/src/components/app-icon/app-icon.js +28 -4
  43. package/src/components/app-rail/app-rail.css +12 -3
  44. package/src/components/app-sidebar/app-sidebar.css +11 -2
  45. package/src/components/aurora/aurora.css +143 -0
  46. package/src/components/aurora/aurora.js +146 -0
  47. package/src/components/avatar/avatar.css +1 -1
  48. package/src/components/button/button.css +2 -2
  49. package/src/components/calendar/calendar-model.js +402 -0
  50. package/src/components/calendar/calendar.css +609 -0
  51. package/src/components/calendar/calendar.js +1619 -0
  52. package/src/components/card/card.css +2 -2
  53. package/src/components/card-view/card-view.css +389 -0
  54. package/src/components/card-view/card-view.js +527 -0
  55. package/src/components/card-view/record-card.js +392 -0
  56. package/src/components/context-menu/context-menu.css +4 -4
  57. package/src/components/context-menu/context-menu.js +5 -1
  58. package/src/components/date-picker/date-picker.css +31 -12
  59. package/src/components/datebox/date-range-box.css +17 -2
  60. package/src/components/datebox/datebox.css +18 -3
  61. package/src/components/dialog/dialog.css +4 -3
  62. package/src/components/dialog/dialog.js +2 -1
  63. package/src/components/dropdown/dropdown.css +17 -3
  64. package/src/components/dropdown/dropdown.js +7 -2
  65. package/src/components/kanban-view/kanban-view.css +216 -0
  66. package/src/components/kanban-view/kanban-view.js +1228 -0
  67. package/src/components/launcher/launcher.css +24 -9
  68. package/src/components/launcher/launcher.js +9 -2
  69. package/src/components/master-panel/master-panel.css +14 -3
  70. package/src/components/menu-button/menu-button.css +4 -4
  71. package/src/components/message/message.css +13 -21
  72. package/src/components/message/message.js +17 -11
  73. package/src/components/modal/modal.css +19 -5
  74. package/src/components/modal/modal.js +99 -25
  75. package/src/components/navigation-bar/navigation-bar.css +17 -5
  76. package/src/components/panel/panel.css +10 -2
  77. package/src/components/select/select.css +26 -8
  78. package/src/components/sheet/sheet.css +28 -7
  79. package/src/components/sheet/sheet.js +43 -23
  80. package/src/components/table/table.css +83 -5
  81. package/src/components/table/table.js +322 -37
  82. package/src/components/table-view/table-view.css +18 -0
  83. package/src/components/table-view/table-view.js +347 -0
  84. package/src/components/tag-picker/tag-picker.css +18 -4
  85. package/src/components/tooltip/tooltip.css +17 -3
  86. package/src/components/tooltip/tooltip.js +4 -1
  87. package/src/components/view/record-view.css +114 -0
  88. package/src/components/view/record-view.js +770 -0
  89. package/src/core/overlay-host.js +23 -0
  90. package/src/index.js +15 -0
  91. package/src/zeyos/calendar.js +115 -0
  92. package/src/zeyos/icons.js +11 -4
  93. package/src/zeyos/index.js +13 -0
  94. package/src/zeyos/launcher.js +2 -2
  95. package/src/zeyos/legacy-saved-views.js +155 -0
  96. package/src/zeyos/saved-views.js +815 -0
  97. package/src/zeyos/table.js +3 -1
  98. package/src/zeyos/view.js +543 -0
  99. package/styles/icons.css +3 -10
  100. package/styles/tokens/dark.css +4 -0
  101. package/styles/tokens/semantic.css +142 -3
  102. package/styles/zx.css +6 -0
@@ -0,0 +1,303 @@
1
+ import { RecordView } from '../view/record-view.js';
2
+ export type ViewRecord = Record<string, any>;
3
+ export type ViewField = import('../view/record-view.js').ViewField;
4
+ export type RecordViewOptions = import('../view/record-view.js').RecordViewOptions;
5
+ export type RecordCardValueSource = import('./record-card.js').RecordCardValueSource;
6
+ export type RecordCardPreview = import('./record-card.js').RecordCardPreview;
7
+ export type RecordCardLink = import('./record-card.js').RecordCardLink;
8
+ export type RecordCardAction = import('./record-card.js').RecordCardAction;
9
+ export type CardViewOptions = {
10
+ /**
11
+ * Shared ordered field descriptors.
12
+ */
13
+ fields?: ViewField[];
14
+ /**
15
+ * Initial records.
16
+ */
17
+ data?: ViewRecord[];
18
+ /**
19
+ * Stable record id accessor.
20
+ */
21
+ recordId?: string | ((record: ViewRecord) => unknown);
22
+ /**
23
+ * Initial shared sort.
24
+ */
25
+ sort?: import('../view/record-view.js').ViewSort | null;
26
+ /**
27
+ * Local sorting or event-only server sorting.
28
+ */
29
+ sortMode?: 'local' | 'server';
30
+ /**
31
+ * Record selection behavior.
32
+ */
33
+ selectable?: false | 'single' | 'multi';
34
+ /**
35
+ * Initially selected record ids.
36
+ */
37
+ selection?: unknown[];
38
+ /**
39
+ * Preferred shared field order.
40
+ */
41
+ fieldOrder?: string[];
42
+ /**
43
+ * Initially hidden metadata fields.
44
+ */
45
+ hiddenFields?: string[];
46
+ /**
47
+ * Whether to expose shared field controls.
48
+ */
49
+ fieldControls?: boolean;
50
+ /**
51
+ * Empty-result content.
52
+ */
53
+ emptyText?: string | Node | (() => string | Node) | null;
54
+ /**
55
+ * Title field id or explicit resolver.
56
+ */
57
+ titleField?: RecordCardValueSource;
58
+ /**
59
+ * Subtitle field id or explicit resolver.
60
+ */
61
+ subtitleField?: RecordCardValueSource;
62
+ /**
63
+ * Preview field id or explicit resolver.
64
+ */
65
+ preview?: string | ((record: ViewRecord, index: number) => RecordCardPreview);
66
+ /**
67
+ * Preview alt field, literal, or resolver.
68
+ */
69
+ previewAlt?: string | ((record: ViewRecord, index: number) => unknown) | null;
70
+ /**
71
+ * Safe native title link or resolver.
72
+ */
73
+ link?: RecordCardLink | ((record: ViewRecord, index: number) => RecordCardLink);
74
+ /**
75
+ * Listener-free action descriptors or resolver.
76
+ */
77
+ actions?: RecordCardAction[] | ((record: ViewRecord, index: number) => RecordCardAction[]);
78
+ /**
79
+ * Field id or local group resolver.
80
+ */
81
+ groupBy?: string | ((record: ViewRecord, index: number) => unknown) | null;
82
+ /**
83
+ * Preferred group ids; missing ids render as empty groups.
84
+ */
85
+ groupOrder?: unknown[];
86
+ /**
87
+ * Responsive minimum card width.
88
+ */
89
+ minCardWidth?: number | string;
90
+ /**
91
+ * Maximum cards per row; null is unconstrained.
92
+ */
93
+ maxColumns?: number | null;
94
+ /**
95
+ * Card surface treatment.
96
+ */
97
+ variant?: 'outlined' | 'raised' | 'filled';
98
+ /**
99
+ * Skeleton cards shown while loading.
100
+ */
101
+ loadingCount?: number;
102
+ /**
103
+ * Per-card title heading level.
104
+ */
105
+ headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
106
+ /**
107
+ * Accessible collection label.
108
+ */
109
+ label?: string;
110
+ onrecordaction?: (event: CustomEvent<Record<string, unknown>>) => void;
111
+ };
112
+ export type CardViewState = {
113
+ /**
114
+ * State schema version.
115
+ */
116
+ version: 1;
117
+ /**
118
+ * Shared field order.
119
+ */
120
+ fieldOrder: string[];
121
+ /**
122
+ * Shared hidden fields.
123
+ */
124
+ hiddenFields: string[];
125
+ /**
126
+ * Shared sort.
127
+ */
128
+ sort: import('../view/record-view.js').ViewSort | null;
129
+ /**
130
+ * Preferred group ids.
131
+ */
132
+ groupOrder: string[];
133
+ /**
134
+ * Responsive minimum card width.
135
+ */
136
+ minCardWidth: string;
137
+ /**
138
+ * Maximum cards per row.
139
+ */
140
+ maxColumns: number | null;
141
+ /**
142
+ * Surface treatment.
143
+ */
144
+ variant: 'outlined' | 'raised' | 'filled';
145
+ };
146
+ export type CardRecordGroup = {
147
+ /**
148
+ * Normalized group id, null for an ungrouped collection.
149
+ */
150
+ id: string | null;
151
+ /**
152
+ * Display label.
153
+ */
154
+ label: string;
155
+ /**
156
+ * Records in current shared display order.
157
+ */
158
+ records: ViewRecord[];
159
+ };
160
+ /** @typedef {Record<string, any>} ViewRecord */
161
+ /** @typedef {import('../view/record-view.js').ViewField} ViewField */
162
+ /** @typedef {import('../view/record-view.js').RecordViewOptions} RecordViewOptions */
163
+ /** @typedef {import('./record-card.js').RecordCardValueSource} RecordCardValueSource */
164
+ /** @typedef {import('./record-card.js').RecordCardPreview} RecordCardPreview */
165
+ /** @typedef {import('./record-card.js').RecordCardLink} RecordCardLink */
166
+ /** @typedef {import('./record-card.js').RecordCardAction} RecordCardAction */
167
+ /**
168
+ * @typedef {Object} CardViewOptions
169
+ * @property {ViewField[]} [fields=[]] Shared ordered field descriptors.
170
+ * @property {ViewRecord[]} [data=[]] Initial records.
171
+ * @property {string|((record:ViewRecord)=>unknown)} [recordId='ID'] Stable record id accessor.
172
+ * @property {import('../view/record-view.js').ViewSort|null} [sort=null] Initial shared sort.
173
+ * @property {'local'|'server'} [sortMode='local'] Local sorting or event-only server sorting.
174
+ * @property {false|'single'|'multi'} [selectable=false] Record selection behavior.
175
+ * @property {unknown[]} [selection=[]] Initially selected record ids.
176
+ * @property {string[]} [fieldOrder=[]] Preferred shared field order.
177
+ * @property {string[]} [hiddenFields=[]] Initially hidden metadata fields.
178
+ * @property {boolean} [fieldControls=true] Whether to expose shared field controls.
179
+ * @property {string|Node|(()=>string|Node)|null} [emptyText=null] Empty-result content.
180
+ * @property {RecordCardValueSource} [titleField=null] Title field id or explicit resolver.
181
+ * @property {RecordCardValueSource} [subtitleField=null] Subtitle field id or explicit resolver.
182
+ * @property {string|((record:ViewRecord,index:number)=>RecordCardPreview)} [preview]
183
+ * Preview field id or explicit resolver.
184
+ * @property {string|((record:ViewRecord,index:number)=>unknown)|null} [previewAlt=null]
185
+ * Preview alt field, literal, or resolver.
186
+ * @property {RecordCardLink|((record:ViewRecord,index:number)=>RecordCardLink)} [link]
187
+ * Safe native title link or resolver.
188
+ * @property {RecordCardAction[]|((record:ViewRecord,index:number)=>RecordCardAction[])} [actions=[]]
189
+ * Listener-free action descriptors or resolver.
190
+ * @property {string|((record:ViewRecord,index:number)=>unknown)|null} [groupBy=null]
191
+ * Field id or local group resolver.
192
+ * @property {unknown[]} [groupOrder=[]] Preferred group ids; missing ids render as empty groups.
193
+ * @property {number|string} [minCardWidth='18rem'] Responsive minimum card width.
194
+ * @property {number|null} [maxColumns=null] Maximum cards per row; null is unconstrained.
195
+ * @property {'outlined'|'raised'|'filled'} [variant='outlined'] Card surface treatment.
196
+ * @property {number} [loadingCount=6] Skeleton cards shown while loading.
197
+ * @property {1|2|3|4|5|6} [headingLevel=3] Per-card title heading level.
198
+ * @property {string} [label='Card view'] Accessible collection label.
199
+ * @property {(event:CustomEvent<Record<string,unknown>>)=>void} [onrecordaction]
200
+ */
201
+ /**
202
+ * @typedef {Object} CardViewState
203
+ * @property {1} version State schema version.
204
+ * @property {string[]} fieldOrder Shared field order.
205
+ * @property {string[]} hiddenFields Shared hidden fields.
206
+ * @property {import('../view/record-view.js').ViewSort|null} sort Shared sort.
207
+ * @property {string[]} groupOrder Preferred group ids.
208
+ * @property {string} minCardWidth Responsive minimum card width.
209
+ * @property {number|null} maxColumns Maximum cards per row.
210
+ * @property {'outlined'|'raised'|'filled'} variant Surface treatment.
211
+ */
212
+ /**
213
+ * @typedef {Object} CardRecordGroup
214
+ * @property {string|null} id Normalized group id, null for an ungrouped collection.
215
+ * @property {string} label Display label.
216
+ * @property {ViewRecord[]} records Records in current shared display order.
217
+ */
218
+ /**
219
+ * Responsive, schema-friendly record cards with shared fields, sorting, selection, state, groups,
220
+ * safe preview media, native title links, and delegated actions.
221
+ * @fires CardView#recordaction
222
+ * @extends {RecordView}
223
+ */
224
+ export declare class CardView extends RecordView {
225
+ _cardCreatedRoot: boolean;
226
+ _cardOriginal: import("../../core/dom.js").TargetSnapshot;
227
+ _cardCleaned: boolean;
228
+ _cardNodesById: Map<any, any>;
229
+ _cardGroupOrder: string[];
230
+ _cardMinWidth: string;
231
+ _cardMaxColumns: number;
232
+ _cardVariant: "filled" | "outlined" | "raised";
233
+ _cardLoadingCount: number;
234
+ _cardHeadingLevel: 1 | 2 | 3 | 4 | 5 | 6;
235
+ static cssName: string;
236
+ /** @type {Readonly<CardViewOptions & RecordViewOptions>} */
237
+ static defaults: Readonly<CardViewOptions & RecordViewOptions>;
238
+ /**
239
+ * Creates or enhances a card view.
240
+ * @param {Element|string|null} [target=null] Existing root, selector, or null.
241
+ * @param {CardViewOptions & RecordViewOptions} [options={}] Card and shared view options.
242
+ */
243
+ constructor(target?: Element | string | null, options?: CardViewOptions & RecordViewOptions);
244
+ /** @returns {HTMLElement} Card-view root. */
245
+ render(): HTMLElement;
246
+ /** Returns shared plus CardView configuration, never records or rendered values. @returns {CardViewState} */
247
+ getViewState(): CardViewState;
248
+ /**
249
+ * Restores shared and CardView configuration. Unknown shared fields reconcile in RecordView.
250
+ * @param {Partial<CardViewState>|null} state Saved JSON-safe state.
251
+ * @param {{silent?:boolean}} [options={}] Event behavior.
252
+ * @returns {this}
253
+ */
254
+ setViewState(state: Partial<CardViewState> | null, options?: {
255
+ silent?: boolean;
256
+ }): this;
257
+ /** Restores an enhanced target exactly, or removes an owned root. @returns {void} */
258
+ destroy(): void;
259
+ /** @protected @param {string} reason Refresh reason. @returns {void} */
260
+ protected _refreshView(reason: string): void;
261
+ /** @private @returns {void} */
262
+ private _applyCardLayout;
263
+ /** @private @returns {void} */
264
+ private _renderCardSort;
265
+ /** @private @returns {void} */
266
+ private _changeCardSort;
267
+ /** @private @returns {void} */
268
+ private _renderCards;
269
+ /** @private @param {CardRecordGroup} group @param {ViewField[]} fields @param {ViewField[]} visibleFields @param {number} groupIndex @returns {HTMLElement} */
270
+ private _createCardGroup;
271
+ /** @private @returns {HTMLElement} */
272
+ private _createCardSkeletons;
273
+ /** @private @returns {HTMLElement} */
274
+ private _createCardEmpty;
275
+ /** @private @returns {void} */
276
+ private _syncCardSelection;
277
+ /** @private @param {MouseEvent} event @returns {void} */
278
+ private _cardClick;
279
+ /** @private @param {MouseEvent} event @returns {void} */
280
+ private _cardDoubleClick;
281
+ /** @private @param {KeyboardEvent} event @returns {void} */
282
+ private _cardKeydown;
283
+ /** @private @param {ViewRecord} record @param {unknown} id @param {number} index @param {Event} event @returns {void} */
284
+ private _activateCard;
285
+ /** @private @param {ViewRecord} record @param {unknown} id @param {number} index @param {string|undefined} actionId @param {MouseEvent} event @returns {void} */
286
+ private _activateCardAction;
287
+ /** @private @param {Event} event @returns {void} */
288
+ private _cardPreviewError;
289
+ /** @private @returns {Readonly<CardViewOptions & RecordViewOptions>} */
290
+ private _cardOptions;
291
+ }
292
+ /**
293
+ * Groups a cloned record list without mutating records or caller arrays. Explicit order entries
294
+ * are always materialized, including empty groups; remaining values keep first-seen order.
295
+ * @param {ViewRecord[]} records Records in display order.
296
+ * @param {CardViewOptions['groupBy']} groupBy Group field or resolver.
297
+ * @param {unknown[]} [groupOrder=[]] Preferred group ids.
298
+ * @param {ViewField[]} [fields=[]] Complete fields for accessor-aware grouping.
299
+ * @returns {CardRecordGroup[]} Deterministic groups.
300
+ */
301
+ export declare function groupCardRecords(records: ViewRecord[], groupBy: CardViewOptions['groupBy'], groupOrder?: unknown[], fields?: ViewField[]): CardRecordGroup[];
302
+ /** @param {unknown} value @returns {string} */
303
+ export declare function normalizeCardWidth(value: unknown): string;
@@ -0,0 +1,242 @@
1
+ export type ViewRecord = Record<string, any>;
2
+ export type ViewField = import('../view/record-view.js').ViewField;
3
+ export type RecordCardValueSource = string | ((record: ViewRecord, index: number) => unknown) | null;
4
+ export type RecordCardPreviewDescriptor = {
5
+ /**
6
+ * Image URL.
7
+ */
8
+ src: string;
9
+ /**
10
+ * Image alternative text.
11
+ */
12
+ alt?: string;
13
+ /**
14
+ * Image fitting behavior.
15
+ */
16
+ fit?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
17
+ };
18
+ export type RecordCardPreview = string | Node | RecordCardPreviewDescriptor | null;
19
+ export type RecordCardLinkDescriptor = {
20
+ /**
21
+ * Native link destination.
22
+ */
23
+ href: string;
24
+ /**
25
+ * Native browsing context.
26
+ */
27
+ target?: string;
28
+ /**
29
+ * Native link relationship.
30
+ */
31
+ rel?: string;
32
+ };
33
+ export type RecordCardLink = string | RecordCardLinkDescriptor | null;
34
+ export type RecordCardAction = {
35
+ /**
36
+ * Stable delegated-action identifier.
37
+ */
38
+ id: string;
39
+ /**
40
+ * Visible action label.
41
+ */
42
+ label?: string;
43
+ /**
44
+ * Optional Zx icon name.
45
+ */
46
+ icon?: string | null;
47
+ /**
48
+ * Accessible/native title, especially for an icon-only action.
49
+ */
50
+ title?: string;
51
+ /**
52
+ * Optional safe native link destination; otherwise a button is rendered.
53
+ */
54
+ href?: string;
55
+ /**
56
+ * Native link browsing context.
57
+ */
58
+ target?: string;
59
+ /**
60
+ * Native link relationship.
61
+ */
62
+ rel?: string;
63
+ /**
64
+ * Whether a button action is unavailable.
65
+ */
66
+ disabled?: boolean;
67
+ /**
68
+ * Callback invoked by an owning view's delegated listener; this helper never installs listeners.
69
+ */
70
+ onclick?: (record: ViewRecord, index: number, event: MouseEvent) => void;
71
+ };
72
+ export type RecordCardOptions = {
73
+ /**
74
+ * Complete fields, used to resolve title and subtitle sources.
75
+ */
76
+ fields?: ViewField[];
77
+ /**
78
+ * Ordered fields rendered as labelled metadata.
79
+ */
80
+ visibleFields?: ViewField[];
81
+ /**
82
+ * Field id or explicit value resolver.
83
+ */
84
+ titleField?: RecordCardValueSource;
85
+ /**
86
+ * Field id or explicit value resolver.
87
+ */
88
+ subtitleField?: RecordCardValueSource;
89
+ /**
90
+ * Preview field id or explicit resolver.
91
+ */
92
+ preview?: string | ((record: ViewRecord, index: number) => RecordCardPreview);
93
+ /**
94
+ * Alternative-text field, literal text, or resolver.
95
+ */
96
+ previewAlt?: string | ((record: ViewRecord, index: number) => unknown) | null;
97
+ link?: RecordCardLink | ((record: ViewRecord, index: number) => RecordCardLink);
98
+ actions?: RecordCardAction[] | ((record: ViewRecord, index: number) => RecordCardAction[]);
99
+ /**
100
+ * Selection presentation.
101
+ */
102
+ selectable?: false | 'single' | 'multi';
103
+ /**
104
+ * Current selection state.
105
+ */
106
+ selected?: boolean;
107
+ /**
108
+ * Surface treatment.
109
+ */
110
+ variant?: 'outlined' | 'raised' | 'filled';
111
+ /**
112
+ * Card title heading level.
113
+ */
114
+ headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
115
+ /**
116
+ * Listener-free, owner-created controls such as a move handle.
117
+ */
118
+ controls?: Node[];
119
+ };
120
+ export type ResolvedRecordPreview = {
121
+ /**
122
+ * Explicit preview node.
123
+ */
124
+ node: Node | null;
125
+ /**
126
+ * Safe image URL, or null when rejected.
127
+ */
128
+ src: string | null;
129
+ /**
130
+ * Alternative text.
131
+ */
132
+ alt: string;
133
+ /**
134
+ * Image fitting behavior.
135
+ */
136
+ fit: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
137
+ /**
138
+ * Whether a supplied URL was unsafe or malformed.
139
+ */
140
+ rejected: boolean;
141
+ };
142
+ /** @typedef {Record<string, any>} ViewRecord */
143
+ /** @typedef {import('../view/record-view.js').ViewField} ViewField */
144
+ /** @typedef {string|((record:ViewRecord,index:number)=>unknown)|null} RecordCardValueSource */
145
+ /**
146
+ * @typedef {Object} RecordCardPreviewDescriptor
147
+ * @property {string} src Image URL.
148
+ * @property {string} [alt] Image alternative text.
149
+ * @property {'cover'|'contain'|'fill'|'none'|'scale-down'} [fit='cover'] Image fitting behavior.
150
+ */
151
+ /** @typedef {string|Node|RecordCardPreviewDescriptor|null} RecordCardPreview */
152
+ /**
153
+ * @typedef {Object} RecordCardLinkDescriptor
154
+ * @property {string} href Native link destination.
155
+ * @property {string} [target] Native browsing context.
156
+ * @property {string} [rel] Native link relationship.
157
+ */
158
+ /** @typedef {string|RecordCardLinkDescriptor|null} RecordCardLink */
159
+ /**
160
+ * @typedef {Object} RecordCardAction
161
+ * @property {string} id Stable delegated-action identifier.
162
+ * @property {string} [label=''] Visible action label.
163
+ * @property {string|null} [icon=null] Optional Zx icon name.
164
+ * @property {string} [title] Accessible/native title, especially for an icon-only action.
165
+ * @property {string} [href] Optional safe native link destination; otherwise a button is rendered.
166
+ * @property {string} [target] Native link browsing context.
167
+ * @property {string} [rel] Native link relationship.
168
+ * @property {boolean} [disabled=false] Whether a button action is unavailable.
169
+ * @property {(record:ViewRecord,index:number,event:MouseEvent)=>void} [onclick]
170
+ * Callback invoked by an owning view's delegated listener; this helper never installs listeners.
171
+ */
172
+ /**
173
+ * @typedef {Object} RecordCardOptions
174
+ * @property {ViewField[]} [fields=[]] Complete fields, used to resolve title and subtitle sources.
175
+ * @property {ViewField[]} [visibleFields=fields] Ordered fields rendered as labelled metadata.
176
+ * @property {RecordCardValueSource} [titleField=null] Field id or explicit value resolver.
177
+ * @property {RecordCardValueSource} [subtitleField=null] Field id or explicit value resolver.
178
+ * @property {string|((record:ViewRecord,index:number)=>RecordCardPreview)} [preview]
179
+ * Preview field id or explicit resolver.
180
+ * @property {string|((record:ViewRecord,index:number)=>unknown)|null} [previewAlt=null]
181
+ * Alternative-text field, literal text, or resolver.
182
+ * @property {RecordCardLink|((record:ViewRecord,index:number)=>RecordCardLink)} [link]
183
+ * @property {RecordCardAction[]|((record:ViewRecord,index:number)=>RecordCardAction[])} [actions=[]]
184
+ * @property {false|'single'|'multi'} [selectable=false] Selection presentation.
185
+ * @property {boolean} [selected=false] Current selection state.
186
+ * @property {'outlined'|'raised'|'filled'} [variant='outlined'] Surface treatment.
187
+ * @property {1|2|3|4|5|6} [headingLevel=3] Card title heading level.
188
+ * @property {Node[]} [controls=[]] Listener-free, owner-created controls such as a move handle.
189
+ */
190
+ /**
191
+ * @typedef {Object} ResolvedRecordPreview
192
+ * @property {Node|null} node Explicit preview node.
193
+ * @property {string|null} src Safe image URL, or null when rejected.
194
+ * @property {string} alt Alternative text.
195
+ * @property {'cover'|'contain'|'fill'|'none'|'scale-down'} fit Image fitting behavior.
196
+ * @property {boolean} rejected Whether a supplied URL was unsafe or malformed.
197
+ */
198
+ /**
199
+ * Builds the listener-free card anatomy shared by CardView and KanbanView. All primitive content
200
+ * becomes text, URLs are normalized before reaching native attributes, and actions expose stable
201
+ * data attributes for a component-owned delegated listener.
202
+ *
203
+ * The returned `<li>` belongs in a semantic `<ul>`/`<ol>`. When selectable it carries
204
+ * `aria-selected`; multi-selection adds a native checkbox. It deliberately retains list-item
205
+ * semantics rather than becoming an ARIA option because cards may contain native links and
206
+ * buttons, which the listbox pattern does not permit inside an option. Preview images are paired
207
+ * with a stable fallback. The owning component listens for image `error` and marks the fallback.
208
+ *
209
+ * @param {ViewRecord} record Record to render.
210
+ * @param {number} index Current display index.
211
+ * @param {RecordCardOptions} [options={}] Rendering options.
212
+ * @returns {HTMLLIElement} Semantic record card list item.
213
+ */
214
+ export declare function createRecordCard(record: ViewRecord, index: number, options?: RecordCardOptions): HTMLLIElement;
215
+ /**
216
+ * Resolves a preview without touching the DOM. Unsafe, malformed, and non-image URL schemes are
217
+ * rejected into the same descriptor shape so callers can still render the stable fallback.
218
+ * @param {ViewRecord} record Record.
219
+ * @param {number} index Display index.
220
+ * @param {RecordCardOptions['preview']} preview Preview field or resolver.
221
+ * @param {RecordCardOptions['previewAlt']} previewAlt Alt field, literal, or resolver.
222
+ * @param {ViewField[]} [fields=[]] Complete fields.
223
+ * @returns {ResolvedRecordPreview|null} Resolved preview.
224
+ */
225
+ export declare function resolveRecordPreview(record: ViewRecord, index: number, preview: RecordCardOptions['preview'], previewAlt: RecordCardOptions['previewAlt'], fields?: ViewField[]): ResolvedRecordPreview | null;
226
+ /**
227
+ * Resolves and validates a native title link without touching the DOM.
228
+ * @param {ViewRecord} record Record.
229
+ * @param {number} index Display index.
230
+ * @param {RecordCardOptions['link']} link Link value or resolver.
231
+ * @returns {RecordCardLinkDescriptor|null} Safe normalized link.
232
+ */
233
+ export declare function resolveRecordLink(record: ViewRecord, index: number, link: RecordCardOptions['link']): RecordCardLinkDescriptor | null;
234
+ /**
235
+ * Resolves and clones delegated action descriptors. Invalid entries are omitted rather than
236
+ * creating unnamed or ambiguously interactive controls.
237
+ * @param {ViewRecord} record Record.
238
+ * @param {number} index Display index.
239
+ * @param {RecordCardOptions['actions']} actions Actions or resolver.
240
+ * @returns {RecordCardAction[]} Normalized action copies.
241
+ */
242
+ export declare function resolveRecordActions(record: ViewRecord, index: number, actions: RecordCardOptions['actions']): RecordCardAction[];
@@ -41,6 +41,10 @@ export type DialogOptions = {
41
41
  content?: Node | string | number | {
42
42
  toElement: () => Node | null;
43
43
  } | null;
44
+ /**
45
+ * Element whose nearest Zx theme scope owns the overlay; defaults to the opener.
46
+ */
47
+ scope?: Element | string | null;
44
48
  /**
45
49
  * Open event listener.
46
50
  */
@@ -159,6 +163,7 @@ export type PromptOptions = {
159
163
  * @property {DialogButton[]} [buttons=[]] Footer buttons.
160
164
  * @property {boolean} [closable=true] Whether Escape and the header button may close the dialog.
161
165
  * @property {Node|string|number|{toElement: () => Node|null}|null} [content=null] Body content.
166
+ * @property {Element|string|null} [scope=null] Element whose nearest Zx theme scope owns the overlay; defaults to the opener.
162
167
  * @property {(event: CustomEvent<Record<string, never>>) => void} [onopen] Open event listener.
163
168
  * @property {(event: CustomEvent<{result: unknown}>) => void} [onclose] Close event listener.
164
169
  * @property {(event: CustomEvent<Record<string, never>>) => void} [oncancel] Cancel event listener.
@@ -209,7 +214,7 @@ export declare class Dialog extends Modal {
209
214
  /** @type {Readonly<DialogOptions>} */
210
215
  static defaults: Readonly<DialogOptions>;
211
216
  /**
212
- * Creates a structured dialog appended to `document.body`.
217
+ * Creates a structured dialog in the configured theme scope, or at document level when unscoped.
213
218
  * @param {Element|string|null} [_target=null] Ignored; Dialog always owns its root.
214
219
  * @param {DialogOptions} [options={}] Dialog options.
215
220
  */
@@ -28,6 +28,10 @@ export type DropdownOptions = {
28
28
  * Whether a click within the panel closes it.
29
29
  */
30
30
  closeOnSelect?: boolean;
31
+ /**
32
+ * Element whose nearest Zx theme scope owns the panel; defaults to the anchor.
33
+ */
34
+ scope?: Element | string | null;
31
35
  /**
32
36
  * Open event listener.
33
37
  */
@@ -45,6 +49,7 @@ export type DropdownOptions = {
45
49
  * @property {boolean} [matchWidth=false] Whether the panel matches the anchor width.
46
50
  * @property {'click'|'manual'} [openOn='click'] Trigger behavior.
47
51
  * @property {boolean} [closeOnSelect=false] Whether a click within the panel closes it.
52
+ * @property {Element|string|null} [scope=null] Element whose nearest Zx theme scope owns the panel; defaults to the anchor.
48
53
  * @property {(event: CustomEvent<Record<string, never>>) => void} [onopen] Open event listener.
49
54
  * @property {(event: CustomEvent<Record<string, never>>) => void} [onclose] Close event listener.
50
55
  */