@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
@@ -31,6 +31,10 @@ export type CardViewOptions = {
31
31
  * Record selection behavior.
32
32
  */
33
33
  selectable?: false | 'single' | 'multi';
34
+ /**
35
+ * Select through a checkbox or the non-interactive card surface.
36
+ */
37
+ selectionTrigger?: 'checkbox' | 'card';
34
38
  /**
35
39
  * Initially selected record ids.
36
40
  */
@@ -44,9 +48,10 @@ export type CardViewOptions = {
44
48
  */
45
49
  hiddenFields?: string[];
46
50
  /**
47
- * Whether to expose shared field controls.
51
+ * Whether to expose shared field controls. `true` renders the chooser in the card toolbar and
52
+ * `false` omits it; an object customises its `label` and mounts it into `target`.
48
53
  */
49
- fieldControls?: boolean;
54
+ fieldControls?: boolean | import('../view/record-view.js').ViewFieldControlsConfig;
50
55
  /**
51
56
  * Empty-result content.
52
57
  */
@@ -172,10 +177,13 @@ export type CardRecordGroup = {
172
177
  * @property {import('../view/record-view.js').ViewSort|null} [sort=null] Initial shared sort.
173
178
  * @property {'local'|'server'} [sortMode='local'] Local sorting or event-only server sorting.
174
179
  * @property {false|'single'|'multi'} [selectable=false] Record selection behavior.
180
+ * @property {'checkbox'|'card'} [selectionTrigger='checkbox'] Select through a checkbox or the non-interactive card surface.
175
181
  * @property {unknown[]} [selection=[]] Initially selected record ids.
176
182
  * @property {string[]} [fieldOrder=[]] Preferred shared field order.
177
183
  * @property {string[]} [hiddenFields=[]] Initially hidden metadata fields.
178
- * @property {boolean} [fieldControls=true] Whether to expose shared field controls.
184
+ * @property {boolean|import('../view/record-view.js').ViewFieldControlsConfig} [fieldControls=true]
185
+ * Whether to expose shared field controls. `true` renders the chooser in the card toolbar and
186
+ * `false` omits it; an object customises its `label` and mounts it into `target`.
179
187
  * @property {string|Node|(()=>string|Node)|null} [emptyText=null] Empty-result content.
180
188
  * @property {RecordCardValueSource} [titleField=null] Title field id or explicit resolver.
181
189
  * @property {RecordCardValueSource} [subtitleField=null] Subtitle field id or explicit resolver.
@@ -190,7 +198,7 @@ export type CardRecordGroup = {
190
198
  * @property {string|((record:ViewRecord,index:number)=>unknown)|null} [groupBy=null]
191
199
  * Field id or local group resolver.
192
200
  * @property {unknown[]} [groupOrder=[]] Preferred group ids; missing ids render as empty groups.
193
- * @property {number|string} [minCardWidth='18rem'] Responsive minimum card width.
201
+ * @property {number|string} [minCardWidth='15rem'] Responsive minimum card width.
194
202
  * @property {number|null} [maxColumns=null] Maximum cards per row; null is unconstrained.
195
203
  * @property {'outlined'|'raised'|'filled'} [variant='outlined'] Card surface treatment.
196
204
  * @property {number} [loadingCount=6] Skeleton cards shown while loading.
@@ -1,6 +1,25 @@
1
1
  export type ViewRecord = Record<string, any>;
2
2
  export type ViewField = import('../view/record-view.js').ViewField;
3
3
  export type RecordCardValueSource = string | ((record: ViewRecord, index: number) => unknown) | null;
4
+ export type RecordCardFieldSlot = 'eyebrow-start' | 'eyebrow-end' | 'title-prefix';
5
+ export type RecordCardFieldGroups = {
6
+ /**
7
+ * Fields shown at the logical start of the eyebrow row.
8
+ */
9
+ eyebrowStart: ViewField[];
10
+ /**
11
+ * Fields shown at the logical end of the eyebrow row.
12
+ */
13
+ eyebrowEnd: ViewField[];
14
+ /**
15
+ * Fields shown immediately before, but outside, the heading.
16
+ */
17
+ titlePrefix: ViewField[];
18
+ /**
19
+ * Remaining labelled metadata fields.
20
+ */
21
+ metadata: ViewField[];
22
+ };
4
23
  export type RecordCardPreviewDescriptor = {
5
24
  /**
6
25
  * Image URL.
@@ -100,6 +119,10 @@ export type RecordCardOptions = {
100
119
  * Selection presentation.
101
120
  */
102
121
  selectable?: false | 'single' | 'multi';
122
+ /**
123
+ * Selection affordance for owning views.
124
+ */
125
+ selectionTrigger?: 'checkbox' | 'card';
103
126
  /**
104
127
  * Current selection state.
105
128
  */
@@ -142,6 +165,14 @@ export type ResolvedRecordPreview = {
142
165
  /** @typedef {Record<string, any>} ViewRecord */
143
166
  /** @typedef {import('../view/record-view.js').ViewField} ViewField */
144
167
  /** @typedef {string|((record:ViewRecord,index:number)=>unknown)|null} RecordCardValueSource */
168
+ /** @typedef {'eyebrow-start'|'eyebrow-end'|'title-prefix'} RecordCardFieldSlot */
169
+ /**
170
+ * @typedef {Object} RecordCardFieldGroups
171
+ * @property {ViewField[]} eyebrowStart Fields shown at the logical start of the eyebrow row.
172
+ * @property {ViewField[]} eyebrowEnd Fields shown at the logical end of the eyebrow row.
173
+ * @property {ViewField[]} titlePrefix Fields shown immediately before, but outside, the heading.
174
+ * @property {ViewField[]} metadata Remaining labelled metadata fields.
175
+ */
145
176
  /**
146
177
  * @typedef {Object} RecordCardPreviewDescriptor
147
178
  * @property {string} src Image URL.
@@ -182,6 +213,7 @@ export type ResolvedRecordPreview = {
182
213
  * @property {RecordCardLink|((record:ViewRecord,index:number)=>RecordCardLink)} [link]
183
214
  * @property {RecordCardAction[]|((record:ViewRecord,index:number)=>RecordCardAction[])} [actions=[]]
184
215
  * @property {false|'single'|'multi'} [selectable=false] Selection presentation.
216
+ * @property {'checkbox'|'card'} [selectionTrigger='checkbox'] Selection affordance for owning views.
185
217
  * @property {boolean} [selected=false] Current selection state.
186
218
  * @property {'outlined'|'raised'|'filled'} [variant='outlined'] Surface treatment.
187
219
  * @property {1|2|3|4|5|6} [headingLevel=3] Card title heading level.
@@ -200,11 +232,13 @@ export type ResolvedRecordPreview = {
200
232
  * becomes text, URLs are normalized before reaching native attributes, and actions expose stable
201
233
  * data attributes for a component-owned delegated listener.
202
234
  *
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.
235
+ * The returned `<li>` belongs in a semantic `<ul>`/`<ol>`. When selectable its global
236
+ * `aria-description` announces selection without applying the unsupported `aria-selected` state
237
+ * to a listitem; multi-selection adds a native checkbox unless the owner opts into card-surface
238
+ * selection. It deliberately remains a listitem
239
+ * rather than becoming an ARIA option because cards may contain native links and buttons, which
240
+ * the listbox pattern does not permit inside an option. Preview images are paired with a stable
241
+ * fallback. The owning component listens for image `error` and marks the fallback.
208
242
  *
209
243
  * @param {ViewRecord} record Record to render.
210
244
  * @param {number} index Current display index.
@@ -212,6 +246,20 @@ export type ResolvedRecordPreview = {
212
246
  * @returns {HTMLLIElement} Semantic record card list item.
213
247
  */
214
248
  export declare function createRecordCard(record: ViewRecord, index: number, options?: RecordCardOptions): HTMLLIElement;
249
+ /**
250
+ * Partitions ordered visible fields into the shared record-card slots. A recognized
251
+ * `field.view.card.slot` moves the field to that semantic region; absent or unknown values remain
252
+ * ordinary metadata. Title and subtitle fields retain the existing no-duplication rule.
253
+ *
254
+ * The input array and descriptors are never mutated. Each field appears in at most one result
255
+ * array, and the order within every result follows the supplied visible-field order.
256
+ *
257
+ * @param {ViewField[]} fields Ordered visible fields.
258
+ * @param {RecordCardValueSource} [titleSource=null] Active title field or resolver.
259
+ * @param {RecordCardValueSource} [subtitleSource=null] Active subtitle field or resolver.
260
+ * @returns {RecordCardFieldGroups} Partitioned fields.
261
+ */
262
+ export declare function partitionRecordCardFields(fields: ViewField[], titleSource?: RecordCardValueSource, subtitleSource?: RecordCardValueSource): RecordCardFieldGroups;
215
263
  /**
216
264
  * Resolves a preview without touching the DOM. Unsafe, malformed, and non-image URL schemes are
217
265
  * rejected into the same descriptor shape so callers can still render the stable fallback.
@@ -0,0 +1,160 @@
1
+ import { Component } from '../../core/component.js';
2
+ export type CodeEditorOptions = {
3
+ /**
4
+ * Initial text.
5
+ */
6
+ value?: unknown;
7
+ /**
8
+ * Form field name.
9
+ */
10
+ name?: string;
11
+ /**
12
+ * Language identifier shown to the user and exposed as data.
13
+ */
14
+ language?: string;
15
+ /**
16
+ * Accessible editor label.
17
+ */
18
+ label?: string;
19
+ /**
20
+ * Placeholder text.
21
+ */
22
+ placeholder?: string;
23
+ /**
24
+ * Visible textarea rows.
25
+ */
26
+ rows?: number;
27
+ /**
28
+ * Text inserted by Tab and removed by Shift+Tab.
29
+ */
30
+ indent?: string;
31
+ /**
32
+ * Textarea wrapping behavior.
33
+ */
34
+ wrap?: 'off' | 'soft' | 'hard';
35
+ /**
36
+ * Whether browser spellcheck is enabled.
37
+ */
38
+ spellcheck?: boolean;
39
+ /**
40
+ * Whether content can be selected but not changed.
41
+ */
42
+ readOnly?: boolean;
43
+ /**
44
+ * Whether the editor is disabled.
45
+ */
46
+ disabled?: boolean;
47
+ /**
48
+ * Whether the line/column status is visible.
49
+ */
50
+ status?: boolean;
51
+ /**
52
+ * Input listener.
53
+ */
54
+ oninput?: (event: CustomEvent<{
55
+ value: string;
56
+ }>) => void;
57
+ /**
58
+ * Change listener.
59
+ */
60
+ onchange?: (event: CustomEvent<{
61
+ value: string;
62
+ }>) => void;
63
+ };
64
+ /**
65
+ * @typedef {Object} CodeEditorOptions
66
+ * @property {unknown} [value=''] Initial text.
67
+ * @property {string} [name=''] Form field name.
68
+ * @property {string} [language='text'] Language identifier shown to the user and exposed as data.
69
+ * @property {string} [label='Code editor'] Accessible editor label.
70
+ * @property {string} [placeholder=''] Placeholder text.
71
+ * @property {number} [rows=12] Visible textarea rows.
72
+ * @property {string} [indent='\t'] Text inserted by Tab and removed by Shift+Tab.
73
+ * @property {'off'|'soft'|'hard'} [wrap='off'] Textarea wrapping behavior.
74
+ * @property {boolean} [spellcheck=false] Whether browser spellcheck is enabled.
75
+ * @property {boolean} [readOnly=false] Whether content can be selected but not changed.
76
+ * @property {boolean} [disabled=false] Whether the editor is disabled.
77
+ * @property {boolean} [status=true] Whether the line/column status is visible.
78
+ * @property {(event: CustomEvent<{value:string}>) => void} [oninput] Input listener.
79
+ * @property {(event: CustomEvent<{value:string}>) => void} [onchange] Change listener.
80
+ */
81
+ /**
82
+ * Dependency-free source editor for structured text, Markdown, JSON and code. It deliberately uses
83
+ * a native textarea: values remain text-safe, browser undo and IME behavior stay intact, and Tab /
84
+ * Shift+Tab provide predictable indentation without a third-party editor runtime.
85
+ * @fires CodeEditor#input
86
+ * @fires CodeEditor#change
87
+ * @extends {Component<CodeEditorOptions>}
88
+ */
89
+ export declare class CodeEditor extends Component<CodeEditorOptions> {
90
+ _createdRoot: boolean;
91
+ _initialChildren: ChildNode[];
92
+ _initialAttributes: Map<string, string>;
93
+ _language: string;
94
+ _languageLabel: HTMLElement;
95
+ _position: HTMLElement;
96
+ _header: HTMLElement;
97
+ _input: HTMLTextAreaElement;
98
+ static cssName: string;
99
+ /** @type {CodeEditorOptions} */
100
+ static defaults: CodeEditorOptions;
101
+ /** @returns {HTMLElement} */
102
+ render(): HTMLElement;
103
+ /** @returns {string} */
104
+ getValue(): string;
105
+ /**
106
+ * Replaces the editor text.
107
+ * @param {unknown} value New value.
108
+ * @param {{silent?:boolean}} [options={}] Suppress the `change` event.
109
+ * @returns {this}
110
+ */
111
+ setValue(value: unknown, { silent }?: {
112
+ silent?: boolean;
113
+ }): this;
114
+ /** @param {unknown} language New language identifier. @returns {this} */
115
+ setLanguage(language: unknown): this;
116
+ /** @returns {this} */
117
+ focus(): this;
118
+ /** @returns {this} */
119
+ enable(): this;
120
+ /** @returns {this} */
121
+ disable(): this;
122
+ /** @param {boolean} value Read-only state. @returns {this} */
123
+ setReadOnly(value: boolean): this;
124
+ /** @param {KeyboardEvent} event @returns {void} */
125
+ _handleKeydown(event: KeyboardEvent): void;
126
+ /** @returns {void} */
127
+ _updatePosition(): void;
128
+ /** @returns {void} */
129
+ destroy(): void;
130
+ }
131
+ /**
132
+ * Applies Tab or Shift+Tab to a textarea selection.
133
+ * @param {string} value Complete source value.
134
+ * @param {number} start Selection start.
135
+ * @param {number} end Selection end.
136
+ * @param {string} indent Indentation text.
137
+ * @param {boolean} outdent Whether to remove indentation.
138
+ * @returns {{value:string,start:number,end:number}}
139
+ */
140
+ export declare function indentSelection(value: string, start: number, end: number, indent?: string, outdent?: boolean): {
141
+ value: string;
142
+ start: number;
143
+ end: number;
144
+ };
145
+ /** @param {string} value @param {number} start @param {number} end @returns {{line:number,column:number,lines:number}} */
146
+ export declare function editorPosition(value: string, start: number, end?: number): {
147
+ line: number;
148
+ column: number;
149
+ lines: number;
150
+ };
151
+ /**
152
+ * Code editor input event.
153
+ * @event CodeEditor#input
154
+ * @type {CustomEvent<{value:string}>}
155
+ */
156
+ /**
157
+ * Code editor committed change event.
158
+ * @event CodeEditor#change
159
+ * @type {CustomEvent<{value:string}>}
160
+ */
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Registers the CodeEditor-backed `code` field type.
3
+ * @returns {void}
4
+ */
5
+ export declare function registerCodeEditorFieldAdapter(): void;
@@ -1,6 +1,6 @@
1
1
  import { Component } from '../../core/component.js';
2
- export type MenuItem = import('../menu-button/menu-button.js').MenuItem;
3
- export type ContextMenuEntry = MenuItem | '-';
2
+ export type MenuItem = import('../../internal/menu-items.js').MenuItem;
3
+ export type ContextMenuEntry = import('../../internal/menu-items.js').MenuEntry;
4
4
  export type ContextMenuOptions = {
5
5
  /**
6
6
  * Menu
@@ -34,6 +34,22 @@ export type ContextMenuOptions = {
34
34
  */
35
35
  onclose?: (event: CustomEvent<Record<string, never>>) => void;
36
36
  };
37
+ /** @typedef {import('../../internal/menu-items.js').MenuItem} MenuItem */
38
+ /** @typedef {import('../../internal/menu-items.js').MenuEntry} ContextMenuEntry */
39
+ /**
40
+ * @typedef {Object} ContextMenuOptions
41
+ * @property {ContextMenuEntry[]|((context: Element|null) => ContextMenuEntry[])} [items=[]] Menu
42
+ * items and `'-'` separators, or a function returning them for the element the menu is opening
43
+ * on — which is how a row menu disables the actions that row does not allow. Returning an empty
44
+ * array cancels the opening.
45
+ * @property {string|null} [selector=null] Restricts the menu to descendants matching this
46
+ * selector, and reports the matched element as the context of the selection. A table passes
47
+ * `'tbody tr'` here to get a per-row menu from one listener.
48
+ * @property {(event: CustomEvent<{value: unknown, item: MenuItem, context: Element|null}>) => void} [onselect]
49
+ * Selection listener.
50
+ * @property {(event: CustomEvent<{context: Element|null}>) => void} [onopen] Open listener.
51
+ * @property {(event: CustomEvent<Record<string, never>>) => void} [onclose] Close listener.
52
+ */
37
53
  /**
38
54
  * Right-click menu for a region, implementing the APG menu pattern.
39
55
  *
@@ -134,4 +134,12 @@ export declare class DatePicker extends Component<DatePickerOptions> {
134
134
  _inRange(date: Date): boolean;
135
135
  /** @param {Date} date @returns {HTMLButtonElement|null} */
136
136
  _buttonForDate(date: Date): HTMLButtonElement | null;
137
+ /**
138
+ * Resolves a message through the host translator, falling back to the built-in English text.
139
+ * @param {string} key Message key.
140
+ * @param {string} fallback Built-in text, with `%1`-style placeholders.
141
+ * @param {...unknown} args Interpolation values.
142
+ * @returns {string}
143
+ */
144
+ _message(key: string, fallback: string, ...args: unknown[]): string;
137
145
  }
@@ -124,4 +124,11 @@ export declare class TimePicker extends Component<TimePickerOptions> {
124
124
  _buildMark(mark: ClockMark, selected: number): HTMLElement;
125
125
  /** @param {HTMLElement} element @param {ClockMark} mark @param {number} selected @returns {void} */
126
126
  _syncMark(element: HTMLElement, mark: ClockMark, selected: number): void;
127
+ /**
128
+ * Resolves a message through the host translator, falling back to the built-in English text.
129
+ * @param {string} key Message key.
130
+ * @param {string} fallback English default.
131
+ * @returns {string}
132
+ */
133
+ _message(key: string, fallback: string): string;
127
134
  }
@@ -17,6 +17,14 @@ export type DialogButton = {
17
17
  * Whether this button receives initial focus.
18
18
  */
19
19
  autofocus?: boolean;
20
+ /**
21
+ * Whether the footer button is disabled.
22
+ */
23
+ disabled?: boolean;
24
+ /**
25
+ * Visible shortcut hint; the host binds the action.
26
+ */
27
+ shortcut?: import('../button/button.js').ButtonShortcut;
20
28
  };
21
29
  export type DialogOptions = {
22
30
  /**
@@ -155,6 +163,8 @@ export type PromptOptions = {
155
163
  * @property {DialogButtonKind} [kind='default'] Visual button kind.
156
164
  * @property {'close'|'cancel'|((dialog: Dialog) => void)} [action='close'] Button action.
157
165
  * @property {boolean} [autofocus=false] Whether this button receives initial focus.
166
+ * @property {boolean} [disabled=false] Whether the footer button is disabled.
167
+ * @property {import('../button/button.js').ButtonShortcut} [shortcut] Visible shortcut hint; the host binds the action.
158
168
  */
159
169
  /**
160
170
  * @typedef {Object} DialogOptions
@@ -295,4 +305,23 @@ export declare class Dialog extends Modal {
295
305
  * @returns {void}
296
306
  */
297
307
  _applySize(size: 'sm' | 'md' | 'lg' | number): void;
308
+ /**
309
+ * Resolves a component message, falling back to the built-in English text.
310
+ * @param {string} key Message key.
311
+ * @param {string} fallback English default.
312
+ * @returns {string}
313
+ */
314
+ _message(key: string, fallback: string): string;
298
315
  }
316
+ /**
317
+ * Copies footer-button descriptors without mutating the caller's array or objects, and settles
318
+ * the two booleans the footer renders from.
319
+ *
320
+ * `autofocus` and `disabled` are resolved together because they contradict each other: a control
321
+ * that refuses activation must not be the one initial focus lands on, and a host that writes both
322
+ * has said what it wants twice. Deciding it here rather than at render time keeps `Sheet` — which
323
+ * takes the same descriptors through the same footer — on one answer.
324
+ * @param {DialogButton[]|null|undefined} list Button descriptors.
325
+ * @returns {DialogButton[]} Normalized copies.
326
+ */
327
+ export declare function normalizeDialogButtons(list: DialogButton[] | null | undefined): DialogButton[];