@viewkitjs/views 0.5.0 → 0.6.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 (413) hide show
  1. package/CHANGELOG.md +620 -0
  2. package/README.md +4 -2
  3. package/dist/atoms/Avatar.d.ts +2 -0
  4. package/dist/atoms/Avatar.js +13 -0
  5. package/dist/atoms/CellMore.d.ts +2 -0
  6. package/dist/atoms/CellMore.js +4 -0
  7. package/dist/atoms/DisabledReason.d.ts +11 -0
  8. package/dist/atoms/DisabledReason.js +10 -0
  9. package/dist/atoms/DrillRows.d.ts +2 -2
  10. package/dist/atoms/DrillRows.js +7 -5
  11. package/dist/atoms/Loading.d.ts +6 -0
  12. package/dist/atoms/Loading.js +4 -1
  13. package/dist/atoms/PanelRows.js +3 -5
  14. package/dist/atoms/Pill.d.ts +2 -0
  15. package/dist/atoms/Pill.js +25 -0
  16. package/dist/atoms/RangeCalendar.d.ts +8 -0
  17. package/dist/atoms/RangeCalendar.js +30 -0
  18. package/dist/atoms/RelationRoles.js +2 -2
  19. package/dist/atoms/SelectionSheet.js +5 -4
  20. package/dist/atoms/ToolbarButton.d.ts +2 -0
  21. package/dist/atoms/ToolbarButton.js +18 -0
  22. package/dist/atoms/defaults.js +10 -0
  23. package/dist/atoms/types.d.ts +141 -1
  24. package/dist/cells/cell-format.d.ts +10 -1
  25. package/dist/cells/cell-title.d.ts +5 -1
  26. package/dist/cells/cell-title.js +2 -2
  27. package/dist/cells/cell-values.js +22 -7
  28. package/dist/cells/relation-wrap.js +1 -1
  29. package/dist/contract.d.ts +351 -15
  30. package/dist/contract.js +482 -4
  31. package/dist/display/actor.js +1 -1
  32. package/dist/display/boolean.js +5 -0
  33. package/dist/display/entity-chip.d.ts +12 -9
  34. package/dist/display/entity-chip.js +4 -5
  35. package/dist/display/fit-values.d.ts +34 -0
  36. package/dist/display/fit-values.js +45 -0
  37. package/dist/display/location.js +1 -1
  38. package/dist/display/multi-value.js +72 -8
  39. package/dist/display/options.d.ts +9 -1
  40. package/dist/display/relation.js +1 -1
  41. package/dist/display/rich-text.js +17 -6
  42. package/dist/display/select.js +6 -4
  43. package/dist/display/status-steps.d.ts +8 -0
  44. package/dist/display/status-steps.js +18 -0
  45. package/dist/display/viewer.js +1 -0
  46. package/dist/editors/BodyFrame.d.ts +29 -0
  47. package/dist/editors/BodyFrame.js +80 -0
  48. package/dist/editors/DateEditor.js +13 -17
  49. package/dist/editors/LocationEditor.d.ts +2 -0
  50. package/dist/editors/LocationEditor.js +29 -5
  51. package/dist/editors/NameEditor.d.ts +2 -0
  52. package/dist/editors/NameEditor.js +27 -7
  53. package/dist/editors/NumberEditor.d.ts +18 -0
  54. package/dist/editors/NumberEditor.js +29 -2
  55. package/dist/editors/RangeEditor.d.ts +2 -0
  56. package/dist/editors/RangeEditor.js +29 -4
  57. package/dist/editors/SelectEditor.d.ts +5 -0
  58. package/dist/editors/SelectEditor.js +3 -2
  59. package/dist/editors/TextEditor.d.ts +11 -1
  60. package/dist/editors/TextEditor.js +25 -8
  61. package/dist/editors/ValueListEditor.d.ts +7 -0
  62. package/dist/editors/ValueListEditor.js +60 -48
  63. package/dist/editors/body-panel.d.ts +7 -0
  64. package/dist/editors/body-panel.js +8 -0
  65. package/dist/editors/edit-session.d.ts +20 -3
  66. package/dist/editors/edit-session.js +43 -3
  67. package/dist/editors/leave-scope.d.ts +23 -0
  68. package/dist/editors/leave-scope.js +28 -0
  69. package/dist/editors/number-body.d.ts +29 -0
  70. package/dist/editors/number-body.js +37 -0
  71. package/dist/editors/parts-body.d.ts +66 -0
  72. package/dist/editors/parts-body.js +114 -0
  73. package/dist/editors/tab-ends.d.ts +5 -0
  74. package/dist/editors/tab-ends.js +7 -0
  75. package/dist/editors/text-body.d.ts +16 -0
  76. package/dist/editors/text-body.js +30 -0
  77. package/dist/editors/values-body.d.ts +47 -0
  78. package/dist/editors/values-body.js +140 -0
  79. package/dist/field-row/FieldRow.d.ts +7 -0
  80. package/dist/field-row/FieldRow.js +44 -24
  81. package/dist/field-row/FieldRowLane.js +12 -4
  82. package/dist/field-row/editors/RowChipsEditor.js +3 -1
  83. package/dist/field-row/editors/RowEditor.js +2 -1
  84. package/dist/field-row/editors/RowNameEditor.d.ts +5 -2
  85. package/dist/field-row/editors/RowNameEditor.js +12 -5
  86. package/dist/field-row/editors/RowNumberEditor.js +18 -2
  87. package/dist/field-row/editors/RowPlaceEditor.js +4 -2
  88. package/dist/field-row/editors/RowRangeEditor.d.ts +5 -2
  89. package/dist/field-row/editors/RowRangeEditor.js +13 -6
  90. package/dist/field-row/editors/RowRelationEditor.js +5 -2
  91. package/dist/field-row/editors/RowSelectEditor.js +4 -1
  92. package/dist/field-row/editors/RowTextEditor.d.ts +1 -1
  93. package/dist/field-row/editors/RowTextEditor.js +12 -3
  94. package/dist/field-row/editors/RowValueListEditor.d.ts +2 -1
  95. package/dist/field-row/editors/RowValueListEditor.js +17 -4
  96. package/dist/field-row/editors/host.d.ts +3 -0
  97. package/dist/field-row/editors/row-session.d.ts +12 -1
  98. package/dist/field-row/editors/row-session.js +52 -2
  99. package/dist/field-row/field-row-button.d.ts +40 -0
  100. package/dist/field-row/field-row-button.js +18 -0
  101. package/dist/field-row/field-row-checkbox.d.ts +9 -0
  102. package/dist/field-row/field-row-checkbox.js +7 -0
  103. package/dist/filters/filter-model.d.ts +2 -0
  104. package/dist/grid/chrome/GridAddColumn.js +17 -3
  105. package/dist/grid/chrome/GridAggregateMenu.d.ts +2 -0
  106. package/dist/grid/chrome/GridAggregateMenu.js +2 -0
  107. package/dist/grid/chrome/GridCellEditors.js +16 -6
  108. package/dist/grid/chrome/GridCellOutline.d.ts +7 -4
  109. package/dist/grid/chrome/GridCellOutline.js +4 -2
  110. package/dist/grid/chrome/GridChipsEditor.js +3 -1
  111. package/dist/grid/chrome/GridColumnMenu.d.ts +4 -1
  112. package/dist/grid/chrome/GridColumnMenu.js +5 -3
  113. package/dist/grid/chrome/GridColumnSortSection.d.ts +20 -0
  114. package/dist/grid/chrome/GridColumnSortSection.js +18 -1
  115. package/dist/grid/chrome/GridFooter.d.ts +4 -1
  116. package/dist/grid/chrome/GridFooter.js +6 -4
  117. package/dist/grid/chrome/GridGroupMenu.d.ts +5 -1
  118. package/dist/grid/chrome/GridGroupMenu.js +30 -8
  119. package/dist/grid/chrome/GridHeader.d.ts +5 -1
  120. package/dist/grid/chrome/GridHeader.js +9 -5
  121. package/dist/grid/chrome/GridLongTextEditor.js +15 -11
  122. package/dist/grid/chrome/GridNameEditor.js +4 -2
  123. package/dist/grid/chrome/GridNumberEditor.d.ts +8 -1
  124. package/dist/grid/chrome/GridNumberEditor.js +15 -3
  125. package/dist/grid/chrome/GridPager.d.ts +7 -0
  126. package/dist/grid/chrome/GridPager.js +34 -0
  127. package/dist/grid/chrome/GridPlaceEditor.js +4 -2
  128. package/dist/grid/chrome/GridRangeEditor.js +12 -4
  129. package/dist/grid/chrome/GridRelationEditor.js +5 -2
  130. package/dist/grid/chrome/GridRow.js +18 -6
  131. package/dist/grid/chrome/GridRowActions.d.ts +8 -3
  132. package/dist/grid/chrome/GridRowActions.js +16 -6
  133. package/dist/grid/chrome/GridRowCells.js +23 -7
  134. package/dist/grid/chrome/GridRowGlyph.d.ts +3 -1
  135. package/dist/grid/chrome/GridRowGlyph.js +7 -2
  136. package/dist/grid/chrome/GridSelectEditor.js +6 -3
  137. package/dist/grid/chrome/GridStructure.d.ts +6 -1
  138. package/dist/grid/chrome/GridStructure.js +32 -8
  139. package/dist/grid/chrome/GridTable.js +36 -24
  140. package/dist/grid/chrome/GridTableSurface.d.ts +5 -1
  141. package/dist/grid/chrome/GridTableSurface.js +5 -2
  142. package/dist/grid/chrome/GridTextEditor.d.ts +5 -1
  143. package/dist/grid/chrome/GridTextEditor.js +13 -3
  144. package/dist/grid/chrome/GridValueListEditor.d.ts +12 -4
  145. package/dist/grid/chrome/GridValueListEditor.js +11 -3
  146. package/dist/grid/chrome/StuckMarker.d.ts +3 -1
  147. package/dist/grid/chrome/StuckMarker.js +6 -2
  148. package/dist/grid/chrome/cells.d.ts +4 -2
  149. package/dist/grid/chrome/cells.js +2 -2
  150. package/dist/grid/chrome/grid-add-column-items.d.ts +1 -1
  151. package/dist/grid/chrome/grid-add-column-items.js +8 -1
  152. package/dist/grid/chrome/grid-button.d.ts +32 -0
  153. package/dist/grid/chrome/grid-button.js +12 -0
  154. package/dist/grid/chrome/grid-cell-classes.d.ts +38 -0
  155. package/dist/grid/chrome/grid-cell-classes.js +30 -0
  156. package/dist/grid/chrome/grid-column-menu-items.d.ts +3 -0
  157. package/dist/grid/chrome/grid-column-menu-items.js +32 -3
  158. package/dist/grid/chrome/grid-columns-template.d.ts +27 -0
  159. package/dist/grid/chrome/grid-columns-template.js +13 -0
  160. package/dist/grid/chrome/grid-edit-session.d.ts +4 -1
  161. package/dist/grid/chrome/grid-edit-session.js +11 -1
  162. package/dist/grid/chrome/grid-group-menu-items.d.ts +8 -1
  163. package/dist/grid/chrome/grid-group-menu-items.js +17 -0
  164. package/dist/grid/chrome/grid-group-menu-parts.d.ts +10 -6
  165. package/dist/grid/chrome/grid-group-menu-parts.js +4 -2
  166. package/dist/grid/chrome/grid-hover.d.ts +4 -1
  167. package/dist/grid/chrome/grid-hover.js +16 -6
  168. package/dist/grid/chrome/grid-pages.d.ts +15 -0
  169. package/dist/grid/chrome/grid-pages.js +9 -0
  170. package/dist/grid/chrome/grid-row-menu-items.js +18 -10
  171. package/dist/grid/chrome/grid-row-props.d.ts +6 -2
  172. package/dist/grid/chrome/grid-row-window.d.ts +7 -0
  173. package/dist/grid/chrome/grid-row-window.js +35 -1
  174. package/dist/grid/chrome/grid-table-props.d.ts +38 -4
  175. package/dist/grid/chrome/useGridColumnLayout.d.ts +3 -1
  176. package/dist/grid/chrome/useGridColumnLayout.js +29 -9
  177. package/dist/grid/chrome/useGridPartColumns.js +1 -1
  178. package/dist/grid/chrome/useGridScrollArea.js +2 -0
  179. package/dist/grid/chrome/useGridTableInteractionModel.d.ts +1 -0
  180. package/dist/grid/chrome/useGridTableInteractionModel.js +5 -3
  181. package/dist/grid/chrome/useGridTableSelection.d.ts +3 -1
  182. package/dist/grid/chrome/useGridTableSelection.js +2 -2
  183. package/dist/grid/chrome/useHeaderDragReorder.js +2 -0
  184. package/dist/grid/core/editing-controller.d.ts +36 -11
  185. package/dist/grid/core/editing-controller.js +92 -25
  186. package/dist/grid/core/grid-aria.d.ts +4 -0
  187. package/dist/grid/core/grid-aria.js +6 -4
  188. package/dist/grid/core/grid-focus.d.ts +6 -0
  189. package/dist/grid/core/grid-focus.js +28 -5
  190. package/dist/grid/core/useGridEditing.d.ts +11 -2
  191. package/dist/grid/core/useGridEditing.js +9 -5
  192. package/dist/grid/core/write-states.d.ts +20 -0
  193. package/dist/grid/core/write-states.js +21 -0
  194. package/dist/grid/grid-format-props.d.ts +26 -0
  195. package/dist/grid/grid-format-props.js +65 -0
  196. package/dist/grid/index.d.ts +3 -1
  197. package/dist/grid/index.js +1 -0
  198. package/dist/grid/useGridTablePrefs.d.ts +19 -20
  199. package/dist/grid/useGridTablePrefs.js +6 -58
  200. package/dist/grid/useGridTableSettings.d.ts +60 -0
  201. package/dist/grid/useGridTableSettings.js +61 -0
  202. package/dist/internal/count.d.ts +3 -0
  203. package/dist/internal/count.js +3 -0
  204. package/dist/model/body-frame.d.ts +16 -0
  205. package/dist/model/body-frame.js +5 -0
  206. package/dist/model/column-capabilities.d.ts +4 -1
  207. package/dist/model/column-capabilities.js +4 -1
  208. package/dist/model/column-filters.d.ts +7 -4
  209. package/dist/model/column-filters.js +26 -18
  210. package/dist/model/column-inspect.d.ts +3 -2
  211. package/dist/model/column-inspect.js +3 -1
  212. package/dist/model/column-sort.d.ts +11 -0
  213. package/dist/model/column-sort.js +14 -0
  214. package/dist/model/one-value.d.ts +6 -0
  215. package/dist/model/one-value.js +5 -0
  216. package/dist/model/part-write.js +1 -1
  217. package/dist/model/place-parts.d.ts +6 -0
  218. package/dist/model/place-parts.js +14 -0
  219. package/dist/model/relation-filters.d.ts +13 -2
  220. package/dist/model/relation-filters.js +9 -4
  221. package/dist/model/row-icon.d.ts +16 -6
  222. package/dist/model/settings-columns.d.ts +34 -0
  223. package/dist/model/settings-columns.js +146 -0
  224. package/dist/model/settings-look.d.ts +17 -0
  225. package/dist/model/settings-look.js +23 -0
  226. package/dist/model/view-rules.js +6 -2
  227. package/dist/panels/availability.d.ts +26 -0
  228. package/dist/panels/availability.js +28 -0
  229. package/dist/panels/filter/DateFilterBody.d.ts +42 -0
  230. package/dist/panels/filter/DateFilterBody.js +64 -0
  231. package/dist/panels/filter/DateFilterCalendar.d.ts +19 -0
  232. package/dist/panels/filter/DateFilterCalendar.js +37 -0
  233. package/dist/panels/filter/DateFilterInput.d.ts +16 -0
  234. package/dist/panels/filter/DateFilterInput.js +37 -0
  235. package/dist/panels/filter/FilterIcon.d.ts +7 -0
  236. package/dist/panels/filter/FilterIcon.js +15 -0
  237. package/dist/panels/filter/MenuSelect.d.ts +12 -0
  238. package/dist/panels/filter/MenuSelect.js +34 -0
  239. package/dist/panels/filter/NumberFilterBody.d.ts +21 -0
  240. package/dist/panels/filter/NumberFilterBody.js +76 -0
  241. package/dist/panels/filter/RangeFilterBody.d.ts +19 -0
  242. package/dist/panels/filter/RangeFilterBody.js +71 -0
  243. package/dist/panels/filter/RelationFilterBody.d.ts +17 -0
  244. package/dist/panels/filter/RelationFilterBody.js +20 -0
  245. package/dist/panels/filter/TextFilterBody.d.ts +31 -0
  246. package/dist/panels/filter/TextFilterBody.js +44 -0
  247. package/dist/panels/filter/TimeScopeDetail.d.ts +6 -0
  248. package/dist/panels/filter/TimeScopeDetail.js +47 -0
  249. package/dist/panels/filter/details.d.ts +17 -0
  250. package/dist/panels/filter/details.js +73 -0
  251. package/dist/panels/filter/filter-list.d.ts +23 -0
  252. package/dist/panels/filter/filter-list.js +38 -0
  253. package/dist/panels/group-sort.d.ts +24 -0
  254. package/dist/panels/group-sort.js +58 -0
  255. package/dist/panels/index.d.ts +24 -0
  256. package/dist/panels/index.js +17 -0
  257. package/dist/panels/labels.d.ts +37 -0
  258. package/dist/panels/labels.js +166 -0
  259. package/dist/panels/model.d.ts +343 -0
  260. package/dist/panels/model.js +77 -0
  261. package/dist/panels/react/GroupBucketsList.d.ts +16 -0
  262. package/dist/panels/react/GroupBucketsList.js +38 -0
  263. package/dist/panels/react/LayoutColumnsList.d.ts +24 -0
  264. package/dist/panels/react/LayoutColumnsList.js +71 -0
  265. package/dist/panels/react/PopoverColumnDetail.d.ts +11 -0
  266. package/dist/panels/react/PopoverColumnDetail.js +24 -0
  267. package/dist/panels/react/chrome.d.ts +17 -0
  268. package/dist/panels/react/chrome.js +8 -0
  269. package/dist/panels/react/column-refusals.d.ts +7 -0
  270. package/dist/panels/react/column-refusals.js +14 -0
  271. package/dist/panels/react/customize.d.ts +26 -0
  272. package/dist/panels/react/customize.js +98 -0
  273. package/dist/panels/react/drag.d.ts +2 -0
  274. package/dist/panels/react/drag.js +6 -0
  275. package/dist/panels/react/field-editor.d.ts +10 -0
  276. package/dist/panels/react/field-editor.js +1 -0
  277. package/dist/panels/react/filter-panel.d.ts +15 -0
  278. package/dist/panels/react/filter-panel.js +48 -0
  279. package/dist/panels/react/layout-detail.d.ts +4 -0
  280. package/dist/panels/react/layout-detail.js +21 -0
  281. package/dist/panels/react/order-details.d.ts +32 -0
  282. package/dist/panels/react/order-details.js +81 -0
  283. package/dist/panels/react/panel-header.d.ts +10 -0
  284. package/dist/panels/react/panel-header.js +12 -0
  285. package/dist/panels/react/panel-sheet.d.ts +19 -0
  286. package/dist/panels/react/panel-sheet.js +22 -0
  287. package/dist/panels/react/popover.d.ts +71 -0
  288. package/dist/panels/react/popover.js +47 -0
  289. package/dist/panels/react/root-list.d.ts +6 -0
  290. package/dist/panels/react/root-list.js +31 -0
  291. package/dist/panels/react/toolbar/ReadyToolbar.d.ts +42 -0
  292. package/dist/panels/react/toolbar/ReadyToolbar.js +92 -0
  293. package/dist/panels/react/toolbar/Toolbar.d.ts +16 -0
  294. package/dist/panels/react/toolbar/Toolbar.js +34 -0
  295. package/dist/panels/react/toolbar/ToolbarButton.d.ts +5 -0
  296. package/dist/panels/react/toolbar/ToolbarButton.js +9 -0
  297. package/dist/panels/react/toolbar/ToolbarFilter.d.ts +19 -0
  298. package/dist/panels/react/toolbar/ToolbarFilter.js +32 -0
  299. package/dist/panels/react/toolbar/ToolbarNew.d.ts +12 -0
  300. package/dist/panels/react/toolbar/ToolbarNew.js +21 -0
  301. package/dist/panels/react/toolbar/ToolbarOptions.d.ts +25 -0
  302. package/dist/panels/react/toolbar/ToolbarOptions.js +33 -0
  303. package/dist/panels/react/toolbar/ToolbarSearch.d.ts +9 -0
  304. package/dist/panels/react/toolbar/ToolbarSearch.js +41 -0
  305. package/dist/panels/react/toolbar/ToolbarSort.d.ts +12 -0
  306. package/dist/panels/react/toolbar/ToolbarSort.js +16 -0
  307. package/dist/panels/react/toolbar/ToolbarViews.d.ts +13 -0
  308. package/dist/panels/react/toolbar/ToolbarViews.js +24 -0
  309. package/dist/panels/react/toolbar/context.d.ts +29 -0
  310. package/dist/panels/react/toolbar/context.js +49 -0
  311. package/dist/panels/react/toolbar/panel-part.d.ts +37 -0
  312. package/dist/panels/react/toolbar/panel-part.js +37 -0
  313. package/dist/panels/react/toolbar/panel-state.d.ts +9 -0
  314. package/dist/panels/react/toolbar/panel-state.js +12 -0
  315. package/dist/panels/react/toolbar/use-box-narrow.d.ts +2 -0
  316. package/dist/panels/react/toolbar/use-box-narrow.js +18 -0
  317. package/dist/panels/react/toolbar/use-list-settings-state.d.ts +10 -0
  318. package/dist/panels/react/toolbar/use-list-settings-state.js +10 -0
  319. package/dist/panels/react/view-actions.d.ts +4 -0
  320. package/dist/panels/react/view-actions.js +37 -0
  321. package/dist/panels/react/view-footer.d.ts +16 -0
  322. package/dist/panels/react/view-footer.js +11 -0
  323. package/dist/panels/react/views-row/FoldingViewRow.d.ts +4 -0
  324. package/dist/panels/react/views-row/FoldingViewRow.js +105 -0
  325. package/dist/panels/react/views-row/HScrollRow.d.ts +7 -0
  326. package/dist/panels/react/views-row/HScrollRow.js +42 -0
  327. package/dist/panels/react/views-row/PillGroup.d.ts +30 -0
  328. package/dist/panels/react/views-row/PillGroup.js +86 -0
  329. package/dist/panels/react/views-row/ViewAxes.d.ts +6 -0
  330. package/dist/panels/react/views-row/ViewAxes.js +16 -0
  331. package/dist/panels/react/views-row/ViewCreatePill.d.ts +7 -0
  332. package/dist/panels/react/views-row/ViewCreatePill.js +11 -0
  333. package/dist/panels/react/views-row/ViewPicker.d.ts +5 -0
  334. package/dist/panels/react/views-row/ViewPicker.js +65 -0
  335. package/dist/panels/react/views-row/ViewPickerRow.d.ts +7 -0
  336. package/dist/panels/react/views-row/ViewPickerRow.js +18 -0
  337. package/dist/panels/react/views-row/ViewTabs.d.ts +31 -0
  338. package/dist/panels/react/views-row/ViewTabs.js +29 -0
  339. package/dist/panels/react/views-row/menu-classes.d.ts +6 -0
  340. package/dist/panels/react/views-row/menu-classes.js +3 -0
  341. package/dist/panels/react/views-row/use-anchored-toggle.d.ts +19 -0
  342. package/dist/panels/react/views-row/use-anchored-toggle.js +31 -0
  343. package/dist/panels/react.d.ts +51 -0
  344. package/dist/panels/react.js +43 -0
  345. package/dist/panels/settings/axes.d.ts +28 -0
  346. package/dist/panels/settings/axes.js +71 -0
  347. package/dist/panels/settings/filters.d.ts +5 -0
  348. package/dist/panels/settings/filters.js +62 -0
  349. package/dist/panels/settings/group-buckets.d.ts +23 -0
  350. package/dist/panels/settings/group-buckets.js +73 -0
  351. package/dist/panels/settings/input.d.ts +69 -0
  352. package/dist/panels/settings/input.js +1 -0
  353. package/dist/panels/settings/layout.d.ts +5 -0
  354. package/dist/panels/settings/layout.js +244 -0
  355. package/dist/panels/settings/order.d.ts +19 -0
  356. package/dist/panels/settings/order.js +271 -0
  357. package/dist/panels/settings/settings-panels.d.ts +17 -0
  358. package/dist/panels/settings/settings-panels.js +28 -0
  359. package/dist/panels/toolbar/clear.d.ts +9 -0
  360. package/dist/panels/toolbar/clear.js +26 -0
  361. package/dist/panels/toolbar/counts.d.ts +15 -0
  362. package/dist/panels/toolbar/counts.js +21 -0
  363. package/dist/panels/toolbar/edit-view.d.ts +5 -0
  364. package/dist/panels/toolbar/edit-view.js +18 -0
  365. package/dist/panels/toolbar/model.d.ts +34 -0
  366. package/dist/panels/toolbar/model.js +52 -0
  367. package/dist/panels/use-filter-opened.d.ts +8 -0
  368. package/dist/panels/use-filter-opened.js +11 -0
  369. package/dist/panels/view-state.d.ts +38 -0
  370. package/dist/panels/view-state.js +1 -0
  371. package/dist/panels/views-row/model.d.ts +131 -0
  372. package/dist/panels/views-row/model.js +14 -0
  373. package/dist/provider/ViewsProvider.d.ts +46 -6
  374. package/dist/provider/ViewsProvider.js +32 -2
  375. package/dist/provider/components.d.ts +258 -11
  376. package/dist/provider/context.d.ts +21 -2
  377. package/dist/react.d.ts +5 -2
  378. package/dist/selection/SelectionBar.js +13 -7
  379. package/dist/selection/bar-overflow.js +14 -1
  380. package/dist/selection/bar-parts.d.ts +4 -2
  381. package/dist/selection/bar-parts.js +5 -3
  382. package/dist/selection/useListSelectionShortcuts.d.ts +3 -2
  383. package/dist/selection/useListSelectionShortcuts.js +1 -1
  384. package/dist/selection/verbs.d.ts +7 -0
  385. package/docs/contract.md +307 -41
  386. package/docs/getting-started.md +1 -1
  387. package/docs/guides/atoms.md +37 -5
  388. package/docs/guides/columns.md +1 -1
  389. package/docs/guides/display.md +3 -2
  390. package/docs/guides/editors.md +4 -3
  391. package/docs/guides/selection.md +4 -2
  392. package/docs/guides/the-grid.md +21 -11
  393. package/docs/guides/the-provider.md +22 -6
  394. package/docs/index.md +2 -2
  395. package/docs/install.md +2 -3
  396. package/docs/reference/cells.md +1 -1
  397. package/docs/reference/display.md +5 -4
  398. package/docs/reference/editors-location.md +3 -1
  399. package/docs/reference/editors-name.md +3 -1
  400. package/docs/reference/editors-number.md +1 -0
  401. package/docs/reference/editors-range.md +3 -1
  402. package/docs/reference/editors-session.md +1 -0
  403. package/docs/reference/editors-text.md +2 -2
  404. package/docs/reference/editors-value-list.md +1 -1
  405. package/docs/reference/field-row.md +2 -2
  406. package/docs/reference/grid.md +8 -5
  407. package/docs/reference/panels-react.md +101 -0
  408. package/docs/reference/panels.md +123 -0
  409. package/docs/reference/react.md +39 -16
  410. package/docs/reference/selection.md +5 -5
  411. package/docs/reference/views.md +17 -12
  412. package/package.json +16 -6
  413. package/skills/views/SKILL.md +4 -3
@@ -0,0 +1,41 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useRef, useState } from "react";
4
+ import { cx } from "../../../internal/cx.js";
5
+ import { LoadingRing } from "../../../atoms/Loading.js";
6
+ import { ELEMENT_RESET } from "../../../internal/reset.js";
7
+ import { useViews } from "../../../provider/context.js";
8
+ import { useToolbarSlot } from "./context.js";
9
+ import { ToolbarButton } from "./ToolbarButton.js";
10
+ export function ToolbarSearch({ value, onChange, placeholder, searching = false, }) {
11
+ const { components, icons, messages } = useViews();
12
+ const { Input } = components;
13
+ const Glass = icons.search;
14
+ const Close = icons.close;
15
+ const slot = useToolbarSlot();
16
+ const name = messages({ key: "views.panels.search" });
17
+ const busy = messages({ key: "views.panels.searching" });
18
+ const [opened, setOpened] = useState(false);
19
+ const field = useRef(null);
20
+ const shown = slot.fill || opened || value !== "";
21
+ useEffect(() => {
22
+ if (opened && !slot.fill)
23
+ field.current?.focus({ preventScroll: true });
24
+ }, [opened, slot.fill]);
25
+ const clear = () => {
26
+ onChange("");
27
+ setOpened(false);
28
+ };
29
+ if (!shown) {
30
+ return (_jsx("div", { "data-slot": "vk-toolbar-search", className: "relative flex flex-none items-center", children: _jsx(ToolbarButton, { icon: searching ? _jsx(LoadingRing, { label: busy, slot: "vk-toolbar-search-spinner", className: "h-4 w-4" }) : _jsx(Glass, { className: "h-4 w-4 shrink-0" }), label: name, word: null, onClick: () => setOpened(true) }) }));
31
+ }
32
+ return (_jsxs("div", { "data-slot": "vk-toolbar-search", "data-expanded": "", className: cx("relative flex min-w-0 items-center", slot.fill || slot.form === "phone" ? "flex-1" : "w-72 transition-[width] duration-150 ease-out"), children: [searching ? (_jsx(LoadingRing, { label: busy, slot: "vk-toolbar-search-spinner", className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2" })) : (_jsx(Glass, { className: "pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-(color:--vk-fg-subtle)" })), _jsx(Input, { ref: field, type: "search", chrome: "bare", "data-slot": "vk-toolbar-search-field", "aria-label": name, "aria-busy": searching || undefined, value: value, placeholder: placeholder ?? name, onChange: (event) => onChange(event.target.value), onBlur: () => {
33
+ if (value === "")
34
+ setOpened(false);
35
+ }, onKeyDown: (event) => {
36
+ if (event.key !== "Escape")
37
+ return;
38
+ event.preventDefault();
39
+ clear();
40
+ }, className: cx("h-9 w-full min-w-0 rounded-full bg-transparent pl-9 text-base md:text-sm outline-none", value !== "" ? "pr-9" : "pr-3", "[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none") }), value !== "" && (_jsx("button", { type: "button", "data-slot": "vk-toolbar-search-clear", "aria-label": messages({ key: "views.panels.search-clear" }), onMouseDown: (event) => event.preventDefault(), onClick: clear, className: cx(ELEMENT_RESET, "absolute right-1.5 top-1/2 inline-flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded-full text-(color:--vk-fg-subtlest) transition-colors hover:bg-(color:--vk-hovered) hover:text-(color:--vk-fg)"), children: _jsx(Close, { className: "h-3 w-3" }) }))] }));
41
+ }
@@ -0,0 +1,12 @@
1
+ import type { ReactNode } from "react";
2
+ import { type SortConfig } from "../../model.js";
3
+ import { type ToolbarPanelHost } from "./panel-part.js";
4
+ export declare function ToolbarSort({ sort, open, onOpenChange, host, }: {
5
+ /** The builder's Sort: `settingsPanels(…).sort`. */
6
+ sort: SortConfig<string>;
7
+ /** Its open state, when the app holds it; absent, its own. */
8
+ open?: boolean;
9
+ onOpenChange?: (open: boolean) => void;
10
+ /** The app's drawer or sheet; absent, the map's `Popover` (on a phone, its `Sheet`). */
11
+ host?: ToolbarPanelHost;
12
+ }): ReactNode;
@@ -0,0 +1,16 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useViews } from "../../../provider/context.js";
4
+ import { isSortActive } from "../../model.js";
5
+ import { viewOptionsPopoverClassName } from "../popover.js";
6
+ import { CompactSortDetail } from "../order-details.js";
7
+ import { PanelHeader } from "../panel-header.js";
8
+ import { ToolbarPanelPart } from "./panel-part.js";
9
+ export function ToolbarSort({ sort, open, onOpenChange, host, }) {
10
+ const { icons, messages } = useViews();
11
+ const Glyph = icons.sort;
12
+ if (sort.options.length === 0)
13
+ return null;
14
+ const name = messages({ key: "views.panels.sort" });
15
+ return (_jsx(ToolbarPanelPart, { panelKey: "sort", slot: "vk-toolbar-sort", icon: _jsx(Glyph, { className: "h-4 w-4 shrink-0" }), label: name, word: name, changed: isSortActive(sort), open: open, onOpenChange: onOpenChange, host: host, popoverClassName: viewOptionsPopoverClassName(null), children: ({ fill, close, closeButton }) => (_jsxs("div", { className: fill ? "flex h-full min-h-0 flex-col" : "flex flex-col", children: [_jsx(PanelHeader, { title: sort.label ?? name, onClose: closeButton ? close : undefined }), _jsx("div", { className: fill ? "min-h-0 flex-1 overflow-y-auto overscroll-contain **:data-vs-detail:max-h-none" : undefined, children: _jsx(CompactSortDetail, { sort: sort }) })] })) }));
16
+ }
@@ -0,0 +1,13 @@
1
+ import type { ReactNode } from "react";
2
+ import { type CollectionViewsInput, type ViewsLayout } from "../../views-row/model.js";
3
+ export declare function ToolbarViews({ views, viewsLayout, showCounts, as, stacked, }: {
4
+ views: CollectionViewsInput<string>;
5
+ /** How several axes stand: `stacked` (the default) puts every axis after the first on the line beneath. */
6
+ viewsLayout?: ViewsLayout;
7
+ /** The toolbar's own Show counts; absent, each axis's own `hideCounts` alone decides. */
8
+ showCounts?: boolean;
9
+ /** One axis as its pills or as one chip naming the active view. Several axes always draw as a row. */
10
+ as?: "row" | "picker";
11
+ /** This part is the second line's: the axes a stacked layout pushes beneath. */
12
+ stacked?: boolean;
13
+ }): ReactNode;
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { withCounts } from "../../toolbar/counts.js";
4
+ import { splitViewAxes, toViewAxes } from "../../views-row/model.js";
5
+ import { ViewAxes } from "../views-row/ViewAxes.js";
6
+ import { ViewPicker } from "../views-row/ViewPicker.js";
7
+ import { useToolbarSlot } from "./context.js";
8
+ export function ToolbarViews({ views, viewsLayout, showCounts, as = "row", stacked = false, }) {
9
+ const { form } = useToolbarSlot();
10
+ const counted = showCounts === undefined ? views : (withCounts(views, showCounts) ?? views);
11
+ if (form === "phone") {
12
+ if (stacked)
13
+ return null;
14
+ return toViewAxes(counted)?.map((axis, i) => _jsx(ViewPicker, { axis: axis, className: "min-w-0" }, axis.key ?? i)) ?? null;
15
+ }
16
+ const { viewAxes, stackedAxes } = splitViewAxes(counted, viewsLayout);
17
+ if (stacked)
18
+ return stackedAxes ? _jsx(ViewAxes, { axes: stackedAxes, size: "sm" }) : null;
19
+ if (!viewAxes)
20
+ return null;
21
+ if (as === "picker" && viewAxes.length === 1 && !stackedAxes)
22
+ return _jsx(ViewPicker, { axis: viewAxes[0] });
23
+ return _jsx(ViewAxes, { axes: viewAxes });
24
+ }
@@ -0,0 +1,29 @@
1
+ import type { ToolbarForm, ToolbarLine } from "../../toolbar/model.js";
2
+ /** Where a part stands: the toolbar's form, whether it fills its line, its buttons' size, and its line's kind. */
3
+ export type ToolbarSlotState = {
4
+ form: ToolbarForm;
5
+ fill: boolean;
6
+ size: "md" | "sm";
7
+ line: ToolbarLine["kind"];
8
+ };
9
+ export declare const ToolbarSlotContext: import("react").Context<ToolbarSlotState>;
10
+ /** Where this part stands; outside a `Toolbar`, `{ form: "row", fill: false, size: "md", line: "main" }`. */
11
+ export declare function useToolbarSlot(): ToolbarSlotState;
12
+ /** The radio: each registered panel's closer, by its key. */
13
+ export type ToolbarRadio = {
14
+ register: (key: string, close: () => void) => () => void;
15
+ opened: (key: string) => void;
16
+ };
17
+ /** A fresh radio, held by the frame for its life. */
18
+ export declare function useToolbarRadioState(): ToolbarRadio;
19
+ export declare const ToolbarRadioContext: import("react").Context<ToolbarRadio | null>;
20
+ /** A part's open state, one of the toolbar's panels: when it opens, the toolbar closes every other. Handed
21
+ * `own`, it reads and changes that state (a panel the app holds, which may open itself); without, it holds its
22
+ * own. Outside a `Toolbar`, it is plain open state. */
23
+ export declare function useToolbarPanel(key: string, own?: {
24
+ open: boolean;
25
+ onOpenChange: (open: boolean) => void;
26
+ }): {
27
+ open: boolean;
28
+ onOpenChange: (open: boolean) => void;
29
+ };
@@ -0,0 +1,49 @@
1
+ "use client";
2
+ import { createContext, useCallback, useContext, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
3
+ const OUTSIDE = { form: "row", fill: false, size: "md", line: "main" };
4
+ export const ToolbarSlotContext = createContext(OUTSIDE);
5
+ export function useToolbarSlot() {
6
+ return useContext(ToolbarSlotContext);
7
+ }
8
+ export function useToolbarRadioState() {
9
+ const closers = useRef(new Map());
10
+ const register = useCallback((key, close) => {
11
+ closers.current.set(key, close);
12
+ return () => {
13
+ if (closers.current.get(key) === close)
14
+ closers.current.delete(key);
15
+ };
16
+ }, []);
17
+ const opened = useCallback((key) => {
18
+ for (const [other, close] of closers.current)
19
+ if (other !== key)
20
+ close();
21
+ }, []);
22
+ const [radio] = useState(() => ({ register, opened }));
23
+ return radio;
24
+ }
25
+ export const ToolbarRadioContext = createContext(null);
26
+ export function useToolbarPanel(key, own) {
27
+ const radio = useContext(ToolbarRadioContext);
28
+ const entry = `${key}:${useId()}`;
29
+ const [held, setHeld] = useState(false);
30
+ const open = own ? own.open : held;
31
+ const onOpenChange = own ? own.onOpenChange : setHeld;
32
+ const latest = useRef({ open, onOpenChange });
33
+ useLayoutEffect(() => {
34
+ latest.current = { open, onOpenChange };
35
+ });
36
+ useEffect(() => {
37
+ if (!radio)
38
+ return;
39
+ return radio.register(entry, () => {
40
+ if (latest.current.open)
41
+ latest.current.onOpenChange(false);
42
+ });
43
+ }, [radio, entry]);
44
+ useEffect(() => {
45
+ if (open)
46
+ radio?.opened(entry);
47
+ }, [open, radio, entry]);
48
+ return { open, onOpenChange };
49
+ }
@@ -0,0 +1,37 @@
1
+ import { type ComponentType, type ReactNode } from "react";
2
+ /** Where a panel part hangs its panel instead of the map's `Popover`: the app's drawer, or its sheet on a phone.
3
+ * The panel draws full height inside it (`fill`). */
4
+ export type ToolbarPanelHost = ComponentType<{
5
+ open: boolean;
6
+ onOpenChange: (open: boolean) => void;
7
+ /** The panel's name in words: the button's label. */
8
+ title: string;
9
+ children: ReactNode;
10
+ }>;
11
+ export declare function ToolbarPanelPart({ panelKey, slot, icon, label, word, count, onClear, dot, changed, open: openIn, onOpenChange: onOpenChangeIn, host: Host, popoverClassName, children, }: {
12
+ /** The radio's name for it. */
13
+ panelKey: string;
14
+ /** Its place's `data-slot`; the popover, or the panel's box in a sheet, is marked `${slot}-panel`. */
15
+ slot: string;
16
+ icon: ReactNode;
17
+ label: string;
18
+ word?: string | null;
19
+ count?: number;
20
+ onClear?: () => void;
21
+ dot?: boolean;
22
+ changed?: boolean;
23
+ open?: boolean;
24
+ onOpenChange?: (open: boolean) => void;
25
+ host?: ToolbarPanelHost;
26
+ popoverClassName?: string;
27
+ /** The panel. `close` dismisses it (its ✕, a column's Done); `closeButton` is false in a sheet whose head draws the
28
+ * ✕ (`sheetActions: "head"`), where the panel draws none of its own. */
29
+ children: (args: PanelArgs) => ReactNode;
30
+ }): ReactNode;
31
+ /** What a panel part hands its panel: whether it fills a host or a sheet, its dismissal, and whether it draws its ✕. */
32
+ type PanelArgs = {
33
+ fill: boolean;
34
+ close: () => void;
35
+ closeButton: boolean;
36
+ };
37
+ export {};
@@ -0,0 +1,37 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useRef } from "react";
4
+ import { useViews } from "../../../provider/context.js";
5
+ import { PanelSheet, useSheetDrawsClose, useSheetPanels } from "../panel-sheet.js";
6
+ import { useToolbarPanel } from "./context.js";
7
+ import { ToolbarButton } from "./ToolbarButton.js";
8
+ export function ToolbarPanelPart({ panelKey, slot, icon, label, word, count, onClear, dot, changed, open: openIn, onOpenChange: onOpenChangeIn, host: Host, popoverClassName, children, }) {
9
+ const { components } = useViews();
10
+ const sheet = useSheetPanels();
11
+ const headCloses = useSheetDrawsClose();
12
+ const { Popover } = components;
13
+ const anchor = useRef(null);
14
+ const held = useToolbarPanel(panelKey, openIn === undefined || !onOpenChangeIn ? undefined : { open: openIn, onOpenChange: onOpenChangeIn });
15
+ const { open, onOpenChange } = held;
16
+ const openAtPress = useRef(false);
17
+ const close = () => {
18
+ onOpenChange(false);
19
+ if (!Host && !sheet)
20
+ anchor.current?.focus({ preventScroll: true });
21
+ };
22
+ return (_jsxs("span", { "data-slot": slot, className: "relative inline-flex shrink-0", children: [_jsx(ToolbarButton, { ref: anchor, icon: icon, label: label, word: word, count: count, onClear: onClear, dot: dot, changed: changed, popup: "dialog", open: open, onPointerDown: () => {
23
+ openAtPress.current = open;
24
+ }, onClick: (event) => {
25
+ const wasOpen = Host || sheet ? open : event.detail === 0 ? open : openAtPress.current;
26
+ openAtPress.current = false;
27
+ onOpenChange(!wasOpen);
28
+ } }), Host ? (_jsx(Host, { open: open, onOpenChange: onOpenChange, title: label, children: _jsx(PanelBody, { render: children, args: { fill: true, close, closeButton: true } }) })) : sheet ? (_jsx(PanelSheet, { open: open, onOpenChange: onOpenChange, title: label, snap: "full", slot: `${slot}-panel`, headed: true, children: _jsx(PanelBody, { render: children, args: { fill: true, close, closeButton: !headCloses } }) })) : (_jsx(Popover, { open: open, onOpenChange: (next, details) => {
29
+ onOpenChange(next);
30
+ const reason = details?.reason;
31
+ if (!next && reason !== "outside-press" && reason !== "focus-out")
32
+ anchor.current?.focus({ preventScroll: true });
33
+ }, anchor: anchor, align: "end", sideOffset: 8, chrome: "menu", className: popoverClassName, panelData: { "data-slot": `${slot}-panel` }, children: _jsx(PanelBody, { render: children, args: { fill: false, close, closeButton: true } }) }))] }));
34
+ }
35
+ function PanelBody({ render, args }) {
36
+ return render(args);
37
+ }
@@ -0,0 +1,9 @@
1
+ import type { ActivePanel } from "../../model.js";
2
+ /** A panel part's state: open, and the page a drill-in is on (`null`, its root). Closing forgets the page. */
3
+ export type ToolbarPanelState = {
4
+ open: boolean;
5
+ onOpenChange: (open: boolean) => void;
6
+ page: ActivePanel;
7
+ onPageChange: (page: ActivePanel) => void;
8
+ };
9
+ export declare function useToolbarPanelState(): ToolbarPanelState;
@@ -0,0 +1,12 @@
1
+ "use client";
2
+ import { useCallback, useMemo, useState } from "react";
3
+ export function useToolbarPanelState() {
4
+ const [open, setOpen] = useState(false);
5
+ const [page, setPage] = useState(null);
6
+ const onOpenChange = useCallback((next) => {
7
+ if (!next)
8
+ setPage(null);
9
+ setOpen(next);
10
+ }, []);
11
+ return useMemo(() => ({ open, onOpenChange, page, onPageChange: setPage }), [open, onOpenChange, page]);
12
+ }
@@ -0,0 +1,2 @@
1
+ import { type RefObject } from "react";
2
+ export declare function useBoxNarrow(ref: RefObject<HTMLElement | null>, below: number): boolean | null;
@@ -0,0 +1,18 @@
1
+ "use client";
2
+ import { useLayoutEffect, useState } from "react";
3
+ export function useBoxNarrow(ref, below) {
4
+ const [narrow, setNarrow] = useState(null);
5
+ useLayoutEffect(() => {
6
+ const box = ref.current;
7
+ if (!box)
8
+ return;
9
+ const measure = () => setNarrow(box.getBoundingClientRect().width < below);
10
+ measure();
11
+ if (typeof ResizeObserver === "undefined")
12
+ return;
13
+ const observer = new ResizeObserver(measure);
14
+ observer.observe(box);
15
+ return () => observer.disconnect();
16
+ }, [ref, below]);
17
+ return narrow;
18
+ }
@@ -0,0 +1,10 @@
1
+ import { type ListPersonalLayer, type ListSettings, type ListSettingsChange } from "@viewkitjs/fields/query";
2
+ export declare function useListSettingsState(initial: {
3
+ settings: ListSettings;
4
+ layer?: ListPersonalLayer;
5
+ }): {
6
+ settings: ListSettings;
7
+ layer: ListPersonalLayer;
8
+ onChange: (change: ListSettingsChange) => void;
9
+ onLayerChange: (patch: ListPersonalLayer) => void;
10
+ };
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ import { applySettingsChange, } from "@viewkitjs/fields/query";
3
+ import { useCallback, useState } from "react";
4
+ export function useListSettingsState(initial) {
5
+ const [settings, setSettings] = useState(initial.settings);
6
+ const [layer, setLayer] = useState(initial.layer ?? {});
7
+ const onChange = useCallback((change) => setSettings((held) => applySettingsChange(held, change)), []);
8
+ const onLayerChange = useCallback((patch) => setLayer((held) => ({ ...held, ...patch })), []);
9
+ return { settings, layer, onChange, onLayerChange };
10
+ }
@@ -0,0 +1,4 @@
1
+ import type { CollectionExportCsv } from "../view-state.js";
2
+ export declare function ViewOptionsActions({ exportCsv }: {
3
+ exportCsv?: CollectionExportCsv;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,37 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useState } from "react";
4
+ import { cx } from "../../internal/cx.js";
5
+ import { ELEMENT_RESET } from "../../internal/reset.js";
6
+ import { useViews } from "../../provider/context.js";
7
+ import { formatCount } from "../../internal/count.js";
8
+ const ACTION_ROW_CLASS = "flex w-full items-center gap-2.5 px-3 py-2 text-left";
9
+ const ACTION_ICON_CLASS = "flex h-4 w-4 shrink-0 items-center justify-center text-(color:--vk-fg-subtle)";
10
+ const ACTION_LABEL_CLASS = "flex-1 whitespace-nowrap text-sm font-medium text-(color:--vk-fg)";
11
+ const GLYPH = "h-3.5 w-3.5";
12
+ export function ViewOptionsActions({ exportCsv }) {
13
+ const { icons, messages } = useViews();
14
+ const { copyLink: CopyLink, export: Export, share: Share } = icons;
15
+ return (_jsxs("div", { className: "shrink-0 border-t border-solid border-(color:--vk-border) py-1", children: [_jsx(ParkedActionRow, { icon: _jsx(CopyLink, { className: GLYPH }), label: messages({ key: "views.panels.copy-link" }) }), exportCsv ? (_jsx(ExportCsvRow, { exportCsv: exportCsv })) : (_jsx(ParkedActionRow, { icon: _jsx(Export, { className: GLYPH }), label: messages({ key: "views.panels.export-csv" }) })), _jsx(ParkedActionRow, { icon: _jsx(Share, { className: GLYPH }), label: messages({ key: "views.panels.share" }) })] }));
16
+ }
17
+ function ExportCsvRow({ exportCsv }) {
18
+ const { conventions, icons, messages } = useViews();
19
+ const { export: Export, loading: Loading } = icons;
20
+ const [running, setRunning] = useState(false);
21
+ const onClick = async () => {
22
+ if (running)
23
+ return;
24
+ setRunning(true);
25
+ try {
26
+ await exportCsv.run();
27
+ }
28
+ finally {
29
+ setRunning(false);
30
+ }
31
+ };
32
+ return (_jsxs("button", { type: "button", "data-vs-row": true, onClick: onClick, disabled: running, className: cx(ELEMENT_RESET, ACTION_ROW_CLASS, "hover:bg-(color:--vk-hovered) disabled:pointer-events-none"), children: [_jsx("span", { className: ACTION_ICON_CLASS, children: running ? (_jsx("span", { role: "status", "aria-label": messages({ key: "views.panels.loading" }), className: "flex", children: _jsx(Loading, { className: "size-3.5" }) })) : (_jsx(Export, { className: GLYPH })) }), _jsx("span", { className: ACTION_LABEL_CLASS, children: messages({ key: "views.panels.export-csv" }) }), _jsx("span", { className: "shrink-0 text-xs tabular-nums text-(color:--vk-fg-subtle)", children: formatCount(exportCsv.count, conventions) })] }));
33
+ }
34
+ function ParkedActionRow({ icon, label }) {
35
+ const { messages } = useViews();
36
+ return (_jsxs("div", { "aria-disabled": true, "data-vs-row": true, title: messages({ key: "views.panels.coming-soon" }), className: cx(ACTION_ROW_CLASS, "cursor-default select-none opacity-40"), children: [_jsx("span", { className: ACTION_ICON_CLASS, children: icon }), _jsx("span", { className: ACTION_LABEL_CLASS, children: label })] }));
37
+ }
@@ -0,0 +1,16 @@
1
+ import type { CollectionViewState } from "../view-state.js";
2
+ /**
3
+ * Linear's footer, one for one: their "Set default for everyone" sits under the display options, and nothing
4
+ * anywhere else says "unsaved".
5
+ *
6
+ * Drawn only while `changes` is above zero: a panel over a view that matches everyone's has nothing to reset
7
+ * and nothing to publish, and an always-on footer would be the persistent prompt this replaces. A member sees
8
+ * Reset alone: a control that cannot be pressed teaches nothing, so the missing verb is simply not there.
9
+ *
10
+ * `className` replaces the footer's side inset (`px-3`, the rows' own), so a host with wider rows (a phone
11
+ * sheet's `px-4`) lines it up with them.
12
+ */
13
+ export declare function ViewFooter({ view, className }: {
14
+ view: CollectionViewState;
15
+ className?: string;
16
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,11 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { cx } from "../../internal/cx.js";
4
+ import { ELEMENT_RESET } from "../../internal/reset.js";
5
+ import { useViews } from "../../provider/context.js";
6
+ export function ViewFooter({ view, className }) {
7
+ const { messages } = useViews();
8
+ if (view.changes === 0)
9
+ return null;
10
+ return (_jsx("div", { "data-vs-footer": true, "data-vs-inset": true, className: cx(className ?? "px-3", "py-2"), children: _jsxs("div", { className: "flex min-w-0 flex-col items-start gap-1", children: [view.stale && (_jsx("p", { className: "m-0 text-xs text-(color:--vk-fg-subtle)", children: messages({ key: "views.panels.view-stale" }) })), _jsxs("div", { className: "flex items-center gap-4", children: [view.canPublish && (_jsx("button", { type: "button", disabled: view.pending, onClick: view.onPublish, className: cx(ELEMENT_RESET, "text-sm font-medium text-(color:--vk-fg-brand) transition-opacity hover:opacity-80 disabled:opacity-50"), children: messages({ key: "views.panels.view-publish" }) })), _jsx("button", { type: "button", disabled: view.pending, onClick: view.onReset, className: cx(ELEMENT_RESET, "text-sm text-(color:--vk-fg-subtle) transition-colors hover:text-(color:--vk-fg) disabled:opacity-50"), children: messages({ key: "views.panels.view-reset" }) })] })] }) }));
11
+ }
@@ -0,0 +1,4 @@
1
+ import type { CollectionViewsConfig } from "../../views-row/model.js";
2
+ export declare function FoldingViewRow({ axis }: {
3
+ axis: CollectionViewsConfig<string>;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,105 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { useLayoutEffect, useMemo, useRef, useState } from "react";
4
+ import { cx } from "../../../internal/cx.js";
5
+ import { ELEMENT_RESET } from "../../../internal/reset.js";
6
+ import { useViews } from "../../../provider/context.js";
7
+ import { formatCount } from "../../../internal/count.js";
8
+ import { VIEWS_LIST_CLASS } from "./menu-classes.js";
9
+ import { PillGroup } from "./PillGroup.js";
10
+ import { useAnchoredToggle } from "./use-anchored-toggle.js";
11
+ import { ViewCreatePill } from "./ViewCreatePill.js";
12
+ import { ViewPickerRow } from "./ViewPickerRow.js";
13
+ import { toPillOptions, usePillWords } from "./ViewTabs.js";
14
+ export function FoldingViewRow({ axis }) {
15
+ const hostRef = useRef(null);
16
+ const measureRef = useRef(null);
17
+ const [visible, setVisible] = useState(axis.options.length);
18
+ const words = usePillWords(axis.hideCounts);
19
+ const pills = useMemo(() => toPillOptions(axis.options, words), [axis.options, words]);
20
+ useLayoutEffect(() => {
21
+ const host = hostRef.current;
22
+ const measure = measureRef.current;
23
+ if (!host || !measure)
24
+ return;
25
+ const cluster = host.closest("[data-toolbar-row]")?.querySelector("[data-toolbar-cluster]");
26
+ const compute = () => {
27
+ const group = measure.querySelector("[data-measure-pills] > *");
28
+ const ghost = measure.querySelector("[data-measure-ghost]");
29
+ const more = measure.querySelector("[data-measure-more]");
30
+ if (!group)
31
+ return;
32
+ const widths = Array.from(group.children).map((child) => child.offsetWidth);
33
+ const room = host.clientWidth - (cluster?.offsetWidth ?? 0) - 12;
34
+ const gap = parseFloat(getComputedStyle(group).columnGap) || 2;
35
+ const ghostWidth = ghost ? ghost.offsetWidth + gap : 0;
36
+ const moreWidth = more ? more.offsetWidth + gap : 0;
37
+ if (widths.every((w) => w === 0)) {
38
+ setVisible(widths.length);
39
+ return;
40
+ }
41
+ const all = widths.reduce((sum, w) => sum + w + gap, 0) - gap;
42
+ if (all + ghostWidth <= room) {
43
+ setVisible(widths.length);
44
+ return;
45
+ }
46
+ let used = 0;
47
+ let count = 0;
48
+ for (const w of widths) {
49
+ const next = used + (count ? gap : 0) + w;
50
+ if (next + moreWidth + ghostWidth > room)
51
+ break;
52
+ used = next;
53
+ count += 1;
54
+ }
55
+ setVisible(Math.max(1, count));
56
+ };
57
+ compute();
58
+ if (typeof ResizeObserver === "undefined")
59
+ return;
60
+ const observer = new ResizeObserver(compute);
61
+ observer.observe(host);
62
+ if (cluster)
63
+ observer.observe(cluster);
64
+ return () => observer.disconnect();
65
+ }, [pills]);
66
+ const { shown, folded } = useMemo(() => {
67
+ const count = Math.min(visible, pills.length);
68
+ const activeIndex = pills.findIndex((p) => p.value === axis.value);
69
+ if (count >= pills.length || activeIndex < 0 || activeIndex < count) {
70
+ return { shown: pills.slice(0, count), folded: pills.slice(count) };
71
+ }
72
+ const shown = [...pills.slice(0, count - 1), pills[activeIndex]];
73
+ const folded = pills.filter((p, i) => i >= count - 1 && i !== activeIndex);
74
+ return { shown, folded };
75
+ }, [pills, visible, axis.value]);
76
+ const foldedOptions = useMemo(() => axis.options.filter((option) => folded.some((p) => p.value === option.value)), [axis.options, folded]);
77
+ const onPillReorder = (orderedShown) => {
78
+ const changedAt = orderedShown.findIndex((value, i) => shown[i]?.value !== value);
79
+ if (changedAt < 0 || !axis.onReorder)
80
+ return;
81
+ const personal = shown[changedAt].private === true;
82
+ const inBlock = (pill) => (pill.private === true) === personal;
83
+ const visibleValues = new Set(shown.map((pill) => pill.value));
84
+ const dealt = orderedShown.filter((value) => inBlock(pills.find((pill) => pill.value === value)));
85
+ const ordered = pills.filter(inBlock).map((pill) => (visibleValues.has(pill.value) ? dealt.shift() : pill.value));
86
+ axis.onReorder(ordered);
87
+ };
88
+ return (_jsxs("div", { ref: hostRef, "data-slot": "vk-views-row", className: "relative flex min-w-0 flex-1 items-center gap-0.5", children: [_jsx(PillGroup, { value: axis.value, options: shown, onChange: axis.onChange, variant: "plain", onReorder: axis.onReorder ? onPillReorder : undefined, canDrag: axis.canDrag }), folded.length > 0 && _jsx(FoldedViews, { axis: axis, options: foldedOptions }), axis.onCreate && _jsx(ViewCreatePill, { label: axis.createLabel, onClick: axis.onCreate }), _jsxs("div", { ref: measureRef, "aria-hidden": true, inert: true, "data-slot": "vk-views-row", className: "pointer-events-none absolute left-0 top-0 flex items-center gap-0.5 whitespace-nowrap", style: { visibility: "hidden" }, children: [_jsx("div", { "data-measure-pills": true, className: "contents", children: _jsx(PillGroup, { value: axis.value, options: pills, onChange: () => { }, variant: "plain" }) }), _jsx("span", { "data-measure-more": true, "data-slot": "vk-views-more", className: MORE_CHIP_CLASS, children: _jsx(MoreChipInner, { count: 99 }) }), axis.onCreate && (_jsx("span", { "data-measure-ghost": true, children: _jsx(ViewCreatePill, { label: axis.createLabel, onClick: () => { } }) }))] })] }));
89
+ }
90
+ const MORE_CHIP_CLASS = "inline-flex h-8 shrink-0 items-center gap-0.5 whitespace-nowrap rounded-full px-2.5 text-sm font-medium text-(color:--vk-fg-subtle) transition-colors duration-150 hover:bg-(color:--vk-hovered) hover:text-(color:--vk-fg) data-[state=open]:bg-(color:--vk-pressed) data-[state=open]:text-(color:--vk-fg)";
91
+ function MoreChipInner({ count }) {
92
+ const { conventions, icons } = useViews();
93
+ const Chevron = icons.chevronDown;
94
+ return (_jsxs(_Fragment, { children: ["+", formatCount(count, conventions), _jsx(Chevron, { className: "h-3.5 w-3.5 shrink-0 opacity-70" })] }));
95
+ }
96
+ function FoldedViews({ axis, options, }) {
97
+ const { components, messages } = useViews();
98
+ const { Popover } = components;
99
+ const anchor = useRef(null);
100
+ const toggle = useAnchoredToggle(anchor);
101
+ return (_jsxs(_Fragment, { children: [_jsx("button", { ref: anchor, type: "button", "aria-label": messages({ key: "views.panels.views-more", values: { count: options.length } }), "aria-haspopup": "dialog", "aria-expanded": toggle.open, "data-slot": "vk-views-more", "data-state": toggle.open ? "open" : "closed", ...toggle.triggerProps, className: cx(ELEMENT_RESET, MORE_CHIP_CLASS), children: _jsx(MoreChipInner, { count: options.length }) }), _jsx(Popover, { open: toggle.open, onOpenChange: toggle.onOpenChange, anchor: anchor, align: "start", sideOffset: 6, chrome: "menu", className: "w-64", children: _jsx("div", { role: "listbox", "aria-label": messages({ key: "views.panels.views-more-list" }), className: VIEWS_LIST_CLASS, children: options.map((option) => (_jsx(ViewPickerRow, { option: option, active: option.value === axis.value, hideCounts: axis.hideCounts, onSelect: () => {
102
+ axis.onChange(option.value);
103
+ toggle.close();
104
+ } }, option.value))) }) })] }));
105
+ }
@@ -0,0 +1,7 @@
1
+ import { type ReactNode } from "react";
2
+ type Props = {
3
+ children: ReactNode;
4
+ gap?: string;
5
+ };
6
+ export declare function HScrollRow({ children, gap }: Props): import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,42 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useLayoutEffect, useRef } from "react";
4
+ export function HScrollRow({ children, gap = "6px" }) {
5
+ const scrollRef = useRef(null);
6
+ useLayoutEffect(() => {
7
+ const container = scrollRef.current;
8
+ if (!container)
9
+ return;
10
+ const active = container.querySelector('[data-active="true"]');
11
+ if (!active)
12
+ return;
13
+ const scrollLeft = container.scrollLeft;
14
+ const containerWidth = container.clientWidth;
15
+ const childWidth = active.offsetWidth;
16
+ const childLeft = active.offsetLeft;
17
+ const childRight = childLeft + childWidth;
18
+ if (childLeft >= scrollLeft && childRight <= scrollLeft + containerWidth) {
19
+ return;
20
+ }
21
+ const target = childLeft - (containerWidth - childWidth) / 2;
22
+ container.scrollLeft = Math.max(0, target);
23
+ });
24
+ return (_jsx("div", { ref: scrollRef, onTouchMove: (e) => e.stopPropagation(), style: {
25
+ marginLeft: "-1rem",
26
+ marginRight: "-1rem",
27
+ maxWidth: "calc(100vw - var(--vk-scroll-row-inset, 0px))",
28
+ overflowX: "scroll",
29
+ overflowY: "hidden",
30
+ WebkitOverflowScrolling: "touch",
31
+ scrollbarWidth: "none",
32
+ msOverflowStyle: "none",
33
+ WebkitMaskImage: "linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 24px), transparent 100%)",
34
+ maskImage: "linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 24px), transparent 100%)",
35
+ }, children: _jsx("div", { style: {
36
+ display: "inline-flex",
37
+ gap,
38
+ whiteSpace: "nowrap",
39
+ paddingLeft: "1rem",
40
+ paddingRight: "var(--vk-scroll-row-end, 1rem)",
41
+ }, children: children }) }));
42
+ }
@@ -0,0 +1,30 @@
1
+ import type { PillOption } from "../../views-row/model.js";
2
+ /** Which look a pill row wears. See the `variant` prop below. */
3
+ type PillVariant = "solid" | "plain";
4
+ type PillGroupProps<T extends string = string> = {
5
+ value: T;
6
+ options: PillOption<T>[];
7
+ onChange: (value: T) => void;
8
+ className?: string;
9
+ /** "sm" = smaller pills for secondary/child tab rows. Default = top-level pills. */
10
+ size?: "default" | "sm";
11
+ /**
12
+ * "solid" (default) = every pill is a filled chip, active tinted.
13
+ * "plain" = no chip on inactive pills; the active one is a neutral wash of
14
+ * the same color, taller and tighter. `ViewTabs` always renders plain; rows
15
+ * that reach for PillGroup directly keep the solid default.
16
+ */
17
+ variant?: PillVariant;
18
+ /**
19
+ * The row can be REORDERED by dragging. Each pill's glyph becomes a grip
20
+ * under the pointer; the drop hands back every option's value in the new
21
+ * order. A drop that would carry a pill across the private/shared line is
22
+ * refused — the pill springs back and nothing is called. Absent, the row
23
+ * is exactly the row it always was: no handles, no drag context.
24
+ */
25
+ onReorder?: (orderedValues: T[]) => void;
26
+ /** Which pills may be picked up. Default: all of them, once `onReorder` is set. */
27
+ canDrag?: (value: T) => boolean;
28
+ };
29
+ export declare function PillGroup<T extends string = string>({ value, options, onChange, className, size, variant, onReorder, canDrag, }: PillGroupProps<T>): import("react/jsx-runtime").JSX.Element;
30
+ export {};