viewkitjs 0.31.0 → 0.33.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 (449) hide show
  1. package/CHANGELOG.md +198 -0
  2. package/MIGRATION.md +40 -6
  3. package/README.md +1 -1
  4. package/fields/dist/index.d.ts +1 -1
  5. package/fields/dist/index.js +1 -1
  6. package/fields/dist/query/evaluate.d.ts +7 -0
  7. package/fields/dist/query/exact-number.d.ts +8 -2
  8. package/fields/dist/query/exact-number.js +14 -1
  9. package/fields/dist/query/index.d.ts +2 -0
  10. package/fields/dist/query/index.js +2 -0
  11. package/fields/dist/query/list-request.d.ts +148 -0
  12. package/fields/dist/query/list-request.js +125 -0
  13. package/fields/dist/query/saved-view.d.ts +15 -0
  14. package/fields/dist/query/saved-view.js +11 -0
  15. package/fields/dist/query/settings.d.ts +9 -0
  16. package/fields/dist/query/settings.js +9 -0
  17. package/fields/dist/query/sort.js +13 -10
  18. package/fields/dist/registry.js +5 -1
  19. package/fields/dist/types.d.ts +4 -1
  20. package/fields/dist/zod.d.ts +5 -0
  21. package/fields/dist/zod.js +10 -1
  22. package/fields/docs/guides/contact-values.md +12 -0
  23. package/fields/docs/guides/field-types.md +1 -1
  24. package/fields/docs/guides/queries.md +3 -1
  25. package/fields/docs/reference/fields.md +1 -0
  26. package/fields/docs/reference/query.md +66 -0
  27. package/package.json +5 -1
  28. package/postgres/README.md +1 -0
  29. package/postgres/dist/check.js +4 -1
  30. package/postgres/dist/definitions/formula-forms.js +3 -1
  31. package/postgres/dist/definitions/money.js +2 -1
  32. package/postgres/dist/handler.d.ts +53 -0
  33. package/postgres/dist/handler.js +211 -0
  34. package/postgres/dist/ids.d.ts +1 -1
  35. package/postgres/dist/ids.js +19 -1
  36. package/postgres/dist/index.d.ts +1 -0
  37. package/postgres/dist/index.js +1 -0
  38. package/postgres/dist/limits.d.ts +3 -1
  39. package/postgres/dist/limits.js +1 -1
  40. package/postgres/dist/list-fields.d.ts +10 -0
  41. package/postgres/dist/list-fields.js +36 -0
  42. package/postgres/dist/page.js +6 -3
  43. package/postgres/dist/readable.d.ts +4 -0
  44. package/postgres/dist/readable.js +4 -0
  45. package/postgres/dist/refusals.d.ts +9 -2
  46. package/postgres/dist/refusals.js +6 -0
  47. package/postgres/dist/rules.d.ts +15 -1
  48. package/postgres/dist/rules.js +16 -0
  49. package/postgres/dist/sort.js +7 -2
  50. package/postgres/docs/guides/definitions.md +1 -1
  51. package/postgres/docs/guides/field-map.md +3 -3
  52. package/postgres/docs/guides/list-handler.md +99 -0
  53. package/postgres/docs/index.md +1 -0
  54. package/postgres/docs/reference/definitions.md +1 -1
  55. package/postgres/docs/reference/postgres.md +12 -4
  56. package/views/README.md +2 -2
  57. package/views/dist/atoms/RowMenu.d.ts +7 -0
  58. package/views/dist/atoms/RowMenu.js +18 -16
  59. package/views/dist/atoms/ToolbarButton.d.ts +1 -1
  60. package/views/dist/atoms/ToolbarButton.js +4 -3
  61. package/views/dist/atoms/carried.d.ts +5 -0
  62. package/views/dist/atoms/carried.js +7 -0
  63. package/views/dist/atoms/frame-parts.d.ts +6 -0
  64. package/views/dist/atoms/frame-parts.js +15 -0
  65. package/views/dist/atoms/types.d.ts +19 -7
  66. package/views/dist/cells/cell-title.d.ts +3 -1
  67. package/views/dist/cells/cell-title.js +2 -2
  68. package/views/dist/cells/cell-values.js +2 -2
  69. package/views/dist/contract.d.ts +56 -11
  70. package/views/dist/contract.js +148 -0
  71. package/views/dist/controls/alert-dialog/alert-dialog.js +2 -1
  72. package/views/dist/controls/atoms.d.ts +2 -0
  73. package/views/dist/controls/atoms.js +2 -0
  74. package/views/dist/controls/avatar/avatar.d.ts +3 -3
  75. package/views/dist/controls/avatar/avatar.js +1 -1
  76. package/views/dist/controls/avatar/tokens.d.ts +44 -0
  77. package/views/dist/controls/avatar/tokens.js +11 -0
  78. package/views/dist/controls/avatar.css +22 -5
  79. package/views/dist/controls/button/map-button.js +2 -0
  80. package/views/dist/controls/checkbox/checkbox.d.ts +3 -2
  81. package/views/dist/controls/checkbox/checkbox.js +2 -2
  82. package/views/dist/controls/choice/tokens.d.ts +0 -4
  83. package/views/dist/controls/choice/tokens.js +0 -1
  84. package/views/dist/controls/choice.css +3 -3
  85. package/views/dist/controls/compound-editor/compound-editor.d.ts +1 -1
  86. package/views/dist/controls/compound-editor/name-parts.js +4 -4
  87. package/views/dist/controls/compound-editor/place-parts.js +19 -19
  88. package/views/dist/controls/compound-editor/range-parts.js +14 -14
  89. package/views/dist/controls/compound-editor/row.d.ts +3 -1
  90. package/views/dist/controls/compound-editor/row.js +2 -2
  91. package/views/dist/controls/controls.d.ts +8 -0
  92. package/views/dist/controls/controls.js +12 -2
  93. package/views/dist/controls/customize/customize.js +37 -35
  94. package/views/dist/controls/customize/map-customize-body.d.ts +2 -0
  95. package/views/dist/controls/customize/map-customize-body.js +5 -1
  96. package/views/dist/controls/date-editor/date-days.js +2 -2
  97. package/views/dist/controls/date-editor/date-editor.js +18 -18
  98. package/views/dist/controls/date-editor/date-parts.js +6 -6
  99. package/views/dist/controls/date-editor/map-calendar.js +1 -1
  100. package/views/dist/controls/date-editor.css +2 -2
  101. package/views/dist/controls/field/field.d.ts +22 -4
  102. package/views/dist/controls/field/field.js +63 -5
  103. package/views/dist/controls/field/tokens.d.ts +4 -0
  104. package/views/dist/controls/field/tokens.js +1 -0
  105. package/views/dist/controls/field.css +41 -16
  106. package/views/dist/controls/filter-editor/block.d.ts +2 -2
  107. package/views/dist/controls/filter-editor/block.js +5 -5
  108. package/views/dist/controls/filter-editor/filter-editor.js +31 -33
  109. package/views/dist/controls/filter-editor/how.d.ts +3 -1
  110. package/views/dist/controls/filter-editor/map-filter-body.d.ts +1 -0
  111. package/views/dist/controls/filter-editor/map-filter-body.js +7 -3
  112. package/views/dist/controls/filter-editor/map-rules.js +1 -1
  113. package/views/dist/controls/filter-editor/parts.js +2 -1
  114. package/views/dist/controls/glyphs/glyphs.d.ts +10 -0
  115. package/views/dist/controls/glyphs/glyphs.js +173 -0
  116. package/views/dist/controls/group-editor/group-editor.js +15 -13
  117. package/views/dist/controls/index.d.ts +4 -1
  118. package/views/dist/controls/index.js +3 -1
  119. package/views/dist/controls/input/input.js +6 -3
  120. package/views/dist/controls/input/map-input.js +2 -0
  121. package/views/dist/controls/input/tokens.d.ts +4 -0
  122. package/views/dist/controls/input/tokens.js +1 -0
  123. package/views/dist/controls/input.css +31 -3
  124. package/views/dist/controls/internal/editor-parts.js +1 -1
  125. package/views/dist/controls/internal/icons.js +10 -0
  126. package/views/dist/controls/internal/keep-focus.d.ts +2 -0
  127. package/views/dist/controls/internal/keep-focus.js +17 -0
  128. package/views/dist/controls/internal/map-panel-controls.d.ts +8 -0
  129. package/views/dist/controls/internal/map-panel-controls.js +20 -0
  130. package/views/dist/controls/internal/panel-controls.d.ts +50 -0
  131. package/views/dist/controls/internal/panel-controls.js +197 -0
  132. package/views/dist/controls/internal/part-slot.d.ts +12 -0
  133. package/views/dist/controls/internal/part-slot.js +5 -0
  134. package/views/dist/controls/internal/watch-frame.d.ts +2 -0
  135. package/views/dist/controls/internal/watch-frame.js +33 -0
  136. package/views/dist/controls/links-editor/links-editor.d.ts +1 -1
  137. package/views/dist/controls/links-editor/links-editor.js +27 -27
  138. package/views/dist/controls/markdown/map-markdown.d.ts +4 -0
  139. package/views/dist/controls/markdown/map-markdown.js +5 -0
  140. package/views/dist/controls/menu/map-menu.d.ts +2 -2
  141. package/views/dist/controls/menu/map-menu.js +15 -12
  142. package/views/dist/controls/menu/menu.d.ts +2 -0
  143. package/views/dist/controls/menu/menu.js +3 -3
  144. package/views/dist/controls/menu-list/menu-list.d.ts +17 -4
  145. package/views/dist/controls/menu-list/menu-list.js +27 -25
  146. package/views/dist/controls/modal/modal.js +5 -1
  147. package/views/dist/controls/notice/notice.d.ts +3 -1
  148. package/views/dist/controls/notice/notice.js +2 -2
  149. package/views/dist/controls/number-editor/number-editor.d.ts +1 -1
  150. package/views/dist/controls/number-editor/number-editor.js +13 -13
  151. package/views/dist/controls/number-field/number-field.js +5 -3
  152. package/views/dist/controls/pane/pane.d.ts +4 -2
  153. package/views/dist/controls/pane/pane.js +6 -5
  154. package/views/dist/controls/phone-header/header-bar.d.ts +5 -1
  155. package/views/dist/controls/phone-header/header-bar.js +2 -2
  156. package/views/dist/controls/phone-header.css +11 -1
  157. package/views/dist/controls/picker/map-picker.js +3 -0
  158. package/views/dist/controls/picker/picker.d.ts +16 -0
  159. package/views/dist/controls/picker/picker.js +61 -40
  160. package/views/dist/controls/picker/rows.d.ts +4 -0
  161. package/views/dist/controls/picker.css +2 -0
  162. package/views/dist/controls/popover/map-popover.d.ts +1 -1
  163. package/views/dist/controls/popover/map-popover.js +4 -2
  164. package/views/dist/controls/popover/popover.js +2 -1
  165. package/views/dist/controls/quick-filters/quick-filters.js +4 -4
  166. package/views/dist/controls/radio/radio.d.ts +8 -3
  167. package/views/dist/controls/radio/radio.js +22 -5
  168. package/views/dist/controls/radio/tokens.d.ts +44 -0
  169. package/views/dist/controls/radio/tokens.js +11 -0
  170. package/views/dist/controls/radio.css +79 -1
  171. package/views/dist/controls/select/map-select.d.ts +3 -0
  172. package/views/dist/controls/select/map-select.js +8 -0
  173. package/views/dist/controls/select/select.d.ts +7 -0
  174. package/views/dist/controls/select/select.js +12 -6
  175. package/views/dist/controls/select/tokens.d.ts +8 -0
  176. package/views/dist/controls/select/tokens.js +2 -0
  177. package/views/dist/controls/select.css +17 -0
  178. package/views/dist/controls/setting-row/looks.d.ts +1 -1
  179. package/views/dist/controls/setting-row/looks.js +9 -4
  180. package/views/dist/controls/setting-row/setting-row.d.ts +45 -10
  181. package/views/dist/controls/setting-row/setting-row.js +82 -15
  182. package/views/dist/controls/setting-row/tokens.d.ts +74 -2
  183. package/views/dist/controls/setting-row/tokens.js +19 -1
  184. package/views/dist/controls/setting-row.css +135 -14
  185. package/views/dist/controls/sheet/bottom-sheet.d.ts +14 -2
  186. package/views/dist/controls/sheet/bottom-sheet.js +6 -3
  187. package/views/dist/controls/sheet/map-sheet.js +1 -1
  188. package/views/dist/controls/sheet.css +4 -1
  189. package/views/dist/controls/sort-editor/map-sort-body.d.ts +1 -0
  190. package/views/dist/controls/sort-editor/map-sort-body.js +7 -3
  191. package/views/dist/controls/sort-editor/sort-editor.js +25 -26
  192. package/views/dist/controls/sort-editor.css +13 -2
  193. package/views/dist/controls/switch-row/tokens.d.ts +0 -12
  194. package/views/dist/controls/switch-row/tokens.js +0 -3
  195. package/views/dist/controls/switch-row.css +3 -7
  196. package/views/dist/controls/switch.css +17 -7
  197. package/views/dist/controls/tag/tag.d.ts +3 -1
  198. package/views/dist/controls/tag/tag.js +2 -2
  199. package/views/dist/controls/tag/tokens.d.ts +4 -0
  200. package/views/dist/controls/tag/tokens.js +1 -0
  201. package/views/dist/controls/tag-field/tag-field.d.ts +5 -1
  202. package/views/dist/controls/tag-field/tag-field.js +11 -5
  203. package/views/dist/controls/tag-field/tokens.d.ts +16 -0
  204. package/views/dist/controls/tag-field/tokens.js +4 -0
  205. package/views/dist/controls/tag-field.css +19 -0
  206. package/views/dist/controls/tag.css +2 -0
  207. package/views/dist/controls/text-editor/text-editor.d.ts +1 -1
  208. package/views/dist/controls/text-editor/text-editor.js +8 -8
  209. package/views/dist/controls/toolbar/toolbar.d.ts +15 -3
  210. package/views/dist/controls/toolbar/toolbar.js +22 -15
  211. package/views/dist/controls/toolbar-button/atom-toolbar-button.d.ts +14 -0
  212. package/views/dist/controls/toolbar-button/atom-toolbar-button.js +52 -0
  213. package/views/dist/controls/toolbar-button/toolbar-button.d.ts +1 -1
  214. package/views/dist/controls/toolbar-button/toolbar-button.js +2 -3
  215. package/views/dist/controls/toolbar-button.css +4 -0
  216. package/views/dist/controls/toolbar.css +5 -0
  217. package/views/dist/controls/values-editor/values-editor.d.ts +1 -1
  218. package/views/dist/controls/values-editor/values-editor.js +22 -22
  219. package/views/dist/controls/views-list/map-view-menu.d.ts +3 -0
  220. package/views/dist/controls/views-list/map-view-menu.js +25 -0
  221. package/views/dist/controls/views-list/map-views-list-body.d.ts +28 -1
  222. package/views/dist/controls/views-list/map-views-list-body.js +39 -21
  223. package/views/dist/controls/views-list/rules.d.ts +2 -0
  224. package/views/dist/controls/views-list/view-menu.d.ts +7 -0
  225. package/views/dist/controls/views-list/view-menu.js +33 -29
  226. package/views/dist/controls/views-list/views-list.js +4 -4
  227. package/views/dist/controls/views-list/words.d.ts +2 -0
  228. package/views/dist/controls/views-list/words.js +1 -1
  229. package/views/dist/editors/EditorPanel.js +3 -2
  230. package/views/dist/editors/edit-session.js +2 -5
  231. package/views/dist/field-row/FieldRow.d.ts +4 -2
  232. package/views/dist/field-row/FieldRow.js +80 -20
  233. package/views/dist/field-row/FieldRowLane.d.ts +7 -2
  234. package/views/dist/field-row/FieldRowLane.js +4 -3
  235. package/views/dist/field-row/editors/RowEditor.d.ts +12 -0
  236. package/views/dist/field-row/editors/RowEditor.js +31 -1
  237. package/views/dist/field-row/editors/RowValueListEditor.d.ts +5 -1
  238. package/views/dist/field-row/editors/RowValueListEditor.js +4 -1
  239. package/views/dist/field-row/field-row-button.d.ts +5 -0
  240. package/views/dist/field-row/field-row-button.js +2 -0
  241. package/views/dist/fields/binding.d.ts +3 -2
  242. package/views/dist/fields/binding.js +38 -5
  243. package/views/dist/fields/money.d.ts +5 -2
  244. package/views/dist/fields/money.js +14 -2
  245. package/views/dist/grid/chrome/GridColumnMenu.d.ts +4 -2
  246. package/views/dist/grid/chrome/GridColumnMenu.js +3 -2
  247. package/views/dist/grid/chrome/GridGroupMenu.d.ts +4 -1
  248. package/views/dist/grid/chrome/GridGroupMenu.js +4 -3
  249. package/views/dist/grid/chrome/GridHeader.d.ts +4 -1
  250. package/views/dist/grid/chrome/GridHeader.js +2 -2
  251. package/views/dist/grid/chrome/GridRow.js +6 -5
  252. package/views/dist/grid/chrome/GridRowCells.js +6 -9
  253. package/views/dist/grid/chrome/GridStructure.d.ts +4 -1
  254. package/views/dist/grid/chrome/GridStructure.js +4 -4
  255. package/views/dist/grid/chrome/GridTable.js +9 -3
  256. package/views/dist/grid/chrome/cell-clipboard.d.ts +4 -2
  257. package/views/dist/grid/chrome/cell-clipboard.js +2 -2
  258. package/views/dist/grid/chrome/cells.js +3 -1
  259. package/views/dist/grid/chrome/grid-column-menu-items.js +1 -1
  260. package/views/dist/grid/chrome/grid-row-menu-items.d.ts +27 -3
  261. package/views/dist/grid/chrome/grid-row-menu-items.js +93 -7
  262. package/views/dist/grid/chrome/grid-row-props.d.ts +7 -2
  263. package/views/dist/grid/chrome/grid-rows-menu.js +34 -6
  264. package/views/dist/grid/chrome/grid-table-props.d.ts +38 -7
  265. package/views/dist/grid/chrome/useGridBatchApi.d.ts +3 -1
  266. package/views/dist/grid/chrome/useGridBatchApi.js +4 -2
  267. package/views/dist/grid/chrome/useGridKeyboard.d.ts +7 -2
  268. package/views/dist/grid/chrome/useGridKeyboard.js +43 -14
  269. package/views/dist/grid/chrome/useGridPendingReconciliation.js +1 -2
  270. package/views/dist/grid/chrome/useGridTableInteractionModel.d.ts +1 -1
  271. package/views/dist/grid/chrome/useGridTableInteractionModel.js +20 -7
  272. package/views/dist/grid/core/clipboard-model.d.ts +3 -1
  273. package/views/dist/grid/core/clipboard-model.js +9 -8
  274. package/views/dist/grid/core/commit-model.d.ts +20 -2
  275. package/views/dist/grid/core/editing-controller.d.ts +21 -0
  276. package/views/dist/grid/core/editing-controller.js +194 -42
  277. package/views/dist/grid/core/editing-model.d.ts +3 -0
  278. package/views/dist/grid/core/editing-model.js +3 -0
  279. package/views/dist/grid/core/edits-sink.d.ts +19 -0
  280. package/views/dist/grid/core/edits-sink.js +2 -0
  281. package/views/dist/grid/core/save-path.d.ts +24 -0
  282. package/views/dist/grid/core/save-path.js +122 -0
  283. package/views/dist/grid/core/spreadsheet-operations.d.ts +3 -0
  284. package/views/dist/grid/core/spreadsheet-operations.js +24 -1
  285. package/views/dist/grid/core/useGridEditing.d.ts +5 -0
  286. package/views/dist/grid/core/useGridEditing.js +6 -0
  287. package/views/dist/grid/index.d.ts +3 -2
  288. package/views/dist/grid/index.js +1 -0
  289. package/views/dist/internal/field-rows.d.ts +26 -0
  290. package/views/dist/internal/field-rows.js +8 -0
  291. package/views/dist/internal/page-close.d.ts +7 -0
  292. package/views/dist/internal/page-close.js +43 -0
  293. package/views/dist/list/answer.d.ts +40 -0
  294. package/views/dist/list/answer.js +43 -0
  295. package/views/dist/list/browser-views-store.d.ts +10 -0
  296. package/views/dist/list/browser-views-store.js +182 -0
  297. package/views/dist/list/bulk-bar.d.ts +7 -0
  298. package/views/dist/list/bulk-bar.js +10 -0
  299. package/views/dist/list/columns.d.ts +24 -0
  300. package/views/dist/list/columns.js +27 -0
  301. package/views/dist/list/edits.d.ts +19 -0
  302. package/views/dist/list/edits.js +56 -0
  303. package/views/dist/list/grid.d.ts +11 -0
  304. package/views/dist/list/grid.js +76 -0
  305. package/views/dist/list/index.d.ts +36 -0
  306. package/views/dist/list/index.js +11 -0
  307. package/views/dist/list/link.d.ts +8 -0
  308. package/views/dist/list/link.js +78 -0
  309. package/views/dist/list/list.d.ts +70 -0
  310. package/views/dist/list/list.js +14 -0
  311. package/views/dist/list/menu.d.ts +31 -0
  312. package/views/dist/list/menu.js +76 -0
  313. package/views/dist/list/parts.d.ts +6 -0
  314. package/views/dist/list/parts.js +66 -0
  315. package/views/dist/list/registry.d.ts +11 -0
  316. package/views/dist/list/registry.js +31 -0
  317. package/views/dist/list/root-base.d.ts +46 -0
  318. package/views/dist/list/root-base.js +137 -0
  319. package/views/dist/list/root.d.ts +41 -0
  320. package/views/dist/list/root.js +168 -0
  321. package/views/dist/list/slot.d.ts +14 -0
  322. package/views/dist/list/slot.js +22 -0
  323. package/views/dist/list/source-answers.d.ts +39 -0
  324. package/views/dist/list/source-answers.js +225 -0
  325. package/views/dist/list/source.d.ts +11 -0
  326. package/views/dist/list/source.js +31 -0
  327. package/views/dist/list/store.d.ts +119 -0
  328. package/views/dist/list/store.js +146 -0
  329. package/views/dist/list/toolbar.d.ts +7 -0
  330. package/views/dist/list/toolbar.js +371 -0
  331. package/views/dist/list/views-axis.d.ts +5 -0
  332. package/views/dist/list/views-axis.js +98 -0
  333. package/views/dist/list/views-store.d.ts +41 -0
  334. package/views/dist/list/views-store.js +1 -0
  335. package/views/dist/list/views.d.ts +72 -0
  336. package/views/dist/list/views.js +411 -0
  337. package/views/dist/model/column-capabilities.d.ts +13 -0
  338. package/views/dist/model/column-capabilities.js +23 -2
  339. package/views/dist/model/column-schema.d.ts +11 -1
  340. package/views/dist/model/preferences.js +1 -1
  341. package/views/dist/model/prefs-buckets.js +1 -1
  342. package/views/dist/model/view-rules.js +1 -0
  343. package/views/dist/panels/index.d.ts +3 -1
  344. package/views/dist/panels/index.js +1 -0
  345. package/views/dist/panels/model.d.ts +2 -0
  346. package/views/dist/panels/react/customize-body.js +1 -0
  347. package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +47 -4
  348. package/views/dist/panels/react/toolbar/ReadyToolbar.js +6 -326
  349. package/views/dist/panels/react/toolbar/Toolbar.d.ts +17 -2
  350. package/views/dist/panels/react/toolbar/Toolbar.js +43 -23
  351. package/views/dist/panels/react/toolbar/ToolbarAdvancedFilters.js +1 -1
  352. package/views/dist/panels/react/toolbar/ToolbarAsideFilter.js +2 -2
  353. package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +4 -4
  354. package/views/dist/panels/react/toolbar/ToolbarButton.js +7 -1
  355. package/views/dist/panels/react/toolbar/ToolbarFilter.js +1 -1
  356. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +1 -1
  357. package/views/dist/panels/react/toolbar/ToolbarFilterSheet.js +1 -1
  358. package/views/dist/panels/react/toolbar/ToolbarFilters.js +2 -2
  359. package/views/dist/panels/react/toolbar/ToolbarNew.js +2 -2
  360. package/views/dist/panels/react/toolbar/ToolbarOptions.js +1 -1
  361. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.d.ts +2 -2
  362. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +3 -1
  363. package/views/dist/panels/react/toolbar/ToolbarSearch.js +1 -1
  364. package/views/dist/panels/react/toolbar/ToolbarSort.js +2 -2
  365. package/views/dist/panels/react/toolbar/ToolbarSortPill.js +6 -4
  366. package/views/dist/panels/react/toolbar/context.d.ts +20 -3
  367. package/views/dist/panels/react/toolbar/context.js +3 -1
  368. package/views/dist/panels/react/toolbar/panel-part.d.ts +4 -1
  369. package/views/dist/panels/react/toolbar/panel-part.js +5 -3
  370. package/views/dist/panels/react/views-row/FoldingViewRow.d.ts +1 -1
  371. package/views/dist/panels/react/views-row/FoldingViewRow.js +15 -4
  372. package/views/dist/panels/react/views-row/PillGroup.d.ts +5 -2
  373. package/views/dist/panels/react/views-row/PillGroup.js +16 -7
  374. package/views/dist/panels/react/views-row/ViewPicker.js +2 -12
  375. package/views/dist/panels/react/views-row/ViewPickerRow.d.ts +4 -2
  376. package/views/dist/panels/react/views-row/ViewPickerRow.js +9 -5
  377. package/views/dist/panels/react.d.ts +2 -2
  378. package/views/dist/panels/settings/filter-groups.js +6 -1
  379. package/views/dist/panels/toolbar/edit-view.d.ts +7 -1
  380. package/views/dist/panels/toolbar/edit-view.js +14 -0
  381. package/views/dist/panels/toolbar/model.d.ts +5 -0
  382. package/views/dist/panels/toolbar/model.js +7 -3
  383. package/views/dist/panels/view-state.d.ts +5 -3
  384. package/views/dist/panels/views-row/model.d.ts +19 -2
  385. package/views/dist/panels/views-row/model.js +14 -0
  386. package/views/dist/provider/ViewsProvider.d.ts +21 -8
  387. package/views/dist/provider/ViewsProvider.js +40 -5
  388. package/views/dist/provider/components.d.ts +102 -2
  389. package/views/dist/provider/components.js +1 -1
  390. package/views/dist/provider/context.d.ts +6 -2
  391. package/views/dist/provider/context.js +1 -1
  392. package/views/dist/provider/own-control.d.ts +4 -0
  393. package/views/dist/provider/own-control.js +7 -0
  394. package/views/dist/provider/ports.d.ts +19 -12
  395. package/views/dist/provider/ports.js +69 -1
  396. package/views/dist/provider/select-items.d.ts +3 -0
  397. package/views/dist/provider/select-items.js +6 -0
  398. package/views/dist/react.d.ts +4 -2
  399. package/views/dist/react.js +2 -0
  400. package/views/dist/styles.css +503 -136
  401. package/views/dist/styles.unlayered.css +503 -136
  402. package/views/docs/contract.md +292 -34
  403. package/views/docs/controls/avatar.md +11 -0
  404. package/views/docs/controls/choice.md +0 -1
  405. package/views/docs/controls/compound-editor.md +4 -0
  406. package/views/docs/controls/customize.md +6 -0
  407. package/views/docs/controls/date-editor.md +4 -0
  408. package/views/docs/controls/field.md +7 -0
  409. package/views/docs/controls/filter-editor.md +8 -0
  410. package/views/docs/controls/group-editor.md +6 -0
  411. package/views/docs/controls/input.md +5 -0
  412. package/views/docs/controls/links-editor.md +4 -0
  413. package/views/docs/controls/menu-list.md +8 -0
  414. package/views/docs/controls/menu.md +4 -0
  415. package/views/docs/controls/notice.md +4 -0
  416. package/views/docs/controls/number-editor.md +4 -0
  417. package/views/docs/controls/pane.md +4 -0
  418. package/views/docs/controls/picker.md +8 -0
  419. package/views/docs/controls/quick-filters.md +6 -0
  420. package/views/docs/controls/radio.md +20 -1
  421. package/views/docs/controls/select.md +10 -0
  422. package/views/docs/controls/setting-row.md +18 -0
  423. package/views/docs/controls/sheet.md +4 -0
  424. package/views/docs/controls/sort-editor.md +8 -0
  425. package/views/docs/controls/switch-row.md +0 -3
  426. package/views/docs/controls/tag-field.md +4 -0
  427. package/views/docs/controls/tag.md +1 -0
  428. package/views/docs/controls/text-editor.md +4 -0
  429. package/views/docs/controls/values-editor.md +4 -0
  430. package/views/docs/controls/views-list.md +6 -0
  431. package/views/docs/getting-started.md +2 -2
  432. package/views/docs/guides/atoms.md +2 -2
  433. package/views/docs/guides/columns.md +1 -1
  434. package/views/docs/guides/ports.md +1 -1
  435. package/views/docs/guides/the-grid.md +36 -9
  436. package/views/docs/guides/the-provider.md +22 -3
  437. package/views/docs/index.md +1 -0
  438. package/views/docs/reference/controls.md +41 -29
  439. package/views/docs/reference/editors-session.md +1 -1
  440. package/views/docs/reference/field-row.md +9 -1
  441. package/views/docs/reference/grid.md +15 -9
  442. package/views/docs/reference/list.md +357 -0
  443. package/views/docs/reference/looks.md +1 -1
  444. package/views/docs/reference/panels-react.md +17 -12
  445. package/views/docs/reference/panels.md +8 -5
  446. package/views/docs/reference/react.md +24 -16
  447. package/views/docs/reference/views.md +10 -6
  448. package/views/docs/reshaping.md +6 -1
  449. package/views/skills/views/SKILL.md +9 -6
@@ -1,16 +1,22 @@
1
1
  import * as React from "react";
2
+ import { type PartSlot } from "../internal/part-slot.js";
2
3
  import { type MenuListLookOptionId } from "./looks.js";
3
4
  /** A choice: its value, its name, and its mark (a stage's glyph, a person's face, an icon). */
4
5
  export interface MenuChoice {
5
6
  value: string;
6
7
  label: string;
7
8
  mark?: React.ReactNode;
9
+ /** Its public name and which one it is (VK-988): drawn on its row as `data-slot` and `data-key`. */
10
+ slot?: PartSlot;
8
11
  /** What it reads as, in words, quiet at its end before its tick: a date style's sample ("14/11/2026"). */
9
12
  detail?: string;
10
13
  }
11
14
  /** A row of the menu, in the order it shows: what's done most first, related rows between lines, the one
12
- * that takes something away last. */
13
- export type MenuEntry =
15
+ * that takes something away last. `slot`, its public name and which one it is (VK-988), drawn on its row in every form as
16
+ * `data-slot`, `data-key` and `data-index`; a `pick` or a `group` names its rows through its choices or its entries. */
17
+ export type MenuEntry = ({
18
+ slot?: PartSlot;
19
+ } & (
14
20
  /** An action: its icon and name, its keys when a shortcut works (["⌘", "L"]); `danger` when it takes
15
21
  * something away; `disabled` says why it can't be used, as its tooltip. A name that opens something
16
22
  * else before it acts ends in "…". */
@@ -88,7 +94,7 @@ MenuAction
88
94
  kind: "group";
89
95
  heading: string;
90
96
  entries: MenuEntry[];
91
- } | {
97
+ })) | {
92
98
  kind: "separator";
93
99
  };
94
100
  type MenuAction = {
@@ -101,6 +107,9 @@ type MenuAction = {
101
107
  onSelect?: () => void;
102
108
  /** How many it holds, at its end in the quietest colour (a tab's count under More), or a Spinner while that loads. */
103
109
  count?: React.ReactNode;
110
+ /** The row's inside drawn by the app, in place of its icon, name, keys and count; `label` stays its name to a screen reader
111
+ * and to typing. Never a phone's tile. */
112
+ body?: React.ReactNode;
104
113
  };
105
114
  /** What its rows stand on, as worn around `el`. */
106
115
  export declare const menuListRowsOf: (el: Element | null) => string;
@@ -189,15 +198,19 @@ export interface MenuListTile {
189
198
  label: string;
190
199
  disabled?: boolean;
191
200
  onSelect?: () => void;
201
+ slot?: PartSlot;
192
202
  }
193
203
  /** A name and its value, as one row standing alone: the choices row with no arrow and no list round it, at the list's own
194
204
  * height and inset (menu-list.css), which what holds it may set (`--menu-list-row`, `--menu-list-inset`). Pressing it is its
195
205
  * holder's: the Date editor's time row on a phone opens the time's wheels. */
196
- export declare function MenuListRow({ label, value, onSelect, className }: {
206
+ export declare function MenuListRow({ label, value, onSelect, className, ...part }: {
197
207
  label: string;
198
208
  value: React.ReactNode;
199
209
  onSelect?: () => void;
200
210
  className?: string;
211
+ /** Its public name and which one it is (VK-989): a field editor's row (the date's time on a phone). */
212
+ "data-slot"?: string;
213
+ "data-key"?: string;
201
214
  }): import("react/jsx-runtime").JSX.Element;
202
215
  export interface MenuListProps {
203
216
  /** What it acts on, to a screen reader. */
@@ -7,6 +7,7 @@ import { CheckboxMark } from "../checkbox/checkbox.js";
7
7
  import { GRIP, Grip } from "../grip/grip.js";
8
8
  import { useHoldDrag } from "../internal/hold.js";
9
9
  import { Icon, iconPaths } from "../internal/icons.js";
10
+ import { partAttrs } from "../internal/part-slot.js";
10
11
  import { phoneMark, usePhoneForm } from "../internal/phone.js";
11
12
  import { msOf, pxOf, spacingPx } from "../internal/read-token.js";
12
13
  import { useReorder } from "../internal/reorder.js";
@@ -53,7 +54,7 @@ const rowToggle = (t) => t ? (_jsx(Toggle, { kind: "quiet", shape: "icon", size:
53
54
  const rowOpen = (name, glyphOf, onOpen) => name ? (_jsx(Button, { kind: "quiet", shape: "icon", size: "xs", className: "o-menu-open", tabIndex: -1, "aria-label": name, icon: glyphOf, onMouseDown: keepRow, onClick: (ev) => { ev.stopPropagation(); onOpen?.(); } })) : null;
54
55
  const part = (id, p) => (id ? `${id}-${p}` : undefined);
55
56
  const named = (id) => ["n", "v", "k", "c"].map((p) => `${id}-${p}`).join(" ");
56
- const actionBody = (e, id) => (_jsxs(_Fragment, { children: [e.icon, _jsx("span", { className: "o-menu-name", id: part(id, "n"), children: e.label }), e.keys && _jsx("span", { className: "o-menu-keys", id: part(id, "k"), children: e.keys.map((k) => _jsx("kbd", { children: k }, k)) }), e.count != null && _jsx("span", { className: "o-menu-count", id: part(id, "c"), children: e.count })] }));
57
+ const actionBody = (e, id) => e.body !== undefined ? _jsx("span", { className: "o-menu-name", id: part(id, "n"), children: e.body }) : (_jsxs(_Fragment, { children: [e.icon, _jsx("span", { className: "o-menu-name", id: part(id, "n"), children: e.label }), e.keys && _jsx("span", { className: "o-menu-keys", id: part(id, "k"), children: e.keys.map((k) => _jsx("kbd", { children: k }, k)) }), e.count != null && _jsx("span", { className: "o-menu-count", id: part(id, "c"), children: e.count })] }));
57
58
  const linkBody = (e, id) => _jsxs(_Fragment, { children: [e.icon, _jsx("span", { className: "o-menu-name", id: part(id, "n"), children: e.label }), e.external && strokeGlyph(AWAY, "o-menu-away")] });
58
59
  const checkBody = (e, id) => _jsxs(_Fragment, { children: [_jsx(CheckboxMark, {}), _jsx("span", { className: "o-menu-name", id: part(id, "n"), children: e.label })] });
59
60
  const actionsBody = (e, id) => _jsxs(_Fragment, { children: [e.icon, _jsx("span", { className: "o-menu-name", id: part(id, "n"), children: e.label }), e.detail != null && _jsx("span", { className: "o-menu-value", id: part(id, "v"), "data-on": e.inForce ? "" : undefined, children: e.detail }), strokeGlyph(MORE, "o-menu-more")] });
@@ -75,7 +76,7 @@ function Says({ id, how, said }) {
75
76
  const choiceBody = (c) => _jsxs(_Fragment, { children: [c.mark, _jsx("span", { className: "o-menu-name", children: c.label }), c.detail != null && _jsx("span", { className: "o-menu-detail", children: c.detail }), strokeGlyph(TICK, "o-list-tick", 2.25)] });
76
77
  const rowClass = (e) => cx("o-list-row o-smooth o-smooth-ease o-menu-row", e.danger && "o-menu-danger");
77
78
  export const MenuScroll = ({ children }) => _jsxs(_Fragment, { children: [_jsx("div", { className: "o-menu-list-scroll", children: children }), _jsx(Scrollbar, {})] });
78
- function Sub({ trigger, host, children }) {
79
+ function Sub({ trigger, host, slot, children }) {
79
80
  const row = React.useRef(null), mark = phoneMark(usePhoneForm());
80
81
  const [at, setAt] = React.useState({ delay: 0, step: 0, edge: 0 });
81
82
  React.useLayoutEffect(() => {
@@ -85,7 +86,7 @@ function Sub({ trigger, host, children }) {
85
86
  if (el)
86
87
  setAt({ delay: msOf(el, "--menu-sub-wait"), step: Number.isNaN(pad) ? spacingPx(1, el) : pad, edge: pxOf(el, "--vk-border-width") });
87
88
  }, []);
88
- return (_jsxs(BaseMenu.SubmenuRoot, { children: [_jsx(BaseMenu.SubmenuTrigger, { ref: row, delay: at.delay, className: "o-list-row o-smooth o-smooth-ease o-menu-row", children: trigger }), _jsx(BaseMenu.Portal, { container: host, className: "o-menu-portal", children: _jsx(BaseMenu.Positioner, { className: "o-list-positioner", side: "right", align: "start", sideOffset: at.step, alignOffset: -(at.step + at.edge), children: _jsx(BaseMenu.Popup, { className: "o-list o-menu o-smooth o-smooth-ease", "data-kit": "menu", ...mark, children: _jsx(MenuScroll, { children: children }) }) }) })] }));
89
+ return (_jsxs(BaseMenu.SubmenuRoot, { children: [_jsx(BaseMenu.SubmenuTrigger, { ref: row, delay: at.delay, className: "o-list-row o-smooth o-smooth-ease o-menu-row", ...partAttrs(slot), children: trigger }), _jsx(BaseMenu.Portal, { container: host, className: "o-menu-portal", children: _jsx(BaseMenu.Positioner, { className: "o-list-positioner", side: "right", align: "start", sideOffset: at.step, alignOffset: -(at.step + at.edge), children: _jsx(BaseMenu.Popup, { className: "o-list o-menu o-smooth o-smooth-ease", "data-kit": "menu", ...mark, children: _jsx(MenuScroll, { children: children }) }) }) })] }));
89
90
  }
90
91
  export function MenuListRows({ entries, host }) {
91
92
  return _jsx(_Fragment, { children: entries.map((e, i) => {
@@ -94,22 +95,22 @@ export function MenuListRows({ entries, host }) {
94
95
  if (e.kind === "group")
95
96
  return (_jsxs(BaseMenu.Group, { children: [_jsx(BaseMenu.GroupLabel, { className: "o-list-heading", children: e.heading }), _jsx(MenuListRows, { entries: e.entries, host: host })] }, i));
96
97
  if (e.kind === "check")
97
- return (_jsx(BaseMenu.CheckboxItem, { label: e.label, checked: e.checked, defaultChecked: e.defaultChecked, onCheckedChange: (c) => e.onCheckedChange?.(c), disabled: !!e.disabled, title: e.disabled, className: "o-list-row o-smooth o-smooth-ease o-menu-row o-menu-check", children: checkBody(e) }, i));
98
+ return (_jsx(BaseMenu.CheckboxItem, { label: e.label, checked: e.checked, defaultChecked: e.defaultChecked, onCheckedChange: (c) => e.onCheckedChange?.(c), disabled: !!e.disabled, title: e.disabled, className: "o-list-row o-smooth o-smooth-ease o-menu-row o-menu-check", ...partAttrs(e.slot), children: checkBody(e) }, i));
98
99
  if (e.kind === "link")
99
- return (_jsx(BaseMenu.LinkItem, { href: e.href, render: e.render, label: e.label, onClick: e.onSelect, closeOnClick: true, className: "o-list-row o-smooth o-smooth-ease o-menu-row", ...(e.external ? { target: "_blank", rel: "noreferrer" } : {}), children: linkBody(e) }, i));
100
+ return (_jsx(BaseMenu.LinkItem, { href: e.href, render: e.render, label: e.label, onClick: e.onSelect, closeOnClick: true, className: "o-list-row o-smooth o-smooth-ease o-menu-row", ...partAttrs(e.slot), ...(e.external ? { target: "_blank", rel: "noreferrer" } : {}), children: linkBody(e) }, i));
100
101
  if (e.kind === "actions")
101
- return _jsx(Sub, { trigger: actionsBody(e), host: host, children: _jsx(MenuListRows, { entries: e.entries, host: host }) }, i);
102
+ return _jsx(Sub, { trigger: actionsBody(e), host: host, slot: e.slot, children: _jsx(MenuListRows, { entries: e.entries, host: host }) }, i);
102
103
  if (e.kind === "pick")
103
- return (_jsxs(BaseMenu.Group, { children: [e.heading && _jsx(BaseMenu.GroupLabel, { className: "o-list-heading", children: e.heading }), _jsx(BaseMenu.RadioGroup, { value: e.value, onValueChange: (v) => e.onChoose?.(v), children: e.choices.map((c) => _jsx(BaseMenu.RadioItem, { value: c.value, closeOnClick: true, className: "o-list-row o-smooth o-smooth-ease o-menu-row", children: choiceBody(c) }, c.value)) })] }, i));
104
+ return (_jsxs(BaseMenu.Group, { children: [e.heading && _jsx(BaseMenu.GroupLabel, { className: "o-list-heading", children: e.heading }), _jsx(BaseMenu.RadioGroup, { value: e.value, onValueChange: (v) => e.onChoose?.(v), children: e.choices.map((c) => _jsx(BaseMenu.RadioItem, { value: c.value, closeOnClick: true, className: "o-list-row o-smooth o-smooth-ease o-menu-row", ...partAttrs(c.slot), children: choiceBody(c) }, c.value)) })] }, i));
104
105
  if (e.kind === "choices")
105
- return (_jsx(Sub, { trigger: choicesBody(e), host: host, children: _jsx(BaseMenu.RadioGroup, { value: e.value, onValueChange: (v) => e.onChoose?.(v), children: e.choices.map((c) => _jsx(BaseMenu.RadioItem, { value: c.value, label: c.label, closeOnClick: true, className: "o-list-row o-smooth o-smooth-ease o-menu-row", children: choiceBody(c) }, c.value)) }) }, i));
106
- return _jsx(BaseMenu.Item, { label: e.label, className: rowClass(e), disabled: !!e.disabled, title: e.disabled, onClick: e.onSelect, children: actionBody(e) }, i);
106
+ return (_jsx(Sub, { trigger: choicesBody(e), host: host, slot: e.slot, children: _jsx(BaseMenu.RadioGroup, { value: e.value, onValueChange: (v) => e.onChoose?.(v), children: e.choices.map((c) => _jsx(BaseMenu.RadioItem, { value: c.value, label: c.label, closeOnClick: true, className: "o-list-row o-smooth o-smooth-ease o-menu-row", ...partAttrs(c.slot), children: choiceBody(c) }, c.value)) }) }, i));
107
+ return _jsx(BaseMenu.Item, { label: e.label, "aria-label": e.body !== undefined ? e.label : undefined, className: rowClass(e), disabled: !!e.disabled, title: e.disabled, onClick: e.onSelect, ...partAttrs(e.slot), children: actionBody(e) }, i);
107
108
  }) });
108
109
  }
109
110
  export function MenuListShown({ entries, label, open, on = [], className }) {
110
111
  const lit = (name) => (on.includes(name) ? { "data-force": "hover" } : {}), mark = phoneMark(usePhoneForm());
111
112
  const panel = (rows, cls = "") => _jsx("div", { className: cx("o-list o-menu o-smooth o-smooth-ease", cls), role: "menu", "aria-label": label, "data-kit": "menu", ...mark, children: rows });
112
- const choiceRows = (e, prefix = "") => e.choices.map((c) => (_jsx("div", { role: "menuitemradio", "aria-checked": c.value === e.value, className: "o-list-row o-smooth o-smooth-ease o-menu-row", ...lit(prefix + c.label), children: choiceBody(c) }, c.value)));
113
+ const choiceRows = (e, prefix = "") => e.choices.map((c) => (_jsx("div", { role: "menuitemradio", "aria-checked": c.value === e.value, className: "o-list-row o-smooth o-smooth-ease o-menu-row", ...partAttrs(c.slot), ...lit(prefix + c.label), children: choiceBody(c) }, c.value)));
113
114
  const rows = (list, prefix = "") => list.map((e, i) => {
114
115
  if (e.kind === "separator")
115
116
  return _jsx("div", { role: "separator", className: "o-list-sep" }, i);
@@ -119,13 +120,13 @@ export function MenuListShown({ entries, label, open, on = [], className }) {
119
120
  return _jsxs(React.Fragment, { children: [_jsx("p", { className: "o-list-heading", children: e.heading }), rows(e.entries, prefix)] }, i);
120
121
  if (e.kind === "check") {
121
122
  const ticked = !!(e.checked ?? e.defaultChecked);
122
- return _jsx("div", { role: "menuitemcheckbox", "aria-checked": ticked, "aria-disabled": e.disabled ? true : undefined, title: e.disabled, ...(e.disabled ? { "data-disabled": "" } : {}), className: "o-list-row o-smooth o-smooth-ease o-menu-row o-menu-check", ...lit(prefix + e.label), children: checkBody(e) }, i);
123
+ return _jsx("div", { role: "menuitemcheckbox", "aria-checked": ticked, "aria-disabled": e.disabled ? true : undefined, title: e.disabled, ...(e.disabled ? { "data-disabled": "" } : {}), className: "o-list-row o-smooth o-smooth-ease o-menu-row o-menu-check", ...partAttrs(e.slot), ...lit(prefix + e.label), children: checkBody(e) }, i);
123
124
  }
124
125
  if (e.kind === "link")
125
- return _jsx("div", { role: "menuitem", className: "o-list-row o-smooth o-smooth-ease o-menu-row", ...lit(prefix + e.label), children: linkBody(e) }, i);
126
+ return _jsx("div", { role: "menuitem", className: "o-list-row o-smooth o-smooth-ease o-menu-row", ...partAttrs(e.slot), ...lit(prefix + e.label), children: linkBody(e) }, i);
126
127
  if (e.kind === "choices" || e.kind === "actions")
127
- return (_jsxs("div", { className: "o-menu-subwrap", children: [_jsx("div", { role: "menuitem", "aria-haspopup": "menu", "aria-expanded": open === e.label, className: "o-list-row o-smooth o-smooth-ease o-menu-row", ...(open === e.label ? { "data-popup-open": "" } : lit(prefix + e.label)), children: e.kind === "choices" ? choicesBody(e) : actionsBody(e) }), open === e.label && panel(e.kind === "choices" ? choiceRows(e, `${e.label}/`) : rows(e.entries, `${e.label}/`), "o-menu-sub")] }, i));
128
- return _jsx("div", { role: "menuitem", "aria-disabled": e.disabled ? true : undefined, title: e.disabled, ...(e.disabled ? { "data-disabled": "" } : {}), className: rowClass(e), ...lit(prefix + e.label), children: actionBody(e) }, i);
128
+ return (_jsxs("div", { className: "o-menu-subwrap", children: [_jsx("div", { role: "menuitem", "aria-haspopup": "menu", "aria-expanded": open === e.label, className: "o-list-row o-smooth o-smooth-ease o-menu-row", ...partAttrs(e.slot), ...(open === e.label ? { "data-popup-open": "" } : lit(prefix + e.label)), children: e.kind === "choices" ? choicesBody(e) : actionsBody(e) }), open === e.label && panel(e.kind === "choices" ? choiceRows(e, `${e.label}/`) : rows(e.entries, `${e.label}/`), "o-menu-sub")] }, i));
129
+ return _jsx("div", { role: "menuitem", "aria-disabled": e.disabled ? true : undefined, title: e.disabled, ...(e.disabled ? { "data-disabled": "" } : {}), className: rowClass(e), ...partAttrs(e.slot), ...lit(prefix + e.label), children: actionBody(e) }, i);
129
130
  });
130
131
  const menu = panel(rows(entries), className);
131
132
  return open ? _jsx("div", { className: "o-menu-pair", children: menu }) : menu;
@@ -236,7 +237,7 @@ export function MenuListPanelRows({ label, entries, onOpen, ticks = "box", onMov
236
237
  firstGrip.current = i;
237
238
  return {
238
239
  ...(g >= 0 ? { "data-row": g, ...(dragging === g ? { "data-lifted": "" } : {}), style: lift(g), "aria-labelledby": named(`${ids}r${g}`), "aria-describedby": `${ids}how` } : {}),
239
- "data-item": "", tabIndex: i === stop ? 0 : -1, ...(lit === i ? { "data-highlighted": "" } : {}),
240
+ ...partAttrs(e && "slot" in e ? e.slot : undefined), "data-item": "", tabIndex: i === stop ? 0 : -1, ...(lit === i ? { "data-highlighted": "" } : {}),
240
241
  onFocus: () => { setStop(i); setLit(i); focusIn.current = true; },
241
242
  onPointerMove: (ev) => {
242
243
  if (lit !== i)
@@ -275,7 +276,7 @@ export function MenuListPanelRows({ label, entries, onOpen, ticks = "box", onMov
275
276
  if (e.kind === "group")
276
277
  return _jsxs("div", { role: "group", "aria-label": e.heading, children: [_jsx("p", { className: "o-list-heading", children: e.heading }), rows(e.entries)] }, k);
277
278
  if (e.kind === "pick")
278
- return (_jsxs("div", { role: "group", "aria-label": e.heading, children: [e.heading && _jsx("p", { className: "o-list-heading", children: e.heading }), e.choices.map((c) => _jsx("div", { role: "menuitemradio", "aria-checked": c.value === e.value, ...item(), onClick: () => e.onChoose?.(c.value), className: ROW, children: choiceBody(c) }, c.value))] }, k));
279
+ return (_jsxs("div", { role: "group", "aria-label": e.heading, children: [e.heading && _jsx("p", { className: "o-list-heading", children: e.heading }), e.choices.map((c) => _jsx("div", { role: "menuitemradio", "aria-checked": c.value === e.value, ...item(), ...partAttrs(c.slot), onClick: () => e.onChoose?.(c.value), className: ROW, children: choiceBody(c) }, c.value))] }, k));
279
280
  if (e.kind === "check")
280
281
  return _jsx(PanelCheck, { e: e, item: item(e), ticks: ticks, grip: gripFor(e), id: idOf(e), words: w, onOpen: () => onOpen?.(e) }, k);
281
282
  if (e.kind === "link") {
@@ -292,10 +293,10 @@ export function MenuListPanelRows({ label, entries, onOpen, ticks = "box", onMov
292
293
  export function tilesOf(entries, allRows) {
293
294
  if (allRows)
294
295
  return { entries };
295
- const plain = entries.filter((e) => (e.kind === undefined || e.kind === "action") && !e.danger && !e.disabled && e.count == null).slice(0, 4);
296
+ const plain = entries.filter((e) => (e.kind === undefined || e.kind === "action") && !e.danger && !e.disabled && e.count == null && e.body === undefined).slice(0, 4);
296
297
  if (plain.length < 3)
297
298
  return { entries };
298
- return { tiles: plain.map((e) => ({ icon: e.icon, label: e.label, onSelect: e.onSelect })), entries: entries.filter((e) => !plain.includes(e)) };
299
+ return { tiles: plain.map((e) => ({ icon: e.icon, label: e.label, onSelect: e.onSelect, ...(e.slot ? { slot: e.slot } : {}) })), entries: entries.filter((e) => !plain.includes(e)) };
299
300
  }
300
301
  function sectionsOf(entries) {
301
302
  const out = [];
@@ -314,7 +315,7 @@ function sectionsOf(entries) {
314
315
  }
315
316
  if (e.kind === "pick") {
316
317
  end();
317
- out.push({ name: e.heading, rows: e.choices.map((c) => ({ kind: "picked", label: c.label, icon: c.mark, chosen: c.value === e.value, onSelect: () => e.onChoose?.(c.value), end: c.detail })) });
318
+ out.push({ name: e.heading, rows: e.choices.map((c) => ({ kind: "picked", label: c.label, icon: c.mark, chosen: c.value === e.value, onSelect: () => e.onChoose?.(c.value), end: c.detail, ...(c.slot ? { slot: c.slot } : {}) })) });
318
319
  continue;
319
320
  }
320
321
  now.push(e);
@@ -328,7 +329,7 @@ const endOf = (r) => {
328
329
  return end != null ? _jsx("span", { className: "o-menu-list-end", "data-on": r.kind === "actions" && r.inForce ? "" : undefined, children: end }) : null;
329
330
  };
330
331
  function PhoneRow({ row, onOpen, move, room, ticks = "switch", words = MENU_LIST_WORDS }) {
331
- const mv = move ? { "data-row": move.at, ...(move.lifted ? { "data-lifted": "" } : {}), style: move.style, ...move.drag } : {};
332
+ const mv = { ...partAttrs(row.slot), ...(move ? { "data-row": move.at, ...(move.lifted ? { "data-lifted": "" } : {}), style: move.style, ...move.drag } : {}) };
332
333
  const how = move ? { "aria-describedby": move.how } : {};
333
334
  const lead = move ? glyph(GRIP, "o-menu-list-grip") : room ? React.cloneElement(glyph(GRIP, "o-menu-list-grip"), { "data-room": "" }) : null;
334
335
  const tickId = React.useId(), named = row.kind === "check" && row.toggle ? { label: { htmlFor: tickId }, tick: { id: tickId } } : { label: {}, tick: {} };
@@ -342,15 +343,16 @@ function PhoneRow({ row, onOpen, move, room, ticks = "switch", words = MENU_LIST
342
343
  return row.render ? React.cloneElement(row.render, attrs, inside) : _jsx("a", { href: row.href, ...attrs, children: inside });
343
344
  }
344
345
  if (row.kind === "picked")
345
- return _jsxs(BaseButton, { className: "o-menu-list-row", "aria-pressed": row.chosen, onClick: row.onSelect, children: [body(row), endOf(row), row.chosen && glyph(TICK, "o-menu-list-tick")] });
346
+ return _jsxs(BaseButton, { className: "o-menu-list-row", ...partAttrs(row.slot), "aria-pressed": row.chosen, onClick: row.onSelect, children: [body(row), endOf(row), row.chosen && glyph(TICK, "o-menu-list-tick")] });
346
347
  if (row.kind === "actions")
347
348
  return _jsxs(BaseButton, { className: "o-menu-list-row", ...mv, ...how, onClick: () => onOpen?.(row), children: [lead, body(row), endOf(row), glyph(MORE, "o-menu-list-more")] });
348
349
  if (row.kind === "choices")
349
350
  return (_jsxs(BaseButton, { className: "o-menu-list-row", ...mv, ...how, onClick: () => onOpen?.(row), children: [lead, body(row), endOf(row), _jsx("span", { className: "o-menu-list-value", children: row.detail ?? row.choices.find((c) => c.value === row.value)?.label }), glyph(MORE, "o-menu-list-more")] }));
350
- return _jsxs(BaseButton, { className: cx("o-menu-list-row", row.danger && "o-menu-list-danger"), ...mv, ...how, disabled: !!row.disabled, onClick: row.onSelect, children: [lead, body(row, row.disabled), endOf(row)] });
351
+ const own = "body" in row && row.body !== undefined ? _jsxs("span", { className: "o-menu-list-name", children: [row.body, row.disabled != null && _jsx("span", { className: "o-menu-list-note", children: row.disabled })] }) : null;
352
+ return _jsxs(BaseButton, { className: cx("o-menu-list-row", row.danger && "o-menu-list-danger"), ...mv, ...how, disabled: !!row.disabled, onClick: row.onSelect, "aria-label": own ? row.label : undefined, children: [lead, own ?? body(row, row.disabled), own ? null : endOf(row)] });
351
353
  }
352
- export function MenuListRow({ label, value, onSelect, className }) {
353
- return _jsxs(BaseButton, { className: cx("o-menu-list-row", className), onClick: onSelect, children: [_jsx("span", { className: "o-menu-list-name", children: _jsx("span", { children: label }) }), _jsx("span", { className: "o-menu-list-value", children: value })] });
354
+ export function MenuListRow({ label, value, onSelect, className, ...part }) {
355
+ return _jsxs(BaseButton, { className: cx("o-menu-list-row", className), ...part, onClick: onSelect, children: [_jsx("span", { className: "o-menu-list-name", children: _jsx("span", { children: label }) }), _jsx("span", { className: "o-menu-list-value", children: value })] });
354
356
  }
355
357
  function PhoneEye({ row, lead, mv, how, onOpen }) {
356
358
  const [own, setOwn] = React.useState(!!row.defaultChecked), on = row.checked ?? own;
@@ -369,7 +371,7 @@ export function MenuList({ label, entries, tiles, onOpen, onClose, closeWord = "
369
371
  const at = gripped.indexOf(r);
370
372
  return at < 0 ? undefined : { at, lifted: dragging === at, style: lift(at), drag: phoneDrag(at), how: `${ids}how` };
371
373
  };
372
- return (_jsxs("div", { ref: root, role: "group", "aria-label": label, className: cx("o-menu-list", className), "data-kit": "menu-list", children: [onClose && _jsx("div", { className: "o-menu-list-section", children: _jsx(PhoneRow, { row: { icon: _jsx(Icon, { name: "x", size: 22 }), label: closeWord, onSelect: onClose } }) }), tiles && (_jsx("div", { className: "o-menu-list-tiles", children: tiles.map((t) => _jsxs(BaseButton, { className: "o-menu-list-tile", disabled: t.disabled, onClick: t.onSelect, children: [_jsx("span", { className: "o-menu-list-mark", children: t.icon }), _jsx("span", { className: "o-menu-list-tile-name", children: t.label })] }, t.label)) })), sections.map((s, i) => {
374
+ return (_jsxs("div", { ref: root, role: "group", "aria-label": label, className: cx("o-menu-list", className), "data-kit": "menu-list", children: [onClose && _jsx("div", { className: "o-menu-list-section", children: _jsx(PhoneRow, { row: { icon: _jsx(Icon, { name: "x", size: 22 }), label: closeWord, onSelect: onClose } }) }), tiles && (_jsx("div", { className: "o-menu-list-tiles", children: tiles.map((t) => _jsxs(BaseButton, { className: "o-menu-list-tile", ...partAttrs(t.slot), disabled: t.disabled, onClick: t.onSelect, children: [_jsx("span", { className: "o-menu-list-mark", children: t.icon }), _jsx("span", { className: "o-menu-list-tile-name", children: t.label })] }, t.label)) })), sections.map((s, i) => {
373
375
  const card = (_jsx("div", { role: s.name ? "group" : undefined, "aria-labelledby": s.name ? `${ids}h${i}` : undefined, className: "o-menu-list-section", children: s.rows.map((r) => _jsx(PhoneRow, { row: r, onOpen: onOpen, move: moveOf(r), room: gripped.length > 0, ticks: ticks, words: w }, r.label)) }, s.name ?? i));
374
376
  return s.name ? _jsxs("div", { className: "o-menu-list-group", children: [_jsx("p", { id: `${ids}h${i}`, className: "o-list-heading", children: s.name }), card] }, `${i}${s.name}`) : card;
375
377
  }), gripped.length > 0 && _jsx(Says, { id: `${ids}how`, how: w.howHold, said: said })] }));
@@ -3,7 +3,9 @@ import * as React from "react";
3
3
  import { Dialog as BaseDialog } from "@base-ui/react/dialog";
4
4
  import { AlertDialog } from "../alert-dialog/alert-dialog.js";
5
5
  import { Button } from "../button/button.js";
6
+ import { useKeptFocus } from "../internal/keep-focus.js";
6
7
  import { PhoneHost, usePhone } from "../internal/phone.js";
8
+ import { OutOfFieldRows } from "../../internal/field-rows.js";
7
9
  import { usePopupHost } from "../internal/popup-host.js";
8
10
  import { Notice } from "../notice/notice.js";
9
11
  import { Scrollbar } from "../scrollbar/scrollbar.js";
@@ -38,6 +40,8 @@ export function Modal({ open, onOpenChange, title, mark, path, onOpenAsPage, siz
38
40
  const [overPopup, setOverPopup] = React.useState(false);
39
41
  React.useLayoutEffect(() => { setOverPopup(!!ref.current?.closest('[data-kit="popover"]')); }, []);
40
42
  const over = overPopup ? "" : undefined;
43
+ const [popup, setPopup] = React.useState(null);
44
+ useKeptFocus(popup);
41
45
  const leave = () => { if (saving)
42
46
  return; if (dirty)
43
47
  setAsking(true);
@@ -58,5 +62,5 @@ export function Modal({ open, onOpenChange, title, mark, path, onOpenAsPage, siz
58
62
  return (_jsxs(_Fragment, { children: [_jsx("span", { ref: ref, hidden: true }), _jsxs(Sheet, { open: open, onOpenChange: (o) => { if (!o)
59
63
  leave(); }, label: title, form: "full", container: where, standing: standing, children: [_jsx(SheetHead, { title: title, left: _jsx(SheetButton, { "aria-label": cancel, icon: glyph(X), onClick: leave, disabled: saving }), right: foot !== "none" && action ? _jsx(SheetButton, { kind: "primary", "aria-label": action.label, icon: glyph(CHECK), onClick: act, disabled: saving || action.disabled }) : _jsx("span", {}) }), _jsxs(SheetBody, { children: [notice, children] }), guard] })] }));
60
64
  return (_jsxs(_Fragment, { children: [_jsx("span", { ref: ref, hidden: true }), _jsx(BaseDialog.Root, { open: open, onOpenChange: (o) => { if (!o)
61
- leave(); }, ...(standing ? { modal: false, disablePointerDismissal: true } : {}), children: _jsxs(BaseDialog.Portal, { container: where, children: [_jsx(BaseDialog.Backdrop, { className: "o-modal-backdrop", "data-over-popup": over }), _jsx(BaseDialog.Viewport, { className: "o-modal-viewport", "data-over-popup": over, children: _jsxs(BaseDialog.Popup, { className: "o-modal", "data-kit": "modal", "data-width": size, "aria-busy": saving || undefined, initialFocus: standing ? false : () => body.current?.querySelector("input:not([type=hidden]), textarea, [role='combobox'], .o-select-field") ?? true, children: [_jsxs("div", { className: "o-modal-cut o-smooth", children: [_jsxs("header", { className: "o-modal-head", children: [mark != null && _jsx("span", { className: "o-modal-mark", "aria-hidden": "true", children: mark }), path && _jsxs("span", { className: "o-modal-path", children: [_jsxs("span", { className: "o-modal-chip", children: [path.icon, _jsx("span", { className: "o-modal-chip-word", children: path.label })] }), glyph(NEXT)] }), _jsx(BaseDialog.Title, { className: "o-modal-title", children: title }), _jsxs("span", { className: "o-modal-tools", children: [onOpenAsPage && _jsx(Button, { kind: "quiet", shape: "icon", size: "xs", "aria-label": said.openAsPage, icon: glyph(EXPAND), onClick: onOpenAsPage }), _jsx(Button, { kind: "quiet", shape: "icon", size: "xs", "aria-label": said.close, icon: glyph(X), disabled: saving, onClick: leave })] })] }), _jsxs("div", { ref: body, className: "o-modal-body", children: [notice, children] }), _jsx(Scrollbar, { drawn: true }), foot !== "none" && (_jsxs("footer", { className: "o-modal-foot", children: [footStart != null && _jsx("span", { className: "o-modal-start", children: footStart }), _jsxs("span", { className: "o-modal-end", children: [foot === "both" && _jsx(Button, { className: "o-modal-cancel", disabled: saving, onClick: leave, children: cancel }), action && _jsx(Button, { kind: action.kind ?? "primary", loading: saving, disabled: action.disabled, onClick: act, children: action.label })] })] }))] }), guard] }) })] }) })] }));
65
+ leave(); }, ...(standing ? { modal: false, disablePointerDismissal: true } : {}), children: _jsxs(BaseDialog.Portal, { container: where, children: [_jsx(BaseDialog.Backdrop, { className: "o-modal-backdrop", "data-over-popup": over }), _jsx(BaseDialog.Viewport, { className: "o-modal-viewport", "data-over-popup": over, children: _jsxs(BaseDialog.Popup, { ref: setPopup, className: "o-modal", "data-kit": "modal", "data-width": size, "aria-busy": saving || undefined, initialFocus: standing ? false : () => body.current?.querySelector("input:not([type=hidden]), textarea, [role='combobox'], .o-select-field") ?? true, children: [_jsxs("div", { className: "o-modal-cut o-smooth", children: [_jsxs("header", { className: "o-modal-head", children: [mark != null && _jsx("span", { className: "o-modal-mark", "aria-hidden": "true", children: mark }), path && _jsxs("span", { className: "o-modal-path", children: [_jsxs("span", { className: "o-modal-chip", children: [path.icon, _jsx("span", { className: "o-modal-chip-word", children: path.label })] }), glyph(NEXT)] }), _jsx(BaseDialog.Title, { className: "o-modal-title", children: title }), _jsxs("span", { className: "o-modal-tools", children: [onOpenAsPage && _jsx(Button, { kind: "quiet", shape: "icon", size: "xs", "aria-label": said.openAsPage, icon: glyph(EXPAND), onClick: onOpenAsPage }), _jsx(Button, { kind: "quiet", shape: "icon", size: "xs", "aria-label": said.close, icon: glyph(X), disabled: saving, onClick: leave })] })] }), _jsx("div", { ref: body, className: "o-modal-body", children: _jsxs(OutOfFieldRows, { children: [notice, children] }) }), _jsx(Scrollbar, { drawn: true }), foot !== "none" && (_jsxs("footer", { className: "o-modal-foot", children: [footStart != null && _jsx("span", { className: "o-modal-start", children: footStart }), _jsxs("span", { className: "o-modal-end", children: [foot === "both" && _jsx(Button, { className: "o-modal-cancel", disabled: saving, onClick: leave, children: cancel }), action && _jsx(Button, { kind: action.kind ?? "primary", loading: saving, disabled: action.disabled, onClick: act, children: action.label })] })] }))] }), guard] }) })] }) })] }));
62
66
  }
@@ -41,9 +41,11 @@ export interface NoticeProps {
41
41
  className?: string;
42
42
  /** Its × drawn as under the pointer or in focus, as a page that shows it draws it. */
43
43
  "data-force"?: "hover" | "focus";
44
+ /** Its public name where a panel names it (VK-988): `vk-customize-stale`, say. */
45
+ "data-slot"?: string;
44
46
  /** Its own words, over the English: Retry, Retrying…, and the ×'s name. */
45
47
  words?: Partial<NoticeWords>;
46
48
  }
47
49
  /** A sentence set into the page on its meaning's ground: worth knowing, done, careful, wrong or a plain fact (neutral). It can
48
50
  * carry what to do about it, a title, or a way to put it away. */
49
- export declare function Notice({ meaning, icon, title, children, actions, onRetry, dismissible, onDismiss, urgent, arrived, className, "data-force": force, words }: NoticeProps): import("react/jsx-runtime").JSX.Element | null;
51
+ export declare function Notice({ meaning, icon, title, children, actions, onRetry, dismissible, onDismiss, urgent, arrived, className, "data-force": force, "data-slot": slot, words }: NoticeProps): import("react/jsx-runtime").JSX.Element | null;
@@ -13,7 +13,7 @@ const X = ["M18 6l-12 12", "M6 6l12 12"];
13
13
  const glyph = (paths, className, strokeWidth = 2) => (_jsx("svg", { className: className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: paths.map((d) => _jsx("path", { d: d }, d)) }));
14
14
  const still = () => typeof matchMedia !== "undefined" && matchMedia("(prefers-reduced-motion: reduce)").matches;
15
15
  export const NOTICE_WORDS = { retry: "Retry", retrying: "Retrying…", dismiss: "Dismiss" };
16
- export function Notice({ meaning = "information", icon, title, children, actions = [], onRetry, dismissible, onDismiss, urgent, arrived, className, "data-force": force, words }) {
16
+ export function Notice({ meaning = "information", icon, title, children, actions = [], onRetry, dismissible, onDismiss, urgent, arrived, className, "data-force": force, "data-slot": slot, words }) {
17
17
  const said = { ...NOTICE_WORDS, ...words }, phone = usePhoneForm();
18
18
  const [phase, setPhase] = React.useState("here"), [retrying, setRetrying] = React.useState(false);
19
19
  const away = () => { if (still()) {
@@ -28,7 +28,7 @@ export function Notice({ meaning = "information", icon, title, children, actions
28
28
  return null;
29
29
  const acts = (onRetry || actions.length > 0) && (_jsxs(_Fragment, { children: [onRetry && _jsx(Button, { kind: "text", size: "xs", "aria-busy": retrying || undefined, onClick: retry, children: retrying ? said.retrying : said.retry }), actions.map((a, i) => !React.isValidElement(a) ? _jsx(Button, { kind: "text", size: "xs", onClick: a.onClick, children: a.label }, a.label)
30
30
  : React.cloneElement(a, { key: a.key ?? i, ...(a.type === Button ? { size: "xs" } : {}) }))] }));
31
- return (_jsxs("div", { role: urgent ? "alert" : "status", "data-meaning": meaning, "data-kit": "notice", ...phoneMark(phone), className: cx("o-notice o-smooth o-smooth-ease", title != null && "o-notice-titled", arrived && "o-notice-arrived", phase === "going" && "o-notice-going", className), onTransitionEnd: (e) => { if (phase === "going" && e.target === e.currentTarget && e.propertyName === "opacity") {
31
+ return (_jsxs("div", { role: urgent ? "alert" : "status", "data-meaning": meaning, "data-slot": slot, "data-kit": "notice", ...phoneMark(phone), className: cx("o-notice o-smooth o-smooth-ease", title != null && "o-notice-titled", arrived && "o-notice-arrived", phase === "going" && "o-notice-going", className), onTransitionEnd: (e) => { if (phase === "going" && e.target === e.currentTarget && e.propertyName === "opacity") {
32
32
  setPhase("gone");
33
33
  onDismiss?.();
34
34
  } }, children: [icon === false ? null : icon != null ? _jsx("span", { className: "o-notice-icon", "aria-hidden": "true", children: icon }) : glyph(NOTICE_ICONS[meaning === "neutral" ? "information" : meaning], "o-notice-icon"), _jsxs("div", { className: "o-notice-body", children: [title != null && _jsx("p", { className: "o-notice-title", children: title }), _jsx("div", { className: "o-notice-text", children: children }), title != null && acts && _jsx("div", { className: "o-notice-below", children: acts })] }), title == null && acts && _jsx("div", { className: "o-notice-acts", children: acts }), dismissible && _jsx(Button, { kind: "quiet", size: "xs", shape: "icon", className: "o-notice-x", "aria-label": said.dismiss, "data-force": force, icon: glyph(X, "", 2.25), onClick: away })] }));
@@ -8,7 +8,7 @@ export type { Currency, NumberKind, Unit } from "./format.js";
8
8
  * its own (money's currencies). */
9
9
  export interface NumberEditorParts {
10
10
  body: React.ReactNode;
11
- head: Pick<SheetHeadProps, "left" | "right" | "onBack" | "close">;
11
+ head: Pick<SheetHeadProps, "left" | "right" | "onBack" | "backSlot" | "close">;
12
12
  title?: string;
13
13
  }
14
14
  interface Common {
@@ -162,20 +162,20 @@ export function useNumberEditor(props) {
162
162
  } };
163
163
  const sign = now?.sign ?? now?.code;
164
164
  const fieldStart = now ? (pickable
165
- ? _jsx(InputGroupButton, { "aria-label": named, iconEnd: glyph(DOWN), onClick: choose, children: codes || !now.sign ? now.code : `${now.sign} ${now.code}` })
166
- : codes ? _jsx("span", { className: "o-number-editor-code", children: now.code }) : _jsx("span", { className: "o-number-editor-sign", children: sign })) : undefined;
165
+ ? _jsx(InputGroupButton, { "data-slot": "vk-number-currency", "aria-label": named, iconEnd: glyph(DOWN), onClick: choose, children: codes || !now.sign ? now.code : `${now.sign} ${now.code}` })
166
+ : codes ? _jsx("span", { className: "o-number-editor-code", "data-slot": "vk-number-unit", "data-key": "code", children: now.code }) : _jsx("span", { className: "o-number-editor-sign", "data-slot": "vk-number-unit", "data-key": "sign", children: sign })) : undefined;
167
167
  const boxStart = now ? (pickable
168
- ? _jsx(Button, { kind: "quiet", size: "sm", className: "o-number-editor-code", look: SHEET_CODE, "aria-label": named, iconEnd: glyph(DOWN), onClick: choose, children: codes || !now.sign ? now.code : `${now.sign} ${now.code}` })
169
- : _jsx("span", { className: codes ? "o-number-editor-code" : "o-number-editor-sign", children: codes ? now.code : sign })) : undefined;
168
+ ? _jsx(Button, { kind: "quiet", size: "sm", className: "o-number-editor-code", "data-slot": "vk-number-currency", look: SHEET_CODE, "aria-label": named, iconEnd: glyph(DOWN), onClick: choose, children: codes || !now.sign ? now.code : `${now.sign} ${now.code}` })
169
+ : _jsx("span", { className: codes ? "o-number-editor-code" : "o-number-editor-sign", "data-slot": "vk-number-unit", "data-key": codes ? "code" : "sign", children: codes ? now.code : sign })) : undefined;
170
170
  const amount = worn.sheet === "field"
171
- ? _jsx(PhoneField, { ...shared, words: steps, label: label, before: fieldStart, after: kind === "percent" ? "%" : undefined, onKeyDown: enter, box: refs })
172
- : _jsx(NumberField, { ref: field, size: "lg", steppers: false, words: steps, className: "o-number-editor-sheet", before: boxStart, after: kind === "percent" ? _jsx("span", { className: "o-number-editor-unit", children: "%" }) : undefined, ...shared, "aria-label": label, autofill: false, onKeyDown: enter });
173
- const body = (_jsx("div", { ref: placeRoot, className: "o-number-editor", "data-kit": "number-editor", ...device, "data-number-form": "phone", onChange: readChange, "data-number-kind": kind, "data-number-step": choosing ? "currency" : undefined, children: choosing ? picker.body : amount }));
171
+ ? _jsx(PhoneField, { ...shared, "data-slot": "vk-number-box", words: steps, label: label, before: fieldStart, after: kind === "percent" ? "%" : undefined, onKeyDown: enter, box: refs })
172
+ : _jsx(NumberField, { ref: field, size: "lg", steppers: false, words: steps, className: "o-number-editor-sheet", "data-slot": "vk-number-box", before: boxStart, after: kind === "percent" ? _jsx("span", { className: "o-number-editor-unit", "data-slot": "vk-number-unit", "data-key": "percent", children: "%" }) : undefined, ...shared, "aria-label": label, autofill: false, onKeyDown: enter });
173
+ const body = (_jsx("div", { ref: placeRoot, className: "o-number-editor", "data-slot": "vk-number", "data-kit": "number-editor", ...device, "data-number-form": "phone", onChange: readChange, "data-number-kind": kind, "data-number-step": choosing ? "currency" : undefined, children: choosing ? picker.body : amount }));
174
174
  if (choosing)
175
- return { body, head: { onBack: () => setChoosing(false), close: false }, title: words.name };
175
+ return { body, head: { onBack: () => setChoosing(false), backSlot: "vk-editor-back", close: false }, title: words.name };
176
176
  if (shell)
177
177
  return { body, head: {} };
178
- return { body, head: { left: _jsx(SheetButton, { "aria-label": "Close", icon: glyph(X), onClick: leave }), right: _jsx(SheetButton, { kind: "primary", "aria-label": "Save", icon: glyph(TICK), onClick: keep }) } };
178
+ return { body, head: { left: _jsx(SheetButton, { "data-slot": "vk-editor-close", "aria-label": "Close", icon: glyph(X), onClick: leave }), right: _jsx(SheetButton, { "data-slot": "vk-editor-save", kind: "primary", "aria-label": "Save", icon: glyph(TICK), onClick: keep }) } };
179
179
  }
180
180
  const onBlur = (e) => {
181
181
  if (shell || settled.current || choosing || (e.relatedTarget instanceof Node && e.currentTarget.contains(e.relatedTarget)))
@@ -183,10 +183,10 @@ export function useNumberEditor(props) {
183
183
  keep();
184
184
  };
185
185
  const start = !now ? null : worn.units === "code"
186
- ? (pickable ? _jsx(Button, { ref: setChip, kind: "quiet", size: "xs", className: "o-number-editor-code", "aria-label": named, "aria-expanded": choosing, iconEnd: glyph(DOWN), onClick: () => setChoosing(true), children: now.code }) : null)
187
- : (pickable ? _jsx(Button, { ref: setChip, kind: "soft", size: "2xs", className: "o-number-editor-currency", "aria-label": named, iconEnd: glyph(DOWN), onClick: () => setChoosing(true), children: now.sign ?? now.code })
188
- : _jsx("span", { className: "o-number-editor-sign", children: now.sign ?? now.code }));
189
- const body = (_jsxs("div", { ref: wornAt, className: "o-number-editor", "data-kit": "number-editor", ...device, "data-number-form": "computer", "data-number-kind": kind, onChange: readChange, onBlur: onBlur, onFocus: () => { settled.current = false; }, children: [_jsx(NumberField, { ref: field, chrome: "inline", align: align, words: steps, steppers: worn.arrows === "editing" ? "arrows" : false, before: start ?? undefined, after: kind === "percent" ? _jsx("span", { className: "o-number-editor-unit", children: "%" }) : undefined, ...shared, "aria-label": label, autofill: false, onKeyDown: onKeyDown, className: "o-number-editor-field" }), pickable && chip && (_jsx(Popover, { open: choosing, onOpenChange: (o) => { if (!o)
186
+ ? (pickable ? _jsx(Button, { ref: setChip, kind: "quiet", size: "xs", className: "o-number-editor-code", "data-slot": "vk-number-currency", "aria-label": named, "aria-expanded": choosing, iconEnd: glyph(DOWN), onClick: () => setChoosing(true), children: now.code }) : null)
187
+ : (pickable ? _jsx(Button, { ref: setChip, kind: "soft", size: "2xs", className: "o-number-editor-currency", "data-slot": "vk-number-currency", "aria-label": named, iconEnd: glyph(DOWN), onClick: () => setChoosing(true), children: now.sign ?? now.code })
188
+ : _jsx("span", { className: "o-number-editor-sign", "data-slot": "vk-number-unit", "data-key": "sign", children: now.sign ?? now.code }));
189
+ const body = (_jsxs("div", { ref: wornAt, className: "o-number-editor", "data-slot": "vk-number", "data-kit": "number-editor", ...device, "data-number-form": "computer", "data-number-kind": kind, onChange: readChange, onBlur: onBlur, onFocus: () => { settled.current = false; }, children: [_jsx(NumberField, { ref: field, chrome: "inline", align: align, words: steps, steppers: worn.arrows === "editing" ? "arrows" : false, before: start ?? undefined, after: kind === "percent" ? _jsx("span", { className: "o-number-editor-unit", "data-slot": "vk-number-unit", "data-key": "percent", children: "%" }) : undefined, ...shared, "aria-label": label, autofill: false, onKeyDown: onKeyDown, className: "o-number-editor-field", "data-slot": "vk-number-box" }), pickable && chip && (_jsx(Popover, { open: choosing, onOpenChange: (o) => { if (!o)
190
190
  back(); }, anchor: chip, "aria-label": words.name, popupData: popupData, children: _jsx(Picker, { label: words.name, items: items, value: code ?? null, onValueChange: (c) => { if (typeof c === "string")
191
191
  pick(c); }, onDone: back, search: words.find, form: "computer", fromHeld: true, ...(w.picker ? { words: w.picker } : {}) }) }))] }));
192
192
  return { body, head: {} };
@@ -81,7 +81,9 @@ export const NumberField = React.forwardRef(function NumberField({ size = "md",
81
81
  pageKeys(e, !disabled && !readOnly); }, onFocus: (e) => { typed.focus(); onFocus?.(e); }, onBlur: (e) => { typed.leave(); onBlur?.(e); } }));
82
82
  if (chrome === "bare")
83
83
  return (_jsx(BaseNumberField.Root, { ref: ref, className: cx("o-number o-number-bare", className), style: style, disabled: disabled, readOnly: readOnly, "data-kit": "number-field", ...phoneMark(phone), ...root, ...values, children: input }));
84
- return (_jsx(BaseNumberField.Root, { ref: ref, className: cx("o-number", className), style: style, disabled: disabled, readOnly: readOnly, "data-kit": "number-field", ...phoneMark(phone), ...root, ...values, children: _jsxs(BaseNumberField.Group, { render: (props) => chrome === "inline"
85
- ? _jsx(InlineInputGroup, { ...props, children: props.children })
86
- : _jsx(InputGroup, { size: size, look: look, chrome: chrome === "soft" ? "soft" : undefined, ...props, children: props.children }), children: [side("start", before), input, side("end", after), stepped && (_jsxs(InputGroupAddon, { side: "end", className: "o-number-steps", children: [_jsx(BaseNumberField.Decrement, { ...(words?.decrease ? { "aria-label": words.decrease } : {}), render: _jsx(InputGroupButton, { icon: _jsx(Mark, { paths: MINUS }) }) }), _jsx(BaseNumberField.Increment, { ...(words?.increase ? { "aria-label": words.increase } : {}), render: _jsx(InputGroupButton, { icon: _jsx(Mark, { paths: PLUS }) }) })] })), arrows && (_jsxs(InputGroupAddon, { side: "end", className: "o-number-arrows", children: [_jsx(BaseNumberField.Increment, { className: "o-number-arrow", "aria-label": words?.increase ?? "Increase", children: UP_MARK }), _jsx(BaseNumberField.Decrement, { className: "o-number-arrow", "aria-label": words?.decrease ?? "Decrease", children: DOWN_MARK })] }))] }) }));
84
+ const { "data-slot": slot, "data-key": key, ...rest } = root;
85
+ const part = { ...(slot != null ? { "data-slot": slot } : {}), ...(key != null ? { "data-key": key } : {}) };
86
+ return (_jsx(BaseNumberField.Root, { ref: ref, className: cx("o-number", className), style: style, disabled: disabled, readOnly: readOnly, "data-kit": "number-field", ...phoneMark(phone), ...rest, ...values, children: _jsxs(BaseNumberField.Group, { render: (props) => chrome === "inline"
87
+ ? _jsx(InlineInputGroup, { ...props, ...part, children: props.children })
88
+ : _jsx(InputGroup, { size: size, look: look, chrome: chrome === "soft" ? "soft" : undefined, ...props, ...part, children: props.children }), children: [side("start", before), input, side("end", after), stepped && (_jsxs(InputGroupAddon, { side: "end", className: "o-number-steps", children: [_jsx(BaseNumberField.Decrement, { ...(words?.decrease ? { "aria-label": words.decrease } : {}), render: _jsx(InputGroupButton, { icon: _jsx(Mark, { paths: MINUS }) }) }), _jsx(BaseNumberField.Increment, { ...(words?.increase ? { "aria-label": words.increase } : {}), render: _jsx(InputGroupButton, { icon: _jsx(Mark, { paths: PLUS }) }) })] })), arrows && (_jsxs(InputGroupAddon, { side: "end", className: "o-number-arrows", children: [_jsx(BaseNumberField.Increment, { className: "o-number-arrow", "aria-label": words?.increase ?? "Increase", children: UP_MARK }), _jsx(BaseNumberField.Decrement, { className: "o-number-arrow", "aria-label": words?.decrease ?? "Decrease", children: DOWN_MARK })] }))] }) }));
87
89
  });
@@ -32,16 +32,18 @@ export declare function Pane({ open, onOpenChange, container, opener, initialFoc
32
32
  * popover) draws plain instead (Customize, VK-840). A Popover opened from inside a Pane sets it back to false round what it holds.
33
33
  * The package's own; no entry point exports it. */
34
34
  export declare const InPane: React.Context<boolean>;
35
+ /** A part of the Pane: what it holds, its class, and the public name a panel gives it (VK-988). */
35
36
  type Slot = {
36
37
  children: React.ReactNode;
37
38
  className?: string;
39
+ "data-slot"?: string;
38
40
  };
39
41
  /** Its head, which what stands in it fills: its title, its ✕. It stays at its top. */
40
- export declare function PaneHead({ children, className }: Slot): import("react/jsx-runtime").JSX.Element;
42
+ export declare function PaneHead({ children, className, "data-slot": slot }: Slot): import("react/jsx-runtime").JSX.Element;
41
43
  /** What it holds, scrolling between its head and its foot. */
42
44
  export declare function PaneBody({ children, className }: Slot): import("react/jsx-runtime").JSX.Element;
43
45
  /** Its foot, under a line across the whole Pane, always at its foot. */
44
- export declare function PaneFoot({ children, className }: Slot): import("react/jsx-runtime").JSX.Element;
46
+ export declare function PaneFoot({ children, className, "data-slot": slot }: Slot): import("react/jsx-runtime").JSX.Element;
45
47
  /** Its title, which names it to a screen reader too. */
46
48
  export declare function PaneTitle({ children, className }: Slot): import("react/jsx-runtime").JSX.Element;
47
49
  /** What closes it from inside (a Button: `render`), with the reason close-press: what stands in it draws its own ✕. */
@@ -2,6 +2,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
2
2
  import * as React from "react";
3
3
  import { Dialog } from "@base-ui/react/dialog";
4
4
  import { cx } from "../../internal/cx.js";
5
+ import { OutOfFieldRows } from "../../internal/field-rows.js";
5
6
  import { closeReasonOf } from "../internal/close-reason.js";
6
7
  import { Scrollbar } from "../scrollbar/scrollbar.js";
7
8
  import { paneAfter } from "./state.js";
@@ -61,17 +62,17 @@ export function Pane({ open, onOpenChange, container, opener, initialFocus = tru
61
62
  };
62
63
  if (!container)
63
64
  return null;
64
- return (_jsx(Dialog.Root, { open: open, onOpenChange: change, modal: false, disablePointerDismissal: true, children: _jsx(Dialog.Portal, { container: container, className: "o-pane-portal", children: _jsx(Dialog.Popup, { ref: popup, className: cx("o-pane", className), "data-kit": "pane", "aria-label": label, initialFocus: initialFocus ? popup : false, finalFocus: backTo, children: _jsx("div", { className: "o-pane-cut o-smooth", children: _jsx(InPane.Provider, { value: true, children: children }) }) }) }) }));
65
+ return (_jsx(Dialog.Root, { open: open, onOpenChange: change, modal: false, disablePointerDismissal: true, children: _jsx(Dialog.Portal, { container: container, className: "o-pane-portal", children: _jsx(Dialog.Popup, { ref: popup, className: cx("o-pane", className), "data-kit": "pane", "aria-label": label, initialFocus: initialFocus ? popup : false, finalFocus: backTo, children: _jsx("div", { className: "o-pane-cut o-smooth", children: _jsx(InPane.Provider, { value: true, children: _jsx(OutOfFieldRows, { children: children }) }) }) }) }) }));
65
66
  }
66
67
  export const InPane = React.createContext(false);
67
- export function PaneHead({ children, className }) {
68
- return _jsx("div", { className: cx("o-pane-head", className), children: children });
68
+ export function PaneHead({ children, className, "data-slot": slot }) {
69
+ return _jsx("div", { className: cx("o-pane-head", className), "data-slot": slot, children: children });
69
70
  }
70
71
  export function PaneBody({ children, className }) {
71
72
  return _jsxs(_Fragment, { children: [_jsx("div", { className: cx("o-pane-body", className), children: children }), _jsx(Scrollbar, {})] });
72
73
  }
73
- export function PaneFoot({ children, className }) {
74
- return _jsx("div", { className: cx("o-pane-foot", className), children: children });
74
+ export function PaneFoot({ children, className, "data-slot": slot }) {
75
+ return _jsx("div", { className: cx("o-pane-foot", className), "data-slot": slot, children: children });
75
76
  }
76
77
  export function PaneTitle({ children, className }) {
77
78
  return _jsx(Dialog.Title, { className: cx("o-pane-title", className), children: children });
@@ -4,6 +4,10 @@ export interface HeaderBarProps extends Omit<React.HTMLAttributes<HTMLDivElement
4
4
  left?: React.ReactNode;
5
5
  /** What stands in its middle: the title. */
6
6
  title: React.ReactNode;
7
+ /** A record's mark (a company's square, a person's face: the Avatar at 24), standing before the title and never shrinking, the
8
+ * title cut with … beside it; the two stand together, centred or at the left as `titleAt` says. Hidden from a screen reader:
9
+ * the title says the name. */
10
+ mark?: React.ReactNode;
7
11
  /** A quieter second line under the title: a page's or a sheet's description. */
8
12
  description?: React.ReactNode;
9
13
  /** The element that draws the description when it must be the caller's own (a sheet's Base UI Dialog.Description); a span by
@@ -15,4 +19,4 @@ export interface HeaderBarProps extends Omit<React.HTMLAttributes<HTMLDivElement
15
19
  right?: React.ReactNode;
16
20
  }
17
21
  /** The phone's header: a left place, the title and a right place, on the soft edge, over what scrolls. */
18
- export declare function HeaderBar({ left, title, description, descriptionRender, titleAt, right, className, ...props }: HeaderBarProps): import("react/jsx-runtime").JSX.Element;
22
+ export declare function HeaderBar({ left, title, mark, description, descriptionRender, titleAt, right, className, ...props }: HeaderBarProps): import("react/jsx-runtime").JSX.Element;
@@ -3,7 +3,7 @@ import { useRender } from "@base-ui/react/use-render";
3
3
  import { cx } from "../../internal/cx.js";
4
4
  import { GlassButtonGroup } from "../glass-button/glass-button.js";
5
5
  import { SoftEdge } from "./soft-edge.js";
6
- export function HeaderBar({ left, title, description, descriptionRender, titleAt = "center", right, className, ...props }) {
6
+ export function HeaderBar({ left, title, mark, description, descriptionRender, titleAt = "center", right, className, ...props }) {
7
7
  const shown = useRender({ defaultTagName: "span", render: descriptionRender, props: { className: "o-hd-bar-description", children: description } });
8
- return (_jsxs("div", { className: cx("o-hd-bar", className), "data-title-at": titleAt === "left" ? "left" : undefined, ...props, children: [_jsx(SoftEdge, { className: "o-hd-bar-edge" }), _jsx("span", { className: "o-hd-bar-side", children: left }), _jsxs("span", { className: "o-hd-bar-title", children: [title, description != null && shown] }), _jsx(GlassButtonGroup, { className: "o-hd-bar-side", children: right })] }));
8
+ return (_jsxs("div", { className: cx("o-hd-bar", className), "data-title-at": titleAt === "left" ? "left" : undefined, "data-mark": mark != null ? "" : undefined, ...props, children: [_jsx(SoftEdge, { className: "o-hd-bar-edge" }), _jsx("span", { className: "o-hd-bar-side", children: left }), _jsxs("span", { className: "o-hd-bar-title", children: [mark != null && _jsx("span", { className: "o-hd-bar-mark", "aria-hidden": "true", children: mark }), title, description != null && shown] }), _jsx(GlassButtonGroup, { className: "o-hd-bar-side", children: right })] }));
9
9
  }
@@ -1,7 +1,7 @@
1
1
  /* The phone's header bar, the one row a page and a sheet's head both draw, and the soft edge it stands on. Every value it draws
2
2
  with is a public name (controls/phone-header/tokens.ts); this file only says which name each part takes: 44 tall on the page's
3
3
  padding (--page-padding; in a sheet, the sheet's), its title centred between its two places, whatever stands in them, and cut
4
- before it reaches them. --hd-bar-room is the room standing over it: the soft edge starts that far above it and ends just past
4
+ before it reaches them; a record's mark, when it has one, beside its title. --hd-bar-room is the room standing over it: the soft edge starts that far above it and ends just past
5
5
  it, so it always reaches the top of what it stands in. What an app sets once is a data attribute on the frame around it
6
6
  (looks.ts):
7
7
 
@@ -44,6 +44,16 @@
44
44
  /* Its title at the left: after what stands on its left, taking the room there is. */
45
45
  .o-hd-bar[data-title-at="left"] { grid-template-columns: auto minmax(0, 1fr) auto; }
46
46
  .o-hd-bar[data-title-at="left"] > .o-hd-bar-title { text-align: start; }
47
+ /* A record's mark beside its title (data-mark): its own column, as wide as the mark, so it never shrinks while the words cut with
48
+ … beside it, 8 apart; the two stand together, centred, or at the left after what stands there. With a description the mark
49
+ stands beside both lines. */
50
+ .o-hd-bar[data-mark] > .o-hd-bar-title {
51
+ grid-template-columns: max-content minmax(0, max-content); column-gap: calc(var(--vk-spacing) * 2);
52
+ justify-content: center; align-items: center; text-align: start;
53
+ }
54
+ .o-hd-bar[data-mark][data-title-at="left"] > .o-hd-bar-title { justify-content: start; }
55
+ .o-hd-bar-mark { display: flex; overflow: visible; }
56
+ .o-hd-bar-mark:has(~ .o-hd-bar-description) { grid-row: span 2; }
47
57
  /* Flat: no soft edge, and a smaller title. What it stands on is its place's: the page's header on a page, the Sheet's in a sheet. */
48
58
  [data-phone-header-surface="flat"] .o-hd-bar > .o-hd-bar-edge { display: none; }
49
59
  [data-phone-header-surface="flat"] .o-hd-bar > .o-hd-bar-title { font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); }
@@ -41,6 +41,9 @@ export function pickerWordsOf(say) {
41
41
  noneTyped: (typed) => say({ key: "views.picker.none-typed", values: { typed } }),
42
42
  create: (typed) => say({ key: "views.picker.create", values: { typed } }),
43
43
  createButton: say({ key: "views.picker.create-button" }),
44
+ add: (value) => say({ key: "views.editors.add-option", values: { value } }),
45
+ adding: (value) => say({ key: "views.editors.adding-option", values: { value } }),
46
+ addButton: say({ key: "views.editors.values-add" }),
44
47
  loadingMore: say({ key: "views.picker.loading-more" }),
45
48
  chosen: (count) => say({ key: "views.picker.chosen", values: { count } }),
46
49
  clearAll: say({ key: "views.picker.clear-all" }),
@@ -21,6 +21,12 @@ export interface PickerWords {
21
21
  create: (typed: string) => string;
22
22
  /** A phone's bar's Create. */
23
23
  createButton: string;
24
+ /** + Add's row, after the matches (`onAdd`). */
25
+ add: (typed: string) => string;
26
+ /** + Add's row while the app answers. */
27
+ adding: (typed: string) => string;
28
+ /** A phone's bar's + Add. */
29
+ addButton: string;
24
30
  loadingMore: string;
25
31
  chosen: (count: number) => string;
26
32
  clearAll: string;
@@ -69,6 +75,14 @@ export interface PickerProps {
69
75
  search?: string;
70
76
  /** Takes new values: handed what was typed, it makes the value and returns it, which is then picked. */
71
77
  onCreate?: (typed: string) => string;
78
+ /** Asks the app to add what was typed (ViewKit's + Add): offered where Create is, a row after the matches reading Add “word”
79
+ * (on a phone the bar's Add), which picks nothing: the app's option comes back in `items` and is picked by its holder.
80
+ * Handed instead of `onCreate`. */
81
+ onAdd?: (typed: string) => void;
82
+ /** The add in flight, its word: its row reads Adding “word”… and can't be pressed, whatever is typed. */
83
+ adding?: string;
84
+ /** The last add refused, or failed: the app's words, shown where its row was until something else is typed. */
85
+ addRefused?: string;
72
86
  /** The values come from the server: handed each query; `items` are its answer, shown as they are. */
73
87
  onSearch?: (query: string) => void;
74
88
  /** What the list is doing besides showing its rows. */
@@ -136,6 +150,8 @@ export interface PickerProps {
136
150
  /** On a phone, a frame of their own round its rows' menus' rows (the Menu's `frame`, MENU_LIST_CARD_FRAME): what a list whose
137
151
  * rows' menus are no menu's own sheet (a list of views) keeps, whatever the app picked round it. */
138
152
  menuFrame?: Readonly<Record<string, string>>;
153
+ /** The public name of its rows' menus where a panel names them (VK-988: the views list's `vk-view-menu`), on each one's popup. */
154
+ menuSlot?: string;
139
155
  /** On a phone, a row's ⋯ hands its value here and opens no Menu of its own: its holder turns its Sheet into the row's menu (a
140
156
  * list of views; one sheet, never a sheet on top). On a computer it changes nothing. */
141
157
  onRowMenu?: (value: string) => void;