@zeyos/zx 2.1.0 → 2.2.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 (311) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +15 -0
  3. package/dist/types/compat/base.d.ts +156 -0
  4. package/dist/types/compat/globals.d.ts +20 -0
  5. package/dist/types/compat/index.d.ts +128 -0
  6. package/dist/types/compat/map/basic.d.ts +175 -0
  7. package/dist/types/compat/map/data.d.ts +102 -0
  8. package/dist/types/compat/map/date-time.d.ts +80 -0
  9. package/dist/types/compat/map/factory.d.ts +9 -0
  10. package/dist/types/compat/map/form.d.ts +98 -0
  11. package/dist/types/compat/map/helpers.d.ts +12 -0
  12. package/dist/types/compat/map/http.d.ts +36 -0
  13. package/dist/types/compat/map/layout.d.ts +106 -0
  14. package/dist/types/compat/map/options.d.ts +80 -0
  15. package/dist/types/compat/map/select.d.ts +95 -0
  16. package/dist/types/compat/map/stubs.d.ts +32 -0
  17. package/dist/types/compat/map/utilities.d.ts +37 -0
  18. package/dist/types/compat-entry.d.ts +5 -0
  19. package/dist/types/components/badge/badge.d.ts +46 -0
  20. package/dist/types/components/breadcrumb/breadcrumb.d.ts +200 -0
  21. package/dist/types/components/button/button.d.ts +42 -0
  22. package/dist/types/components/check-button/check-button.d.ts +98 -0
  23. package/dist/types/components/checklist/checklist.d.ts +143 -0
  24. package/dist/types/components/checklist/field-adapter.d.ts +5 -0
  25. package/dist/types/components/context-menu/context-menu.d.ts +130 -0
  26. package/dist/types/components/copy/copy-button.d.ts +48 -0
  27. package/dist/types/components/copy/copy-input.d.ts +91 -0
  28. package/dist/types/components/data-filter/data-filter.d.ts +250 -0
  29. package/dist/types/components/data-filter/filter-core.d.ts +52 -0
  30. package/dist/types/components/date-picker/date-picker.d.ts +137 -0
  31. package/dist/types/components/date-picker/date-range-picker.d.ts +350 -0
  32. package/dist/types/components/date-picker/field-adapter.d.ts +6 -0
  33. package/dist/types/components/date-picker/month-picker.d.ts +75 -0
  34. package/dist/types/components/date-picker/range-field-adapter.d.ts +7 -0
  35. package/dist/types/components/date-picker/time-picker.d.ts +127 -0
  36. package/dist/types/components/datebox/date-range-box.d.ts +218 -0
  37. package/dist/types/components/datebox/datebox.d.ts +160 -0
  38. package/dist/types/components/datebox/field-adapter.d.ts +5 -0
  39. package/dist/types/components/dialog/dialog.d.ts +284 -0
  40. package/dist/types/components/dropdown/dropdown.d.ts +118 -0
  41. package/dist/types/components/empty-state/empty-state.d.ts +38 -0
  42. package/dist/types/components/field/field.d.ts +231 -0
  43. package/dist/types/components/field-upload/field-adapter.d.ts +5 -0
  44. package/dist/types/components/field-upload/field-upload.d.ts +213 -0
  45. package/dist/types/components/fieldset/fieldset.d.ts +125 -0
  46. package/dist/types/components/finder/finder.d.ts +252 -0
  47. package/dist/types/components/form/form.d.ts +194 -0
  48. package/dist/types/components/groupbox/groupbox.d.ts +89 -0
  49. package/dist/types/components/layout/layout.d.ts +132 -0
  50. package/dist/types/components/loading/inline-loading.d.ts +86 -0
  51. package/dist/types/components/loading/progress-bar.d.ts +168 -0
  52. package/dist/types/components/loading/spinner.d.ts +34 -0
  53. package/dist/types/components/master-panel/master-panel.d.ts +112 -0
  54. package/dist/types/components/menu-button/menu-button.d.ts +142 -0
  55. package/dist/types/components/message/message.d.ts +212 -0
  56. package/dist/types/components/modal/modal.d.ts +105 -0
  57. package/dist/types/components/multi-value-editor/field-adapter.d.ts +5 -0
  58. package/dist/types/components/multi-value-editor/multi-value-editor.d.ts +66 -0
  59. package/dist/types/components/navigation-bar/navigation-bar.d.ts +229 -0
  60. package/dist/types/components/number-field/field-adapter.d.ts +5 -0
  61. package/dist/types/components/number-field/number-field.d.ts +292 -0
  62. package/dist/types/components/pagination/pagination.d.ts +267 -0
  63. package/dist/types/components/panel/panel.d.ts +194 -0
  64. package/dist/types/components/permission/permission.d.ts +93 -0
  65. package/dist/types/components/rating/field-adapter.d.ts +5 -0
  66. package/dist/types/components/rating/rating.d.ts +213 -0
  67. package/dist/types/components/search/search.d.ts +98 -0
  68. package/dist/types/components/select/field-adapter.d.ts +5 -0
  69. package/dist/types/components/select/filter.d.ts +11 -0
  70. package/dist/types/components/select/select.d.ts +235 -0
  71. package/dist/types/components/skeleton/skeleton.d.ts +97 -0
  72. package/dist/types/components/slider/field-adapter.d.ts +5 -0
  73. package/dist/types/components/slider/slider.d.ts +216 -0
  74. package/dist/types/components/split-view/split-view.d.ts +335 -0
  75. package/dist/types/components/stepper/stepper.d.ts +314 -0
  76. package/dist/types/components/stepper/steps.d.ts +131 -0
  77. package/dist/types/components/tabbox/tabbox.d.ts +230 -0
  78. package/dist/types/components/table/sort.d.ts +49 -0
  79. package/dist/types/components/table/table.d.ts +872 -0
  80. package/dist/types/components/tag-picker/field-adapter.d.ts +5 -0
  81. package/dist/types/components/tag-picker/tag-picker.d.ts +375 -0
  82. package/dist/types/components/timebox/field-adapter.d.ts +5 -0
  83. package/dist/types/components/timebox/timebox.d.ts +121 -0
  84. package/dist/types/components/toggle/field-adapter.d.ts +5 -0
  85. package/dist/types/components/toggle/toggle.d.ts +94 -0
  86. package/dist/types/components/toolbar/toolbar.d.ts +230 -0
  87. package/dist/types/components/tooltip/tooltip.d.ts +183 -0
  88. package/dist/types/components/tree/hierarchy.d.ts +113 -0
  89. package/dist/types/components/tree/tree.d.ts +383 -0
  90. package/dist/types/components/truncate/truncate.d.ts +61 -0
  91. package/dist/types/components/value-list/field-adapter.d.ts +5 -0
  92. package/dist/types/components/value-list/value-list.d.ts +143 -0
  93. package/dist/types/core/breakpoint.d.ts +68 -0
  94. package/dist/types/core/component.d.ts +115 -0
  95. package/dist/types/core/date.d.ts +50 -0
  96. package/dist/types/core/dom.d.ts +86 -0
  97. package/dist/types/core/export.d.ts +70 -0
  98. package/dist/types/core/fontawesome.d.ts +107 -0
  99. package/dist/types/core/format.d.ts +107 -0
  100. package/dist/types/core/http.d.ts +122 -0
  101. package/dist/types/core/i18n.d.ts +35 -0
  102. package/dist/types/core/icons.d.ts +137 -0
  103. package/dist/types/core/keyboard.d.ts +72 -0
  104. package/dist/types/core/position.d.ts +45 -0
  105. package/dist/types/core/storage.d.ts +46 -0
  106. package/dist/types/core/util.d.ts +117 -0
  107. package/dist/types/elements/define.d.ts +73 -0
  108. package/dist/types/elements/reflect.d.ts +27 -0
  109. package/dist/types/index.d.ts +79 -0
  110. package/dist/types/zeyos/connect.d.ts +65 -0
  111. package/dist/types/zeyos/form.d.ts +140 -0
  112. package/dist/types/zeyos/icons.d.ts +104 -0
  113. package/dist/types/zeyos/index.d.ts +12 -0
  114. package/dist/types/zeyos/modules.d.ts +110 -0
  115. package/dist/types/zeyos/query.d.ts +157 -0
  116. package/dist/types/zeyos/schema.d.ts +79 -0
  117. package/dist/types/zeyos/select.d.ts +167 -0
  118. package/dist/types/zeyos/table.d.ts +205 -0
  119. package/dist/zx-compat.esm.js +362 -33
  120. package/dist/zx-compat.esm.min.js +1 -1
  121. package/dist/zx-compat.global.js +359 -67
  122. package/dist/zx-compat.global.min.js +3 -3
  123. package/dist/zx-zeyos.esm.js +342 -43
  124. package/dist/zx-zeyos.esm.min.js +1 -1
  125. package/dist/zx.css +68 -6
  126. package/dist/zx.esm.js +346 -67
  127. package/dist/zx.esm.min.js +3 -3
  128. package/dist/zx.global.js +346 -67
  129. package/dist/zx.global.min.js +3 -3
  130. package/dist/zx.min.css +1 -1
  131. package/docs/api.json +48 -2
  132. package/docs/llms.md +28 -0
  133. package/package.json +37 -9
  134. package/src/compat/base.js +291 -0
  135. package/src/compat/globals.js +165 -0
  136. package/src/compat/index.js +84 -0
  137. package/src/compat/map/basic.js +464 -0
  138. package/src/compat/map/data.js +232 -0
  139. package/src/compat/map/date-time.js +177 -0
  140. package/src/compat/map/factory.js +45 -0
  141. package/src/compat/map/form.js +330 -0
  142. package/src/compat/map/helpers.js +46 -0
  143. package/src/compat/map/http.js +117 -0
  144. package/src/compat/map/layout.js +256 -0
  145. package/src/compat/map/options.js +267 -0
  146. package/src/compat/map/select.js +198 -0
  147. package/src/compat/map/stubs.js +26 -0
  148. package/src/compat/map/utilities.js +113 -0
  149. package/src/compat-entry.js +11 -0
  150. package/src/components/badge/badge.css +147 -0
  151. package/src/components/badge/badge.js +92 -0
  152. package/src/components/breadcrumb/breadcrumb.css +105 -0
  153. package/src/components/breadcrumb/breadcrumb.js +331 -0
  154. package/src/components/button/button.css +104 -0
  155. package/src/components/button/button.js +76 -0
  156. package/src/components/check-button/check-button.css +66 -0
  157. package/src/components/check-button/check-button.js +167 -0
  158. package/src/components/checklist/checklist.css +65 -0
  159. package/src/components/checklist/checklist.js +282 -0
  160. package/src/components/checklist/field-adapter.js +46 -0
  161. package/src/components/context-menu/context-menu.css +54 -0
  162. package/src/components/context-menu/context-menu.js +334 -0
  163. package/src/components/copy/copy-button.css +27 -0
  164. package/src/components/copy/copy-button.js +78 -0
  165. package/src/components/copy/copy-input.css +59 -0
  166. package/src/components/copy/copy-input.js +123 -0
  167. package/src/components/data-filter/data-filter.css +53 -0
  168. package/src/components/data-filter/data-filter.js +400 -0
  169. package/src/components/data-filter/filter-core.js +128 -0
  170. package/src/components/date-picker/date-picker.css +181 -0
  171. package/src/components/date-picker/date-picker.js +500 -0
  172. package/src/components/date-picker/date-range-picker.css +264 -0
  173. package/src/components/date-picker/date-range-picker.js +990 -0
  174. package/src/components/date-picker/field-adapter.js +36 -0
  175. package/src/components/date-picker/month-picker.js +223 -0
  176. package/src/components/date-picker/range-field-adapter.js +31 -0
  177. package/src/components/date-picker/time-picker.css +191 -0
  178. package/src/components/date-picker/time-picker.js +406 -0
  179. package/src/components/datebox/date-range-box.css +128 -0
  180. package/src/components/datebox/date-range-box.js +492 -0
  181. package/src/components/datebox/datebox.css +108 -0
  182. package/src/components/datebox/datebox.js +358 -0
  183. package/src/components/datebox/field-adapter.js +34 -0
  184. package/src/components/dialog/dialog.css +74 -0
  185. package/src/components/dialog/dialog.js +450 -0
  186. package/src/components/dropdown/dropdown.css +24 -0
  187. package/src/components/dropdown/dropdown.js +288 -0
  188. package/src/components/empty-state/empty-state.css +80 -0
  189. package/src/components/empty-state/empty-state.js +92 -0
  190. package/src/components/field/field.css +127 -0
  191. package/src/components/field/field.js +605 -0
  192. package/src/components/field-upload/field-adapter.js +21 -0
  193. package/src/components/field-upload/field-upload.css +108 -0
  194. package/src/components/field-upload/field-upload.js +475 -0
  195. package/src/components/fieldset/fieldset.css +37 -0
  196. package/src/components/fieldset/fieldset.js +307 -0
  197. package/src/components/finder/finder.css +98 -0
  198. package/src/components/finder/finder.js +509 -0
  199. package/src/components/form/form.css +32 -0
  200. package/src/components/form/form.js +302 -0
  201. package/src/components/groupbox/groupbox.css +51 -0
  202. package/src/components/groupbox/groupbox.js +199 -0
  203. package/src/components/layout/layout.css +117 -0
  204. package/src/components/layout/layout.js +136 -0
  205. package/src/components/loading/inline-loading.css +34 -0
  206. package/src/components/loading/inline-loading.js +140 -0
  207. package/src/components/loading/progress-bar.css +115 -0
  208. package/src/components/loading/progress-bar.js +259 -0
  209. package/src/components/loading/spinner.css +58 -0
  210. package/src/components/loading/spinner.js +57 -0
  211. package/src/components/master-panel/master-panel.css +51 -0
  212. package/src/components/master-panel/master-panel.js +203 -0
  213. package/src/components/menu-button/menu-button.css +49 -0
  214. package/src/components/menu-button/menu-button.js +294 -0
  215. package/src/components/message/message.css +122 -0
  216. package/src/components/message/message.js +499 -0
  217. package/src/components/modal/modal.css +47 -0
  218. package/src/components/modal/modal.js +203 -0
  219. package/src/components/multi-value-editor/field-adapter.js +44 -0
  220. package/src/components/multi-value-editor/multi-value-editor.css +56 -0
  221. package/src/components/multi-value-editor/multi-value-editor.js +170 -0
  222. package/src/components/navigation-bar/navigation-bar.css +130 -0
  223. package/src/components/navigation-bar/navigation-bar.js +450 -0
  224. package/src/components/number-field/field-adapter.js +40 -0
  225. package/src/components/number-field/number-field.css +77 -0
  226. package/src/components/number-field/number-field.js +545 -0
  227. package/src/components/pagination/pagination.css +95 -0
  228. package/src/components/pagination/pagination.js +481 -0
  229. package/src/components/panel/panel.css +123 -0
  230. package/src/components/panel/panel.js +336 -0
  231. package/src/components/permission/permission.css +47 -0
  232. package/src/components/permission/permission.js +198 -0
  233. package/src/components/rating/field-adapter.js +34 -0
  234. package/src/components/rating/rating.css +97 -0
  235. package/src/components/rating/rating.js +395 -0
  236. package/src/components/search/search.css +70 -0
  237. package/src/components/search/search.js +193 -0
  238. package/src/components/select/field-adapter.js +24 -0
  239. package/src/components/select/filter.js +39 -0
  240. package/src/components/select/select.css +180 -0
  241. package/src/components/select/select.js +663 -0
  242. package/src/components/skeleton/skeleton.css +76 -0
  243. package/src/components/skeleton/skeleton.js +139 -0
  244. package/src/components/slider/field-adapter.js +36 -0
  245. package/src/components/slider/slider.css +181 -0
  246. package/src/components/slider/slider.js +399 -0
  247. package/src/components/split-view/split-view.css +139 -0
  248. package/src/components/split-view/split-view.js +806 -0
  249. package/src/components/stepper/stepper.css +234 -0
  250. package/src/components/stepper/stepper.js +459 -0
  251. package/src/components/stepper/steps.js +131 -0
  252. package/src/components/tabbox/tabbox.css +281 -0
  253. package/src/components/tabbox/tabbox.js +484 -0
  254. package/src/components/table/sort.js +85 -0
  255. package/src/components/table/table.css +364 -0
  256. package/src/components/table/table.js +1693 -0
  257. package/src/components/tag-picker/field-adapter.js +35 -0
  258. package/src/components/tag-picker/tag-picker.css +169 -0
  259. package/src/components/tag-picker/tag-picker.js +837 -0
  260. package/src/components/timebox/field-adapter.js +24 -0
  261. package/src/components/timebox/timebox.css +51 -0
  262. package/src/components/timebox/timebox.js +276 -0
  263. package/src/components/toggle/field-adapter.js +24 -0
  264. package/src/components/toggle/toggle.css +66 -0
  265. package/src/components/toggle/toggle.js +150 -0
  266. package/src/components/toolbar/toolbar.css +81 -0
  267. package/src/components/toolbar/toolbar.js +511 -0
  268. package/src/components/tooltip/tooltip.css +36 -0
  269. package/src/components/tooltip/tooltip.js +420 -0
  270. package/src/components/tree/hierarchy.js +151 -0
  271. package/src/components/tree/tree.css +99 -0
  272. package/src/components/tree/tree.js +784 -0
  273. package/src/components/truncate/truncate.css +20 -0
  274. package/src/components/truncate/truncate.js +92 -0
  275. package/src/components/value-list/field-adapter.js +24 -0
  276. package/src/components/value-list/value-list.css +108 -0
  277. package/src/components/value-list/value-list.js +336 -0
  278. package/src/core/breakpoint.js +150 -0
  279. package/src/core/component.js +292 -0
  280. package/src/core/date.js +216 -0
  281. package/src/core/dom.js +260 -0
  282. package/src/core/export.js +204 -0
  283. package/src/core/fontawesome.js +177 -0
  284. package/src/core/format.js +283 -0
  285. package/src/core/http.js +246 -0
  286. package/src/core/i18n.js +83 -0
  287. package/src/core/icons.js +283 -0
  288. package/src/core/keyboard.js +240 -0
  289. package/src/core/position.js +177 -0
  290. package/src/core/storage.js +175 -0
  291. package/src/core/util.js +336 -0
  292. package/src/elements/define.js +715 -0
  293. package/src/elements/reflect.js +79 -0
  294. package/src/index.js +131 -0
  295. package/src/zeyos/connect.js +142 -0
  296. package/src/zeyos/form.js +254 -0
  297. package/src/zeyos/icons.js +92 -0
  298. package/src/zeyos/index.js +21 -0
  299. package/src/zeyos/modules.js +269 -0
  300. package/src/zeyos/query.js +199 -0
  301. package/src/zeyos/schema.js +474 -0
  302. package/src/zeyos/select.js +175 -0
  303. package/src/zeyos/table.js +272 -0
  304. package/styles/base.css +124 -0
  305. package/styles/icons.css +34 -0
  306. package/styles/tokens/dark.css +84 -0
  307. package/styles/tokens/density.css +9 -0
  308. package/styles/tokens/global.css +80 -0
  309. package/styles/tokens/modules.css +109 -0
  310. package/styles/tokens/semantic.css +49 -0
  311. package/styles/zx.css +61 -0
@@ -0,0 +1,335 @@
1
+ import { Component } from '../../core/component.js';
2
+ export type SplitViewContent = string | Node | Component | null;
3
+ export type SplitViewOptions = {
4
+ /**
5
+ * Split axis. `horizontal` puts the
6
+ * panes side by side behind a vertical divider; `vertical` stacks them behind a horizontal one.
7
+ */
8
+ orientation?: 'horizontal' | 'vertical';
9
+ /**
10
+ * Leading pane content (left, or top).
11
+ */
12
+ start?: SplitViewContent;
13
+ /**
14
+ * Trailing pane content (right, or bottom).
15
+ */
16
+ end?: SplitViewContent;
17
+ /**
18
+ * Initial size of the START pane. A number is pixels, a
19
+ * string is any CSS length the browser understands; `%` resolves against the container.
20
+ */
21
+ size?: number | string;
22
+ /**
23
+ * Smallest the start pane may become, in pixels.
24
+ */
25
+ min?: number;
26
+ /**
27
+ * Largest the start pane may become, in pixels; null means "as
28
+ * large as the container allows".
29
+ */
30
+ max?: number | null;
31
+ /**
32
+ * Which pane Enter/Space on the divider hides.
33
+ */
34
+ collapsible?: false | 'start' | 'end';
35
+ /**
36
+ * Whether a pane starts collapsed; `true` uses
37
+ * the `collapsible` pane.
38
+ */
39
+ collapsed?: boolean | 'start' | 'end';
40
+ /**
41
+ * Snap radius in pixels. A drag that ends within this distance of the
42
+ * initial size, the minimum, or the maximum lands exactly on it. `0` disables snapping.
43
+ */
44
+ snap?: number;
45
+ /**
46
+ * Key under which the size is remembered between visits.
47
+ * Storage failures degrade to memory rather than throwing.
48
+ */
49
+ storageKey?: string | null;
50
+ /**
51
+ * Whether resizing is blocked.
52
+ */
53
+ disabled?: boolean;
54
+ /**
55
+ * Accessible name of the divider.
56
+ */
57
+ label?: string;
58
+ /**
59
+ * Resize listener.
60
+ */
61
+ onresize?: (event: CustomEvent<{
62
+ size: number;
63
+ ratio: number;
64
+ }>) => void;
65
+ /**
66
+ * Resize-end listener.
67
+ */
68
+ onresizeend?: (event: CustomEvent<{
69
+ size: number;
70
+ ratio: number;
71
+ }>) => void;
72
+ /**
73
+ * Collapse listener.
74
+ */
75
+ oncollapse?: (event: CustomEvent<{
76
+ pane: 'start' | 'end';
77
+ }>) => void;
78
+ /**
79
+ * Expand listener.
80
+ */
81
+ onexpand?: (event: CustomEvent<Record<string, never>>) => void;
82
+ };
83
+ /** @typedef {string|Node|Component|null} SplitViewContent */
84
+ /**
85
+ * @typedef {Object} SplitViewOptions
86
+ * @property {'horizontal'|'vertical'} [orientation='horizontal'] Split axis. `horizontal` puts the
87
+ * panes side by side behind a vertical divider; `vertical` stacks them behind a horizontal one.
88
+ * @property {SplitViewContent} [start=null] Leading pane content (left, or top).
89
+ * @property {SplitViewContent} [end=null] Trailing pane content (right, or bottom).
90
+ * @property {number|string} [size='38%'] Initial size of the START pane. A number is pixels, a
91
+ * string is any CSS length the browser understands; `%` resolves against the container.
92
+ * @property {number} [min=160] Smallest the start pane may become, in pixels.
93
+ * @property {number|null} [max=null] Largest the start pane may become, in pixels; null means "as
94
+ * large as the container allows".
95
+ * @property {false|'start'|'end'} [collapsible=false] Which pane Enter/Space on the divider hides.
96
+ * @property {boolean|'start'|'end'} [collapsed=false] Whether a pane starts collapsed; `true` uses
97
+ * the `collapsible` pane.
98
+ * @property {number} [snap=0] Snap radius in pixels. A drag that ends within this distance of the
99
+ * initial size, the minimum, or the maximum lands exactly on it. `0` disables snapping.
100
+ * @property {string|null} [storageKey=null] Key under which the size is remembered between visits.
101
+ * Storage failures degrade to memory rather than throwing.
102
+ * @property {boolean} [disabled=false] Whether resizing is blocked.
103
+ * @property {string} [label='Resize panes'] Accessible name of the divider.
104
+ * @property {(event: CustomEvent<{size: number, ratio: number}>) => void} [onresize] Resize listener.
105
+ * @property {(event: CustomEvent<{size: number, ratio: number}>) => void} [onresizeend] Resize-end listener.
106
+ * @property {(event: CustomEvent<{pane: 'start'|'end'}>) => void} [oncollapse] Collapse listener.
107
+ * @property {(event: CustomEvent<Record<string, never>>) => void} [onexpand] Expand listener.
108
+ */
109
+ /**
110
+ * Two panes and a draggable divider between them.
111
+ *
112
+ * The layout is a three-track CSS grid driven by a single custom property, `--zx-split-size`, so a
113
+ * drag writes one style value per frame and the browser does the rest — no per-pane width
114
+ * arithmetic, no reflow storm. The property holds whatever was asked for: `38%` stays a percentage
115
+ * and keeps tracking the container until someone drags, at which point it becomes a pixel value
116
+ * and stays put.
117
+ *
118
+ * The divider follows the WAI-ARIA window splitter pattern: it is a focusable `separator` carrying
119
+ * live `aria-valuenow`/`aria-valuemin`/`aria-valuemax` in pixels, it moves with the arrow keys, and
120
+ * — where the component is `collapsible` — Enter or Space folds a pane away.
121
+ * @fires SplitView#resize
122
+ * @fires SplitView#resizeend
123
+ * @fires SplitView#collapse
124
+ * @fires SplitView#expand
125
+ * @extends {Component<SplitViewOptions>}
126
+ */
127
+ export declare class SplitView extends Component<SplitViewOptions> {
128
+ #private;
129
+ _orientation: string;
130
+ /** Current start size in pixels, or null while the CSS value in the property is in charge. */
131
+ _size: number;
132
+ /** @type {'start'|'end'|null} */
133
+ _collapsed: 'start' | 'end' | null;
134
+ _disabled: boolean;
135
+ _destroyed: boolean;
136
+ _dragging: boolean;
137
+ /** Handle of the frame a pending drag update is scheduled in; `0` if none. */
138
+ _frame: number;
139
+ /** @type {number|null} */
140
+ _pointerId: number | null;
141
+ _startClient: number;
142
+ _startSize: number;
143
+ _pointerClient: number;
144
+ /** Whether the pointer left its starting position, which separates a drag from a click. */
145
+ _moved: boolean;
146
+ /** Container size of the last observer pass; `-1` forces the next one to run. */
147
+ _lastTotal: any;
148
+ _createdRoot: boolean;
149
+ _snapshot: import("../../core/dom.js").TargetSnapshot;
150
+ static cssName: string;
151
+ /** @type {Readonly<SplitViewOptions>} */
152
+ static defaults: Readonly<SplitViewOptions>;
153
+ /**
154
+ * Creates a split view, or turns an existing element into one.
155
+ * @param {Element|string|null} [target=null] Existing container, selector, or null to create one.
156
+ * @param {SplitViewOptions} [options={}] Split-view options.
157
+ */
158
+ constructor(target?: Element | string | null, options?: SplitViewOptions);
159
+ /**
160
+ * Builds the panes and the divider. Runs inside the base constructor, before any class field
161
+ * exists, so every value it needs later is an ordinary instance property assigned here.
162
+ * @returns {HTMLElement}
163
+ */
164
+ render(): HTMLElement;
165
+ /**
166
+ * Sets the start pane size. Pixels and percentages are clamped against `min`, `max`, and the
167
+ * container immediately; any other CSS length is handed to the browser unclamped. Programmatic,
168
+ * so it emits nothing.
169
+ * @param {number|string} value Pixel number or CSS length.
170
+ * @returns {this}
171
+ */
172
+ setSize(value: number | string): this;
173
+ /**
174
+ * Returns the start pane's current size in pixels: `0` while the start pane is collapsed, and
175
+ * everything but the divider while the end pane is.
176
+ * @returns {number}
177
+ */
178
+ getSize(): number;
179
+ /**
180
+ * Returns the start pane's share of the container, between 0 and 1.
181
+ * @returns {number}
182
+ */
183
+ getRatio(): number;
184
+ /**
185
+ * Replaces the start pane's content.
186
+ * @param {SplitViewContent} content Text, node, component, or null to empty the pane.
187
+ * @returns {this}
188
+ */
189
+ setStart(content: SplitViewContent): this;
190
+ /**
191
+ * Replaces the end pane's content.
192
+ * @param {SplitViewContent} content Text, node, component, or null to empty the pane.
193
+ * @returns {this}
194
+ */
195
+ setEnd(content: SplitViewContent): this;
196
+ /**
197
+ * Folds one pane away, keeping the remembered size for `expand()`. Works whatever `collapsible`
198
+ * says — that option only governs the keyboard affordance.
199
+ * @param {'start'|'end'} [which] Pane to hide; defaults to the `collapsible` pane, else `start`.
200
+ * @returns {this}
201
+ * @fires SplitView#collapse
202
+ */
203
+ collapse(which?: 'start' | 'end'): this;
204
+ /**
205
+ * Restores a collapsed pane to the size it had.
206
+ * @returns {this}
207
+ * @fires SplitView#expand
208
+ */
209
+ expand(): this;
210
+ /**
211
+ * Reports which pane is collapsed, if any.
212
+ * @returns {'start'|'end'|false}
213
+ */
214
+ isCollapsed(): 'start' | 'end' | false;
215
+ /**
216
+ * Allows resizing again and puts the divider back in the tab order.
217
+ * @returns {this}
218
+ */
219
+ enable(): this;
220
+ /**
221
+ * Blocks pointer and keyboard resizing and takes the divider out of the tab order. Any drag in
222
+ * flight ends immediately.
223
+ * @returns {this}
224
+ */
225
+ disable(): this;
226
+ /**
227
+ * Reports whether resizing is blocked.
228
+ * @returns {boolean}
229
+ */
230
+ isDisabled(): boolean;
231
+ /**
232
+ * Disconnects the observer, drops listeners, and restores an enhanced target's original content.
233
+ * @returns {void}
234
+ */
235
+ destroy(): void;
236
+ }
237
+ export type SizeBounds = {
238
+ /**
239
+ * Smallest legal start size in pixels.
240
+ */
241
+ min: number;
242
+ /**
243
+ * Largest legal start size in pixels.
244
+ */
245
+ max: number;
246
+ };
247
+ export type ClampSizeInput = {
248
+ /**
249
+ * Requested start size in pixels.
250
+ */
251
+ size: number;
252
+ /**
253
+ * Smallest start size in pixels.
254
+ */
255
+ min?: number;
256
+ /**
257
+ * Largest start size in pixels, or null for "whatever fits".
258
+ */
259
+ max?: number | null;
260
+ /**
261
+ * Container size along the split axis, in pixels.
262
+ */
263
+ total?: number;
264
+ /**
265
+ * Divider thickness, in pixels.
266
+ */
267
+ divider?: number;
268
+ };
269
+ /**
270
+ * Fired while the divider moves, at most once per animation frame during a drag.
271
+ * @event SplitView#resize
272
+ * @type {CustomEvent<{size: number, ratio: number}>}
273
+ */
274
+ /**
275
+ * Fired once an interaction settles: a drag ends, a key moves the divider, or a double-click
276
+ * resets it.
277
+ * @event SplitView#resizeend
278
+ * @type {CustomEvent<{size: number, ratio: number}>}
279
+ */
280
+ /**
281
+ * Fired when a pane folds away.
282
+ * @event SplitView#collapse
283
+ * @type {CustomEvent<{pane: 'start'|'end'}>}
284
+ */
285
+ /**
286
+ * Fired when a collapsed pane comes back.
287
+ * @event SplitView#expand
288
+ * @type {CustomEvent<Record<string, never>>}
289
+ */
290
+ /**
291
+ * @typedef {Object} SizeBounds
292
+ * @property {number} min Smallest legal start size in pixels.
293
+ * @property {number} max Largest legal start size in pixels.
294
+ */
295
+ /**
296
+ * @typedef {Object} ClampSizeInput
297
+ * @property {number} size Requested start size in pixels.
298
+ * @property {number} [min=0] Smallest start size in pixels.
299
+ * @property {number|null} [max=null] Largest start size in pixels, or null for "whatever fits".
300
+ * @property {number} [total=0] Container size along the split axis, in pixels.
301
+ * @property {number} [divider=0] Divider thickness, in pixels.
302
+ */
303
+ /**
304
+ * Restricts a start-pane size to what the container can actually give it.
305
+ *
306
+ * The upper bound is never more than the space left after the divider, so the trailing pane can
307
+ * never be pushed to a negative size; when the container is too small even for `min`, the minimum
308
+ * yields rather than overflowing. A container that measures zero or less — a hidden tab, a node
309
+ * that is not in the document — has nothing to clamp against, so the requested size passes through
310
+ * untouched instead of being flattened to zero.
311
+ * @param {ClampSizeInput} input Requested size and the geometry around it.
312
+ * @returns {number} A size in pixels, never negative.
313
+ */
314
+ export declare function clampSize({ size, min, max, total, divider }: ClampSizeInput): number;
315
+ /**
316
+ * Resolves a size option to pixels without touching the DOM.
317
+ *
318
+ * Numbers, bare numeric strings, and `px` lengths are pixels; a percentage resolves against
319
+ * `total`. Every other CSS length — `rem`, `vh`, `calc()` — needs the browser, so it returns `NaN`
320
+ * and the caller hands the value to CSS instead of guessing at it.
321
+ * @param {number|string} value Size option.
322
+ * @param {number} total Container size along the split axis, in pixels.
323
+ * @returns {number} Pixels, or `NaN` when only the browser can resolve the value.
324
+ */
325
+ export declare function resolveSize(value: number | string, total: number): number;
326
+ /**
327
+ * Pulls a size onto the nearest target within a radius, leaving it alone when nothing is close.
328
+ * The radius is inclusive, ties go to the target listed first, and a radius of zero or less turns
329
+ * snapping off.
330
+ * @param {number} size Size in pixels.
331
+ * @param {number[]|number|null|undefined} targets Sizes worth landing exactly on.
332
+ * @param {number} threshold Snap radius in pixels.
333
+ * @returns {number}
334
+ */
335
+ export declare function snapSize(size: number, targets: number[] | number | null | undefined, threshold: number): number;
@@ -0,0 +1,314 @@
1
+ import { Component } from '../../core/component.js';
2
+ export type StepDefinition = import('./steps.js').StepDefinition;
3
+ export type NormalizedStep = import('./steps.js').NormalizedStep;
4
+ export type StepperOrientation = 'horizontal' | 'vertical';
5
+ export type StepperClickable = 'completed' | 'all' | false;
6
+ export type StepperStepState = 'upcoming' | 'active' | 'complete' | 'error';
7
+ export type StepperOptions = {
8
+ /**
9
+ * Ordered step definitions.
10
+ */
11
+ steps?: StepDefinition[];
12
+ /**
13
+ * Initially active step name; defaults to the first enabled step.
14
+ */
15
+ active?: string | null;
16
+ /**
17
+ * `horizontal` lays the rail out above the
18
+ * stage, `vertical` puts it beside the stage.
19
+ */
20
+ orientation?: StepperOrientation;
21
+ /**
22
+ * Which steps are activated by a click:
23
+ * `completed` (go back only), `all`, or `false` for a display-only rail.
24
+ */
25
+ clickable?: StepperClickable;
26
+ /**
27
+ * Whether upcoming and active markers show their number.
28
+ */
29
+ showNumbers?: boolean;
30
+ /**
31
+ * Whether to render a "Step 2 of 4" line above the rail.
32
+ */
33
+ counter?: boolean;
34
+ /**
35
+ * Localized messages.
36
+ */
37
+ msg?: Record<string, string> | Record<string, Record<string, string>>;
38
+ /**
39
+ * Change listener.
40
+ */
41
+ onchange?: (event: CustomEvent<StepperChangeDetail>) => void;
42
+ };
43
+ export type StepperChangeDetail = {
44
+ /**
45
+ * Name of the step being activated.
46
+ */
47
+ name: string;
48
+ /**
49
+ * Name of the step being left, or null.
50
+ */
51
+ previous: string | null;
52
+ /**
53
+ * Zero-based index of the step being activated.
54
+ */
55
+ index: number;
56
+ };
57
+ export type StepperState = {
58
+ /**
59
+ * Active step name.
60
+ */
61
+ active: string | null;
62
+ /**
63
+ * Zero-based active index, or -1 when nothing is active.
64
+ */
65
+ index: number;
66
+ /**
67
+ * Completed step names, in step order.
68
+ */
69
+ completed: string[];
70
+ /**
71
+ * Errored step names, in step order.
72
+ */
73
+ errored: string[];
74
+ };
75
+ export type StepRecord = {
76
+ /**
77
+ * Normalized definition.
78
+ */
79
+ step: NormalizedStep;
80
+ /**
81
+ * List item carrying `data-state` and `aria-current`.
82
+ */
83
+ item: HTMLLIElement;
84
+ /**
85
+ * Button (clickable rails) or span (display-only rails).
86
+ */
87
+ control: HTMLElement;
88
+ /**
89
+ * Number / check / warning bubble.
90
+ */
91
+ marker: HTMLElement;
92
+ /**
93
+ * Visually hidden state text for assistive technology.
94
+ */
95
+ status: HTMLElement;
96
+ };
97
+ /**
98
+ * @typedef {Object} StepperOptions
99
+ * @property {StepDefinition[]} [steps=[]] Ordered step definitions.
100
+ * @property {string|null} [active=null] Initially active step name; defaults to the first enabled step.
101
+ * @property {StepperOrientation} [orientation='horizontal'] `horizontal` lays the rail out above the
102
+ * stage, `vertical` puts it beside the stage.
103
+ * @property {StepperClickable} [clickable='completed'] Which steps are activated by a click:
104
+ * `completed` (go back only), `all`, or `false` for a display-only rail.
105
+ * @property {boolean} [showNumbers=true] Whether upcoming and active markers show their number.
106
+ * @property {boolean} [counter=false] Whether to render a "Step 2 of 4" line above the rail.
107
+ * @property {Record<string, string>|Record<string, Record<string, string>>} [msg] Localized messages.
108
+ * @property {(event: CustomEvent<StepperChangeDetail>) => void} [onchange] Change listener.
109
+ */
110
+ /**
111
+ * @typedef {Object} StepperChangeDetail
112
+ * @property {string} name Name of the step being activated.
113
+ * @property {string|null} previous Name of the step being left, or null.
114
+ * @property {number} index Zero-based index of the step being activated.
115
+ */
116
+ /**
117
+ * @typedef {Object} StepperState
118
+ * @property {string|null} active Active step name.
119
+ * @property {number} index Zero-based active index, or -1 when nothing is active.
120
+ * @property {string[]} completed Completed step names, in step order.
121
+ * @property {string[]} errored Errored step names, in step order.
122
+ */
123
+ /**
124
+ * @typedef {Object} StepRecord
125
+ * @property {NormalizedStep} step Normalized definition.
126
+ * @property {HTMLLIElement} item List item carrying `data-state` and `aria-current`.
127
+ * @property {HTMLElement} control Button (clickable rails) or span (display-only rails).
128
+ * @property {HTMLElement} marker Number / check / warning bubble.
129
+ * @property {HTMLElement} status Visually hidden state text for assistive technology.
130
+ */
131
+ /**
132
+ * A wizard progress rail: an ordered list of steps, each in one of four states, with the active
133
+ * step marked `aria-current="step"`. Advancing past a step marks it complete automatically, so a
134
+ * wizard only has to call `next()` / `previous()` and veto `change` when validation fails.
135
+ *
136
+ * The rail owns no stage: it reports where the user is and where they asked to go. Rendering the
137
+ * step's content stays with the application, exactly as in the checkout and record wizards.
138
+ * @fires Stepper#change
139
+ * @extends {Component<StepperOptions>}
140
+ */
141
+ export declare class Stepper extends Component<StepperOptions> {
142
+ _createdRoot: boolean;
143
+ _snapshot: import("../../core/dom.js").TargetSnapshot;
144
+ _destroyed: boolean;
145
+ /** @type {NormalizedStep[]} */
146
+ _steps: NormalizedStep[];
147
+ /** @type {StepRecord[]} */
148
+ _records: StepRecord[];
149
+ _activeIndex: any;
150
+ /** @type {Set<string>} */
151
+ _completed: Set<string>;
152
+ /** @type {Set<string>} */
153
+ _errored: Set<string>;
154
+ static cssName: string;
155
+ /** @type {Readonly<StepperOptions>} */
156
+ static defaults: Readonly<StepperOptions>;
157
+ /**
158
+ * Creates or enhances a stepper.
159
+ * @param {Element|string|null} target Existing container, selector, or null.
160
+ * @param {StepperOptions} [options={}] Stepper options.
161
+ */
162
+ constructor(target: Element | string | null, options?: StepperOptions);
163
+ /**
164
+ * Builds the rail. Runs inside the base constructor, so every piece of instance state it needs
165
+ * is initialized here rather than in class fields.
166
+ * @returns {HTMLElement}
167
+ */
168
+ render(): HTMLElement;
169
+ /**
170
+ * Replaces the whole step list. Completion and error flags survive for steps that are still
171
+ * present, and so does the active step; when it is gone the first enabled step takes over. This
172
+ * is a structural change, so it never emits `change`.
173
+ * @param {StepDefinition[]} list Step definitions.
174
+ * @returns {this}
175
+ */
176
+ setSteps(list: StepDefinition[]): this;
177
+ /**
178
+ * Activates a step unless its `change` event is vetoed. Disabled steps are ignored.
179
+ * @param {string} name Step name.
180
+ * @returns {this}
181
+ * @throws {RangeError} When no step carries that name.
182
+ * @fires Stepper#change
183
+ */
184
+ goTo(name: string): this;
185
+ /**
186
+ * Activates the next enabled step, marking the current one complete. Does nothing on the last
187
+ * enabled step.
188
+ * @returns {this}
189
+ * @fires Stepper#change
190
+ */
191
+ next(): this;
192
+ /**
193
+ * Activates the previous enabled step. Going back never clears completion flags.
194
+ * @returns {this}
195
+ * @fires Stepper#change
196
+ */
197
+ previous(): this;
198
+ /**
199
+ * Returns the active step name.
200
+ * @returns {string|null}
201
+ */
202
+ getActive(): string | null;
203
+ /**
204
+ * Returns the zero-based active index.
205
+ * @returns {number} -1 when no step is active.
206
+ */
207
+ getIndex(): number;
208
+ /**
209
+ * Marks a step complete.
210
+ * @param {string} name Step name.
211
+ * @returns {this}
212
+ */
213
+ complete(name: string): this;
214
+ /**
215
+ * Clears a step's completion flag.
216
+ * @param {string} name Step name.
217
+ * @returns {this}
218
+ */
219
+ uncomplete(name: string): this;
220
+ /**
221
+ * Flags or clears a step's error state. An errored step renders a warning marker and keeps its
222
+ * completion flag, so a wizard can still send the user back to fix it.
223
+ * @param {string} name Step name.
224
+ * @param {boolean} [errored=true] Whether the step is in error.
225
+ * @returns {this}
226
+ */
227
+ setError(name: string, errored?: boolean): this;
228
+ /**
229
+ * Enables or disables a step. Disabling the active step leaves it active — the user is still
230
+ * standing on it — but `next()`, `previous()`, and `goTo()` will skip or refuse it afterwards.
231
+ * @param {string} name Step name.
232
+ * @param {boolean} [disabled=true] Whether the step is unavailable.
233
+ * @returns {this}
234
+ */
235
+ setDisabled(name: string, disabled?: boolean): this;
236
+ /**
237
+ * Returns a snapshot of the rail's state.
238
+ * @returns {StepperState}
239
+ */
240
+ getState(): StepperState;
241
+ /**
242
+ * Aborts listeners and restores an enhanced target to the markup it had before the takeover.
243
+ * @returns {void}
244
+ */
245
+ destroy(): void;
246
+ /**
247
+ * Activates an index, marking every step it advanced past complete.
248
+ * @param {number} index Zero-based index, or -1 for "nowhere to go".
249
+ * @returns {this}
250
+ * @fires Stepper#change
251
+ */
252
+ _activate(index: number): this;
253
+ /**
254
+ * Builds one step's elements. The control's tag depends only on the `clickable` option, never on
255
+ * the step's state, so state changes never have to swap an element out from under the focus.
256
+ * @param {NormalizedStep} step Normalized step.
257
+ * @returns {StepRecord}
258
+ */
259
+ _createRecord(step: NormalizedStep): StepRecord;
260
+ /**
261
+ * Pushes the current state onto every rendered step and the counter line.
262
+ * @returns {void}
263
+ */
264
+ _sync(): void;
265
+ /**
266
+ * Resolves a step's rendered state.
267
+ * @param {NormalizedStep} step Normalized step.
268
+ * @param {number} index Zero-based index.
269
+ * @returns {StepperStepState}
270
+ */
271
+ _stateFor(step: NormalizedStep, index: number): StepperStepState;
272
+ /**
273
+ * @param {StepperStepState} state Rendered state.
274
+ * @param {number} index Zero-based index.
275
+ * @returns {Array<Node|string>}
276
+ */
277
+ _markerContent(state: StepperStepState, index: number): Array<Node | string>;
278
+ /**
279
+ * @param {StepperStepState} state Rendered state.
280
+ * @returns {string} Text announced in place of the decorative marker.
281
+ */
282
+ _statusText(state: StepperStepState): string;
283
+ /**
284
+ * Whether a step's button is enabled. The active step stays enabled when it qualifies (under
285
+ * `all`, or under `completed` once it has been visited), because disabling the button the user
286
+ * just clicked would throw their focus back to the document body; activating the active step is
287
+ * a no-op anyway.
288
+ * @param {NormalizedStep} step Normalized step.
289
+ * @returns {boolean}
290
+ */
291
+ _isClickable(step: NormalizedStep): boolean;
292
+ /** @returns {void} */
293
+ _syncCounter(): void;
294
+ /**
295
+ * @param {string} name Step name.
296
+ * @returns {NormalizedStep}
297
+ * @throws {RangeError} When no step carries that name.
298
+ */
299
+ _require(name: string): NormalizedStep;
300
+ /**
301
+ * Resolves a message through the host translator, falling back to the built-in English text.
302
+ * @param {string} key Message key.
303
+ * @param {string} fallback Built-in text, with `%1`-style placeholders.
304
+ * @param {...unknown} args Interpolation values.
305
+ * @returns {string}
306
+ */
307
+ _message(key: string, fallback: string, ...args: unknown[]): string;
308
+ }
309
+ /**
310
+ * Fired before the active step changes. Calling `preventDefault()` vetoes the move, which is how a
311
+ * wizard blocks a step whose form has not validated.
312
+ * @event Stepper#change
313
+ * @type {CustomEvent<StepperChangeDetail>}
314
+ */