@zeyos/zx 4.3.4 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. package/CHANGELOG.md +438 -0
  2. package/README.md +49 -10
  3. package/dist/types/components/activity-item/activity-item.d.ts +351 -0
  4. package/dist/types/components/activity-list/activity-list.d.ts +217 -0
  5. package/dist/types/components/app-sidebar/app-sidebar.d.ts +33 -3
  6. package/dist/types/components/avatar/avatar.d.ts +46 -7
  7. package/dist/types/components/badge/badge.d.ts +21 -1
  8. package/dist/types/components/button/button.d.ts +23 -0
  9. package/dist/types/components/calendar/calendar.d.ts +19 -0
  10. package/dist/types/components/card/card.d.ts +7 -0
  11. package/dist/types/components/card-view/card-view.d.ts +11 -3
  12. package/dist/types/components/card-view/record-card.d.ts +7 -1
  13. package/dist/types/components/chart/chart.d.ts +10 -0
  14. package/dist/types/components/checklist/checklist.d.ts +9 -0
  15. package/dist/types/components/code-editor/code-editor.d.ts +149 -0
  16. package/dist/types/components/code-editor/field-adapter.d.ts +5 -0
  17. package/dist/types/components/context-menu/context-menu.d.ts +18 -2
  18. package/dist/types/components/date-picker/date-picker.d.ts +8 -0
  19. package/dist/types/components/date-picker/time-picker.d.ts +7 -0
  20. package/dist/types/components/datebox/date-range-box.d.ts +5 -1
  21. package/dist/types/components/datebox/datebox.d.ts +7 -2
  22. package/dist/types/components/dialog/dialog.d.ts +75 -6
  23. package/dist/types/components/dropdown/dropdown.d.ts +2 -2
  24. package/dist/types/components/entity-ref/entity-ref.d.ts +331 -0
  25. package/dist/types/components/field/field.d.ts +24 -2
  26. package/dist/types/components/fieldset/fieldset.d.ts +19 -1
  27. package/dist/types/components/file-item/file-item.d.ts +262 -0
  28. package/dist/types/components/file-list/file-list.d.ts +171 -0
  29. package/dist/types/components/filter/filter.d.ts +91 -36
  30. package/dist/types/components/filter-panel/filter-panel.d.ts +449 -0
  31. package/dist/types/components/form/form.d.ts +12 -1
  32. package/dist/types/components/kanban-view/kanban-card.d.ts +146 -0
  33. package/dist/types/components/kanban-view/kanban-view.d.ts +170 -4
  34. package/dist/types/components/launcher/launcher.d.ts +278 -26
  35. package/dist/types/components/list-toolbar/list-toolbar.d.ts +599 -0
  36. package/dist/types/components/menu-button/menu-button.d.ts +37 -42
  37. package/dist/types/components/message/message.d.ts +126 -17
  38. package/dist/types/components/modal/modal.d.ts +61 -2
  39. package/dist/types/components/navigation-bar/navigation-bar.d.ts +105 -21
  40. package/dist/types/components/panel/panel.d.ts +7 -0
  41. package/dist/types/components/search/search.d.ts +7 -0
  42. package/dist/types/components/select/color.d.ts +12 -0
  43. package/dist/types/components/select/glyphs.d.ts +124 -0
  44. package/dist/types/components/select/select.d.ts +15 -3
  45. package/dist/types/components/sort-control/sort-control.d.ts +105 -0
  46. package/dist/types/components/stat-tile/stat-tile.d.ts +288 -0
  47. package/dist/types/components/tabbox/tabbox.d.ts +16 -0
  48. package/dist/types/components/table/table.d.ts +190 -1
  49. package/dist/types/components/table-view/table-view.d.ts +11 -5
  50. package/dist/types/components/tag-picker/tag-picker.d.ts +21 -4
  51. package/dist/types/components/timebox/timebox.d.ts +7 -0
  52. package/dist/types/components/tree/tree.d.ts +13 -0
  53. package/dist/types/components/value-list/value-list.d.ts +8 -0
  54. package/dist/types/components/view/record-view.d.ts +96 -5
  55. package/dist/types/core/breakpoint.d.ts +1 -1
  56. package/dist/types/core/icons.d.ts +37 -22
  57. package/dist/types/core/motion.d.ts +59 -0
  58. package/dist/types/core/overlay-host.d.ts +15 -1
  59. package/dist/types/index.d.ts +16 -3
  60. package/dist/types/internal/app-rail.d.ts +10 -0
  61. package/dist/types/internal/menu-items.d.ts +134 -0
  62. package/dist/types/zeyos/connect.d.ts +6 -0
  63. package/dist/types/zeyos/form.d.ts +50 -9
  64. package/dist/types/zeyos/index.d.ts +1 -1
  65. package/dist/types/zeyos/query.d.ts +79 -0
  66. package/dist/types/zeyos/schema.d.ts +24 -1
  67. package/dist/types/zeyos/table.d.ts +100 -14
  68. package/dist/types/zeyos/view.d.ts +10 -0
  69. package/dist/zx-zeyos.esm.js +2206 -489
  70. package/dist/zx-zeyos.esm.min.js +56 -1
  71. package/dist/zx.css +3322 -724
  72. package/dist/zx.esm.js +12244 -5809
  73. package/dist/zx.esm.min.js +58 -3
  74. package/dist/zx.global.js +12246 -5811
  75. package/dist/zx.global.min.js +58 -3
  76. package/dist/zx.min.css +1 -1
  77. package/docs/api.json +1683 -146
  78. package/docs/llms.md +777 -110
  79. package/docs/llms.txt +14 -8
  80. package/package.json +1 -1
  81. package/src/components/account-menu/account-menu.css +35 -10
  82. package/src/components/activity-item/activity-item.css +137 -0
  83. package/src/components/activity-item/activity-item.js +602 -0
  84. package/src/components/activity-list/activity-list.css +99 -0
  85. package/src/components/activity-list/activity-list.js +409 -0
  86. package/src/components/app-icon/app-icon.css +1 -1
  87. package/src/components/app-rail/app-rail.css +191 -22
  88. package/src/components/app-sidebar/app-sidebar.css +349 -24
  89. package/src/components/app-sidebar/app-sidebar.js +86 -11
  90. package/src/components/aurora/aurora.css +5 -3
  91. package/src/components/avatar/avatar.css +32 -7
  92. package/src/components/avatar/avatar.js +72 -8
  93. package/src/components/badge/badge.css +54 -2
  94. package/src/components/badge/badge.js +29 -2
  95. package/src/components/button/button.css +74 -8
  96. package/src/components/button/button.js +44 -1
  97. package/src/components/calendar/calendar.css +46 -46
  98. package/src/components/calendar/calendar.js +33 -3
  99. package/src/components/card/card.css +2 -2
  100. package/src/components/card/card.js +12 -1
  101. package/src/components/card-view/card-view.css +10 -7
  102. package/src/components/card-view/card-view.js +25 -9
  103. package/src/components/card-view/record-card.js +7 -3
  104. package/src/components/chart/chart.css +4 -1
  105. package/src/components/chart/chart.js +12 -0
  106. package/src/components/check-button/check-button.css +10 -2
  107. package/src/components/checklist/checklist.css +9 -2
  108. package/src/components/checklist/checklist.js +11 -5
  109. package/src/components/checklist/field-adapter.js +3 -1
  110. package/src/components/code-editor/code-editor.css +68 -0
  111. package/src/components/code-editor/code-editor.js +306 -0
  112. package/src/components/code-editor/field-adapter.js +34 -0
  113. package/src/components/context-menu/context-menu.css +87 -5
  114. package/src/components/context-menu/context-menu.js +22 -30
  115. package/src/components/copy/copy-button.css +6 -0
  116. package/src/components/copy/copy-input.css +8 -3
  117. package/src/components/data-filter/data-filter.css +5 -4
  118. package/src/components/date-picker/date-picker.css +6 -6
  119. package/src/components/date-picker/date-picker.js +22 -8
  120. package/src/components/date-picker/date-range-picker.css +3 -3
  121. package/src/components/date-picker/month-picker.js +3 -3
  122. package/src/components/date-picker/time-picker.css +1 -1
  123. package/src/components/date-picker/time-picker.js +20 -8
  124. package/src/components/datebox/date-range-box.css +79 -2
  125. package/src/components/datebox/date-range-box.js +13 -2
  126. package/src/components/datebox/datebox.css +79 -2
  127. package/src/components/datebox/datebox.js +13 -2
  128. package/src/components/dialog/dialog.css +26 -0
  129. package/src/components/dialog/dialog.js +174 -70
  130. package/src/components/dropdown/dropdown.css +1 -1
  131. package/src/components/dropdown/dropdown.js +7 -5
  132. package/src/components/empty-state/empty-state.css +2 -2
  133. package/src/components/entity-ref/entity-ref.css +182 -0
  134. package/src/components/entity-ref/entity-ref.js +496 -0
  135. package/src/components/field/field.css +28 -9
  136. package/src/components/field/field.js +68 -26
  137. package/src/components/field-upload/field-upload.css +1 -1
  138. package/src/components/fieldset/fieldset.css +5 -3
  139. package/src/components/fieldset/fieldset.js +28 -5
  140. package/src/components/file-item/file-item.css +88 -0
  141. package/src/components/file-item/file-item.js +505 -0
  142. package/src/components/file-list/file-list.css +51 -0
  143. package/src/components/file-list/file-list.js +320 -0
  144. package/src/components/filter/filter.css +27 -1
  145. package/src/components/filter/filter.js +205 -47
  146. package/src/components/filter-panel/filter-panel.css +104 -0
  147. package/src/components/filter-panel/filter-panel.js +964 -0
  148. package/src/components/finder/finder.css +15 -13
  149. package/src/components/form/form.css +5 -4
  150. package/src/components/form/form.js +11 -2
  151. package/src/components/grid/grid.css +1 -1
  152. package/src/components/groupbox/groupbox.css +1 -1
  153. package/src/components/kanban-view/kanban-card.js +247 -0
  154. package/src/components/kanban-view/kanban-view.css +226 -8
  155. package/src/components/kanban-view/kanban-view.js +255 -12
  156. package/src/components/launcher/launcher.css +107 -25
  157. package/src/components/launcher/launcher.js +557 -63
  158. package/src/components/list-toolbar/list-toolbar.css +194 -0
  159. package/src/components/list-toolbar/list-toolbar.js +851 -0
  160. package/src/components/master-panel/master-panel.css +2 -0
  161. package/src/components/menu-button/menu-button.css +87 -5
  162. package/src/components/menu-button/menu-button.js +86 -46
  163. package/src/components/message/message.css +38 -5
  164. package/src/components/message/message.js +230 -17
  165. package/src/components/modal/modal.css +15 -0
  166. package/src/components/modal/modal.js +159 -3
  167. package/src/components/navigation-bar/navigation-bar.css +95 -11
  168. package/src/components/navigation-bar/navigation-bar.js +171 -4
  169. package/src/components/number-field/field-adapter.js +1 -0
  170. package/src/components/number-field/number-field.css +70 -0
  171. package/src/components/number-field/number-field.js +2 -0
  172. package/src/components/pagination/pagination.css +8 -6
  173. package/src/components/panel/panel.css +1 -1
  174. package/src/components/panel/panel.js +13 -2
  175. package/src/components/rating/rating.css +7 -0
  176. package/src/components/search/search.js +17 -5
  177. package/src/components/select/color.js +22 -0
  178. package/src/components/select/field-adapter.js +6 -1
  179. package/src/components/select/glyphs.js +165 -0
  180. package/src/components/select/select.css +138 -45
  181. package/src/components/select/select.js +86 -47
  182. package/src/components/sheet/sheet.css +11 -8
  183. package/src/components/slider/slider.css +16 -2
  184. package/src/components/slider/slider.js +1 -1
  185. package/src/components/sort-control/sort-control.css +20 -0
  186. package/src/components/sort-control/sort-control.js +140 -0
  187. package/src/components/stat-tile/stat-tile.css +208 -0
  188. package/src/components/stat-tile/stat-tile.js +601 -0
  189. package/src/components/tabbox/tabbox.css +32 -27
  190. package/src/components/tabbox/tabbox.js +17 -2
  191. package/src/components/table/table.css +155 -31
  192. package/src/components/table/table.js +386 -33
  193. package/src/components/table-view/table-view.css +8 -2
  194. package/src/components/table-view/table-view.js +21 -6
  195. package/src/components/tag-picker/tag-picker.css +86 -6
  196. package/src/components/tag-picker/tag-picker.js +25 -8
  197. package/src/components/timebox/timebox.css +22 -2
  198. package/src/components/timebox/timebox.js +18 -5
  199. package/src/components/toggle/toggle.css +12 -1
  200. package/src/components/toolbar/toolbar.js +2 -2
  201. package/src/components/tooltip/tooltip.css +4 -0
  202. package/src/components/tooltip/tooltip.js +10 -3
  203. package/src/components/tree/tree.css +25 -16
  204. package/src/components/tree/tree.js +31 -0
  205. package/src/components/value-list/value-list.css +3 -3
  206. package/src/components/value-list/value-list.js +22 -6
  207. package/src/components/view/record-view.css +5 -0
  208. package/src/components/view/record-view.js +100 -7
  209. package/src/core/breakpoint.js +1 -1
  210. package/src/core/icons.js +259 -57
  211. package/src/core/motion.js +147 -0
  212. package/src/core/overlay-host.js +21 -2
  213. package/src/index.js +30 -3
  214. package/src/internal/app-rail.js +18 -1
  215. package/src/internal/menu-items.js +142 -0
  216. package/src/zeyos/connect.js +6 -2
  217. package/src/zeyos/form.js +67 -27
  218. package/src/zeyos/index.js +1 -1
  219. package/src/zeyos/query.js +153 -0
  220. package/src/zeyos/schema.js +144 -27
  221. package/src/zeyos/table.js +68 -5
  222. package/src/zeyos/view.js +6 -0
  223. package/styles/base.css +56 -0
  224. package/styles/icons.css +11 -1
  225. package/styles/print.css +192 -0
  226. package/styles/tokens/dark.css +113 -37
  227. package/styles/tokens/global.css +121 -27
  228. package/styles/tokens/semantic.css +100 -31
  229. package/styles/tokens/themes.css +7 -6
  230. package/styles/zx.css +11 -1
  231. package/styles/tokens/density.css +0 -9
@@ -1,11 +1,12 @@
1
1
  import { Component } from '../../core/component.js';
2
+ export type AvatarTone = 'blue' | 'teal' | 'green' | 'amber' | 'orange' | 'red' | 'pink' | 'violet' | 'slate';
2
3
  export type AvatarOptions = {
3
4
  /**
4
5
  * Image URL.
5
6
  */
6
7
  src?: string | null;
7
8
  /**
8
- * Name used to derive fallback initials.
9
+ * Name used to derive the fallback initials and tone.
9
10
  */
10
11
  name?: string;
11
12
  /**
@@ -17,13 +18,20 @@ export type AvatarOptions = {
17
18
  */
18
19
  label?: string | null;
19
20
  /**
20
- * Preset (`sm`, `md`, `lg`) or pixel size.
21
+ * Preset — `sm` 24px, `md` 32px, `lg` 40px at the default
22
+ * spacing unit — or a pixel size. Below 24px the fallback shows a single initial.
21
23
  */
22
24
  size?: string | number;
23
25
  /**
24
26
  * Avatar shape.
25
27
  */
26
28
  shape?: 'circle' | 'rounded' | 'square';
29
+ /**
30
+ * Fallback colour from the tone palette. `null` derives a
31
+ * stable tone from the name (or the initials when there is no name), so the same person gets the
32
+ * same colour on every screen; see {@link avatarTone}.
33
+ */
34
+ tone?: AvatarTone | null;
27
35
  /**
28
36
  * Optional presence state.
29
37
  */
@@ -33,19 +41,35 @@ export type AvatarOptions = {
33
41
  */
34
42
  statusLabel?: string | null;
35
43
  };
44
+ /**
45
+ * A categorical tone from the design system's tone palette (`--zx-color-tone-*`).
46
+ * @typedef {'blue'|'teal'|'green'|'amber'|'orange'|'red'|'pink'|'violet'|'slate'} AvatarTone
47
+ */
36
48
  /**
37
49
  * @typedef {Object} AvatarOptions
38
50
  * @property {string|null} [src=null] Image URL.
39
- * @property {string} [name=''] Name used to derive fallback initials.
51
+ * @property {string} [name=''] Name used to derive the fallback initials and tone.
40
52
  * @property {string|null} [initials=null] Explicit fallback initials.
41
53
  * @property {string|null} [label=null] Accessible label; null makes the avatar decorative.
42
- * @property {string|number} [size='md'] Preset (`sm`, `md`, `lg`) or pixel size.
54
+ * @property {string|number} [size='md'] Preset — `sm` 24px, `md` 32px, `lg` 40px at the default
55
+ * spacing unit — or a pixel size. Below 24px the fallback shows a single initial.
43
56
  * @property {'circle'|'rounded'|'square'} [shape='circle'] Avatar shape.
57
+ * @property {AvatarTone|null} [tone=null] Fallback colour from the tone palette. `null` derives a
58
+ * stable tone from the name (or the initials when there is no name), so the same person gets the
59
+ * same colour on every screen; see {@link avatarTone}.
44
60
  * @property {'online'|'away'|'busy'|'offline'|null} [status=null] Optional presence state.
45
61
  * @property {string|null} [statusLabel=null] Text alternative for the presence state.
46
62
  */
47
63
  /**
48
- * Stable-size user image with deterministic initials fallback and optional presence state.
64
+ * The tone palette, in hash order. Every entry is a valid `tone`; the hash picks among the
65
+ * chromatic ones and keeps `slate`, the neutral, for a fallback with no name behind it. Order is
66
+ * part of the contract: changing it moves every derived avatar to a different colour.
67
+ * @type {ReadonlyArray<AvatarTone>}
68
+ */
69
+ export declare const AVATAR_TONES: ReadonlyArray<AvatarTone>;
70
+ /**
71
+ * Stable-size user image with a deterministic fallback — initials on a tone picked from the name —
72
+ * and an optional presence state.
49
73
  * @extends {Component<AvatarOptions>}
50
74
  */
51
75
  export declare class Avatar extends Component<AvatarOptions> {
@@ -61,6 +85,7 @@ export declare class Avatar extends Component<AvatarOptions> {
61
85
  label: string;
62
86
  size: string | number;
63
87
  shape: "circle" | "rounded" | "square";
88
+ tone: AvatarTone;
64
89
  status: "away" | "busy" | "offline" | "online";
65
90
  statusLabel: string;
66
91
  };
@@ -93,8 +118,22 @@ export declare class Avatar extends Component<AvatarOptions> {
93
118
  _syncStatus(): void;
94
119
  }
95
120
  /**
96
- * Derives at most two uppercase initials from the first and last words of a name.
121
+ * Derives uppercase initials from the first and last words of a name.
97
122
  * @param {unknown} name Name-like value.
123
+ * @param {1|2} [limit=2] How many initials to return: two by default, one for an avatar too small
124
+ * to hold two legibly.
98
125
  * @returns {string}
99
126
  */
100
- export declare function avatarInitials(name: unknown): string;
127
+ export declare function avatarInitials(name: unknown, limit?: 1 | 2): string;
128
+ /**
129
+ * Picks a stable fallback tone for a name.
130
+ *
131
+ * The name is trimmed, NFC-normalised and lower-cased, then hashed with 32-bit FNV-1a over its
132
+ * UTF-16 code units, and the hash picks one of the eight chromatic tones of {@link AVATAR_TONES}.
133
+ * The result depends on nothing but the name — not the locale, the page, or the order avatars
134
+ * render in — so a person keeps their colour everywhere. An empty name is `slate`, the neutral
135
+ * tone, which no name hashes to.
136
+ * @param {unknown} name Name-like value.
137
+ * @returns {AvatarTone}
138
+ */
139
+ export declare function avatarTone(name: unknown): AvatarTone;
@@ -1,3 +1,4 @@
1
+ export type BadgeTone = 'blue' | 'teal' | 'green' | 'amber' | 'orange' | 'red' | 'pink' | 'violet' | 'slate';
1
2
  export type BadgeOptions = {
2
3
  /**
3
4
  * Visible badge text.
@@ -11,6 +12,13 @@ export type BadgeOptions = {
11
12
  * Semantic intent.
12
13
  */
13
14
  kind?: 'neutral' | 'accent' | 'success' | 'warning' | 'danger' | 'info';
15
+ /**
16
+ * Categorical colour — a project, a label, a module — from
17
+ * the tone palette rather than the status set, so a tag never reads as a warning. When set it
18
+ * decides the colour and `kind` is ignored for it; `variant` still applies. Unknown names are
19
+ * ignored.
20
+ */
21
+ tone?: BadgeTone | null;
14
22
  /**
15
23
  * Fill treatment.
16
24
  */
@@ -29,7 +37,13 @@ export type BadgeOptions = {
29
37
  title?: string;
30
38
  };
31
39
  /**
32
- * Creates a status pill: a small, non-interactive label carrying a semantic colour.
40
+ * Categorical tones, in the order they are documented.
41
+ * @type {ReadonlyArray<BadgeTone>}
42
+ */
43
+ export declare const BADGE_TONES: ReadonlyArray<BadgeTone>;
44
+ /**
45
+ * Creates a status pill: a small, non-interactive label carrying a semantic colour — or, with
46
+ * `tone`, a categorical one.
33
47
  *
34
48
  * The badge is plain text content, so it needs no ARIA of its own. A badge without a label but
35
49
  * with a `title` is named for assistive technology through `role="img"`.
@@ -44,3 +58,9 @@ export declare function badge(opts?: BadgeOptions): HTMLSpanElement;
44
58
  * @returns {HTMLSpanElement}
45
59
  */
46
60
  export declare function badgeGroup(badges: HTMLSpanElement[]): HTMLSpanElement;
61
+ /**
62
+ * Resolves a categorical tone name, or null for anything outside the palette.
63
+ * @param {unknown} value Requested tone.
64
+ * @returns {BadgeTone|null}
65
+ */
66
+ export declare function normalizeBadgeTone(value: unknown): BadgeTone | null;
@@ -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.
@@ -19,10 +23,19 @@ export type ButtonOptions = {
19
23
  * Whether the button is disabled.
20
24
  */
21
25
  disabled?: boolean;
26
+ /**
27
+ * Whether the button is working on its action — see
28
+ * `setButtonBusy()`.
29
+ */
30
+ busy?: boolean;
22
31
  /**
23
32
  * Native title text.
24
33
  */
25
34
  title?: string;
35
+ /**
36
+ * Keyboard hint; does not register a keyboard handler.
37
+ */
38
+ shortcut?: ButtonShortcut;
26
39
  /**
27
40
  * Click callback.
28
41
  */
@@ -40,3 +53,13 @@ export declare function button(opts?: ButtonOptions): HTMLButtonElement;
40
53
  * @returns {HTMLDivElement}
41
54
  */
42
55
  export declare function buttonGroup(buttons: HTMLButtonElement[]): HTMLDivElement;
56
+ /**
57
+ * Marks a button as working on its action, or done. A busy button shows a spinner before its
58
+ * label, announces `aria-busy`, and ignores activation — but stays focusable, unlike a disabled
59
+ * one, so focus does not fall to the page while the work runs and the reader hears it finish.
60
+ * Works on any `.zx-btn`, including one the application built itself.
61
+ * @param {HTMLButtonElement} element
62
+ * @param {boolean} busy
63
+ * @returns {HTMLButtonElement} The same button.
64
+ */
65
+ export declare function setButtonBusy(element: HTMLButtonElement, busy: boolean): HTMLButtonElement;
@@ -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
  }
@@ -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.
@@ -119,6 +119,10 @@ export type RecordCardOptions = {
119
119
  * Selection presentation.
120
120
  */
121
121
  selectable?: false | 'single' | 'multi';
122
+ /**
123
+ * Selection affordance for owning views.
124
+ */
125
+ selectionTrigger?: 'checkbox' | 'card';
122
126
  /**
123
127
  * Current selection state.
124
128
  */
@@ -209,6 +213,7 @@ export type ResolvedRecordPreview = {
209
213
  * @property {RecordCardLink|((record:ViewRecord,index:number)=>RecordCardLink)} [link]
210
214
  * @property {RecordCardAction[]|((record:ViewRecord,index:number)=>RecordCardAction[])} [actions=[]]
211
215
  * @property {false|'single'|'multi'} [selectable=false] Selection presentation.
216
+ * @property {'checkbox'|'card'} [selectionTrigger='checkbox'] Selection affordance for owning views.
212
217
  * @property {boolean} [selected=false] Current selection state.
213
218
  * @property {'outlined'|'raised'|'filled'} [variant='outlined'] Surface treatment.
214
219
  * @property {1|2|3|4|5|6} [headingLevel=3] Card title heading level.
@@ -229,7 +234,8 @@ export type ResolvedRecordPreview = {
229
234
  *
230
235
  * The returned `<li>` belongs in a semantic `<ul>`/`<ol>`. When selectable its global
231
236
  * `aria-description` announces selection without applying the unsupported `aria-selected` state
232
- * to a listitem; multi-selection also adds a native checkbox. It deliberately remains a listitem
237
+ * to a listitem; multi-selection adds a native checkbox unless the owner opts into card-surface
238
+ * selection. It deliberately remains a listitem
233
239
  * rather than becoming an ARIA option because cards may contain native links and buttons, which
234
240
  * the listbox pattern does not permit inside an option. Preview images are paired with a stable
235
241
  * fallback. The owning component listens for image `error` and marks the fallback.
@@ -22,6 +22,12 @@ export type ChartSpec = {
22
22
  * Engine-specific options.
23
23
  */
24
24
  options: Record<string, unknown>;
25
+ /**
26
+ * Whether the chart must not animate: the operating system asks
27
+ * for reduced motion, or the host sits inside a `data-zx-motion="reduced"` region. An adapter turns
28
+ * its engine's own animation off when this is true; `ChartJsAdapter` sets `animation: false`.
29
+ */
30
+ reducedMotion: boolean;
25
31
  /**
26
32
  * Point-selection callback.
27
33
  */
@@ -155,6 +161,9 @@ export type ChartOptions = {
155
161
  * @property {string} type Chart type.
156
162
  * @property {ChartData} data Chart data.
157
163
  * @property {Record<string, unknown>} options Engine-specific options.
164
+ * @property {boolean} reducedMotion Whether the chart must not animate: the operating system asks
165
+ * for reduced motion, or the host sits inside a `data-zx-motion="reduced"` region. An adapter turns
166
+ * its engine's own animation off when this is true; `ChartJsAdapter` sets `animation: false`.
158
167
  * @property {(detail: ChartSelectDetail) => void} onSelect Point-selection callback.
159
168
  */
160
169
  /**
@@ -223,6 +232,7 @@ export declare class Chart extends Component<ChartOptions> {
223
232
  _handle: ChartHandle;
224
233
  _destroyed: boolean;
225
234
  _observer: ResizeObserver;
235
+ _stopWatchingMotion: () => void;
226
236
  static cssName: string;
227
237
  /** @type {Readonly<ChartOptions>} */
228
238
  static defaults: Readonly<ChartOptions>;
@@ -29,6 +29,12 @@ export type ChecklistOptions = {
29
29
  * Fallback initial checked state.
30
30
  */
31
31
  defaultChecked?: boolean;
32
+ /**
33
+ * Whether the heading is left out. The group keeps the
34
+ * heading text as its accessible name (`aria-label`); a Field labelling the checklist names it
35
+ * instead, which is why the `checklist` field type sets this.
36
+ */
37
+ hideLabel?: boolean;
32
38
  /**
33
39
  * Async item loader.
34
40
  */
@@ -62,6 +68,9 @@ export type ChecklistLoadedDetail = {
62
68
  * @property {boolean} [search=true] Whether the search field is shown.
63
69
  * @property {number} [height=280] Maximum list height in pixels.
64
70
  * @property {boolean} [defaultChecked=false] Fallback initial checked state.
71
+ * @property {boolean} [hideLabel=false] Whether the heading is left out. The group keeps the
72
+ * heading text as its accessible name (`aria-label`); a Field labelling the checklist names it
73
+ * instead, which is why the `checklist` field type sets this.
65
74
  * @property {(() => Promise<ChecklistItem[]>|ChecklistItem[])|null} [load=null] Async item loader.
66
75
  * @property {Record<string, string>|Record<string, Record<string, string>>} [msg] Localized messages.
67
76
  * @property {(event: CustomEvent<ChecklistChangeDetail>) => void} [onchange] Change listener.
@@ -0,0 +1,149 @@
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
+ * Dependency-free source editor for structured text, Markdown, JSON and code. It deliberately uses
66
+ * a native textarea: values remain text-safe, browser undo and IME behavior stay intact, and Tab /
67
+ * Shift+Tab provide predictable indentation without a third-party editor runtime.
68
+ *
69
+ * Capturing Tab is what a code surface has to do, and it would be a keyboard trap if nothing undid
70
+ * it: Escape releases the capture until the next keystroke in the editor, so Escape then Tab (or
71
+ * Shift+Tab) moves focus out of the editor as it would leave any other field.
72
+ * @fires CodeEditor#input
73
+ * @fires CodeEditor#change
74
+ * @extends {Component<CodeEditorOptions>}
75
+ */
76
+ export declare class CodeEditor extends Component<CodeEditorOptions> {
77
+ _createdRoot: boolean;
78
+ _initialChildren: ChildNode[];
79
+ _initialAttributes: Map<string, string>;
80
+ _language: string;
81
+ _languageLabel: HTMLElement;
82
+ _position: HTMLElement;
83
+ _header: HTMLElement;
84
+ _input: HTMLTextAreaElement;
85
+ /** Set by Escape: the next Tab moves focus instead of indenting. */
86
+ _tabReleased: boolean;
87
+ static cssName: string;
88
+ /** @type {CodeEditorOptions} */
89
+ static defaults: CodeEditorOptions;
90
+ /** @returns {HTMLElement} */
91
+ render(): HTMLElement;
92
+ /** @returns {string} */
93
+ getValue(): string;
94
+ /**
95
+ * Replaces the editor text.
96
+ * @param {unknown} value New value.
97
+ * @param {{silent?:boolean}} [options={}] Suppress the `change` event.
98
+ * @returns {this}
99
+ */
100
+ setValue(value: unknown, { silent }?: {
101
+ silent?: boolean;
102
+ }): this;
103
+ /** @param {unknown} language New language identifier. @returns {this} */
104
+ setLanguage(language: unknown): this;
105
+ /** @returns {this} */
106
+ focus(): this;
107
+ /** @returns {this} */
108
+ enable(): this;
109
+ /** @returns {this} */
110
+ disable(): this;
111
+ /** @param {boolean} value Read-only state. @returns {this} */
112
+ setReadOnly(value: boolean): this;
113
+ /** @param {KeyboardEvent} event @returns {void} */
114
+ _handleKeydown(event: KeyboardEvent): void;
115
+ /** @returns {void} */
116
+ _updatePosition(): void;
117
+ /** @returns {void} */
118
+ destroy(): void;
119
+ }
120
+ /**
121
+ * Applies Tab or Shift+Tab to a textarea selection.
122
+ * @param {string} value Complete source value.
123
+ * @param {number} start Selection start.
124
+ * @param {number} end Selection end.
125
+ * @param {string} indent Indentation text.
126
+ * @param {boolean} outdent Whether to remove indentation.
127
+ * @returns {{value:string,start:number,end:number}}
128
+ */
129
+ export declare function indentSelection(value: string, start: number, end: number, indent?: string, outdent?: boolean): {
130
+ value: string;
131
+ start: number;
132
+ end: number;
133
+ };
134
+ /** @param {string} value @param {number} start @param {number} end @returns {{line:number,column:number,lines:number}} */
135
+ export declare function editorPosition(value: string, start: number, end?: number): {
136
+ line: number;
137
+ column: number;
138
+ lines: number;
139
+ };
140
+ /**
141
+ * Code editor input event.
142
+ * @event CodeEditor#input
143
+ * @type {CustomEvent<{value:string}>}
144
+ */
145
+ /**
146
+ * Code editor committed change event.
147
+ * @event CodeEditor#change
148
+ * @type {CustomEvent<{value:string}>}
149
+ */
@@ -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
  }
@@ -29,7 +29,8 @@ export type DateRangeBoxOptions = {
29
29
  */
30
30
  placeholder?: string | null;
31
31
  /**
32
- * Show a clear button while a range is present.
32
+ * Show a clear button while a range is present and the box is
33
+ * enabled; without it the input keeps no room for one.
33
34
  */
34
35
  clearable?: boolean;
35
36
  /**
@@ -119,6 +120,7 @@ export declare function formatRangeText(range: DateRange | null, format: string,
119
120
  export declare class DateRangeBox extends Component<DateRangeBoxOptions> {
120
121
  _originalState: string;
121
122
  _originalAriaDisabled: string;
123
+ _originalClearable: string;
122
124
  _format: string;
123
125
  _separator: string;
124
126
  _disabled: boolean;
@@ -209,6 +211,8 @@ export declare class DateRangeBox extends Component<DateRangeBoxOptions> {
209
211
  _placeholder(): string;
210
212
  /** @returns {void} */
211
213
  _syncDisplay(): void;
214
+ /** A disabled box offers no clear button: there is nothing it could do. @returns {void} */
215
+ _syncClear(): void;
212
216
  /** @returns {void} */
213
217
  _syncDisabled(): void;
214
218
  /** @returns {void} */
@@ -26,7 +26,8 @@ export type DateboxOptions = {
26
26
  */
27
27
  placeholder?: string | null;
28
28
  /**
29
- * Show a clear button when a value is present.
29
+ * Show a clear button while a value is present and the box is
30
+ * enabled; without it the input keeps no room for one.
30
31
  */
31
32
  clearable?: boolean;
32
33
  /**
@@ -66,7 +67,8 @@ export type DateboxUnit = 'date' | 'seconds';
66
67
  * @property {Date|null} [min=null] Earliest selectable date.
67
68
  * @property {Date|null} [max=null] Latest selectable date.
68
69
  * @property {string|null} [placeholder=null] Input placeholder; null derives one from the format.
69
- * @property {boolean} [clearable=true] Show a clear button when a value is present.
70
+ * @property {boolean} [clearable=true] Show a clear button while a value is present and the box is
71
+ * enabled; without it the input keeps no room for one.
70
72
  * @property {boolean} [disabled=false] Disable all controls.
71
73
  * @property {(event: CustomEvent<{date: Date|null}>) => void} [onchange] Change listener.
72
74
  * @property {(event: CustomEvent<{text: string}>) => void} [oninvalid] Invalid-input listener.
@@ -86,6 +88,7 @@ export type DateboxUnit = 'date' | 'seconds';
86
88
  export declare class Datebox extends Component<DateboxOptions> {
87
89
  _originalState: string;
88
90
  _originalAriaDisabled: string;
91
+ _originalClearable: string;
89
92
  _format: string;
90
93
  _disabled: boolean;
91
94
  _open: boolean;
@@ -142,6 +145,8 @@ export declare class Datebox extends Component<DateboxOptions> {
142
145
  _normalizeValue(value: Date | number | string | null | unknown): Date | null;
143
146
  /** @returns {void} */
144
147
  _syncDisplay(): void;
148
+ /** A disabled box offers no clear button: there is nothing it could do. @returns {void} */
149
+ _syncClear(): void;
145
150
  /** @returns {void} */
146
151
  _syncDisabled(): void;
147
152
  /** @returns {void} */