viewkitjs 0.26.0 → 0.28.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 (294) hide show
  1. package/CHANGELOG.md +95 -0
  2. package/MIGRATION.md +122 -7
  3. package/package.json +1 -1
  4. package/views/dist/cells/cell-format.d.ts +3 -1
  5. package/views/dist/cells/cell-format.js +2 -2
  6. package/views/dist/cells/use-cell-format.d.ts +8 -1
  7. package/views/dist/cells/use-cell-format.js +13 -2
  8. package/views/dist/contract.d.ts +240 -3
  9. package/views/dist/contract.js +238 -0
  10. package/views/dist/controls/alert/alert.d.ts +46 -0
  11. package/views/dist/controls/alert/alert.js +11 -0
  12. package/views/dist/controls/alert/looks.d.ts +4 -0
  13. package/views/dist/controls/alert/looks.js +19 -0
  14. package/views/dist/controls/alert/tokens.d.ts +92 -0
  15. package/views/dist/controls/alert/tokens.js +25 -0
  16. package/views/dist/controls/alert-dialog/alert-dialog.d.ts +50 -0
  17. package/views/dist/controls/alert-dialog/alert-dialog.js +67 -0
  18. package/views/dist/controls/alert-dialog/confirm.d.ts +13 -0
  19. package/views/dist/controls/alert-dialog/confirm.js +11 -0
  20. package/views/dist/controls/alert-dialog/looks.d.ts +4 -0
  21. package/views/dist/controls/alert-dialog/looks.js +17 -0
  22. package/views/dist/controls/alert-dialog/tokens.d.ts +119 -0
  23. package/views/dist/controls/alert-dialog/tokens.js +32 -0
  24. package/views/dist/controls/alert-dialog.css +95 -0
  25. package/views/dist/controls/alert.css +51 -0
  26. package/views/dist/controls/collapsible/collapsible.d.ts +39 -0
  27. package/views/dist/controls/collapsible/collapsible.js +18 -0
  28. package/views/dist/controls/collapsible/looks.d.ts +4 -0
  29. package/views/dist/controls/collapsible/looks.js +5 -0
  30. package/views/dist/controls/collapsible/map-collapse.d.ts +2 -0
  31. package/views/dist/controls/collapsible/map-collapse.js +6 -0
  32. package/views/dist/controls/collapsible/tokens.d.ts +68 -0
  33. package/views/dist/controls/collapsible/tokens.js +19 -0
  34. package/views/dist/controls/collapsible.css +83 -0
  35. package/views/dist/controls/compound-editor/map-parts-body.js +2 -1
  36. package/views/dist/controls/compound-editor/name-parts.js +10 -2
  37. package/views/dist/controls/compound-editor/place-parts.js +5 -1
  38. package/views/dist/controls/compound-editor/place.d.ts +2 -1
  39. package/views/dist/controls/compound-editor/place.js +2 -0
  40. package/views/dist/controls/controls.d.ts +17 -0
  41. package/views/dist/controls/controls.js +17 -0
  42. package/views/dist/controls/date-editor/date-editor.d.ts +2 -1
  43. package/views/dist/controls/date-editor/map-calendar.js +3 -1
  44. package/views/dist/controls/filter-editor/filter-editor.d.ts +56 -0
  45. package/views/dist/controls/filter-editor/filter-editor.js +208 -0
  46. package/views/dist/controls/filter-editor/how.d.ts +23 -0
  47. package/views/dist/controls/filter-editor/how.js +13 -0
  48. package/views/dist/controls/filter-editor/map-filter-body.d.ts +18 -0
  49. package/views/dist/controls/filter-editor/map-filter-body.js +164 -0
  50. package/views/dist/controls/filter-editor/map-rules.d.ts +85 -0
  51. package/views/dist/controls/filter-editor/map-rules.js +273 -0
  52. package/views/dist/controls/filter-editor/parts.d.ts +46 -0
  53. package/views/dist/controls/filter-editor/parts.js +75 -0
  54. package/views/dist/controls/filter-editor/rules.d.ts +104 -0
  55. package/views/dist/controls/filter-editor/rules.js +148 -0
  56. package/views/dist/controls/filter-editor/tokens.d.ts +83 -0
  57. package/views/dist/controls/filter-editor/tokens.js +23 -0
  58. package/views/dist/controls/filter-editor/words.d.ts +59 -0
  59. package/views/dist/controls/filter-editor/words.js +40 -0
  60. package/views/dist/controls/filter-editor.css +124 -0
  61. package/views/dist/controls/group-editor/group-editor.d.ts +56 -0
  62. package/views/dist/controls/group-editor/group-editor.js +126 -0
  63. package/views/dist/controls/group-editor/map-group-body.d.ts +19 -0
  64. package/views/dist/controls/group-editor/map-group-body.js +106 -0
  65. package/views/dist/controls/group-editor/rules.d.ts +48 -0
  66. package/views/dist/controls/group-editor/rules.js +41 -0
  67. package/views/dist/controls/group-editor/tokens.d.ts +15 -0
  68. package/views/dist/controls/group-editor/tokens.js +6 -0
  69. package/views/dist/controls/group-editor/words.d.ts +39 -0
  70. package/views/dist/controls/group-editor/words.js +21 -0
  71. package/views/dist/controls/group-editor.css +20 -0
  72. package/views/dist/controls/index.d.ts +35 -1
  73. package/views/dist/controls/index.js +35 -1
  74. package/views/dist/controls/internal/editor-parts.d.ts +47 -0
  75. package/views/dist/controls/internal/editor-parts.js +48 -0
  76. package/views/dist/controls/internal/step-return.d.ts +9 -0
  77. package/views/dist/controls/internal/step-return.js +27 -0
  78. package/views/dist/controls/links-editor/links-editor.d.ts +80 -0
  79. package/views/dist/controls/links-editor/links-editor.js +329 -0
  80. package/views/dist/controls/links-editor/links.d.ts +62 -0
  81. package/views/dist/controls/links-editor/links.js +50 -0
  82. package/views/dist/controls/links-editor/map-links-body.d.ts +10 -0
  83. package/views/dist/controls/links-editor/map-links-body.js +74 -0
  84. package/views/dist/controls/links-editor/tokens.d.ts +71 -0
  85. package/views/dist/controls/links-editor/tokens.js +20 -0
  86. package/views/dist/controls/links-editor/words.d.ts +56 -0
  87. package/views/dist/controls/links-editor/words.js +33 -0
  88. package/views/dist/controls/links-editor.css +132 -0
  89. package/views/dist/controls/menu-list/menu-list.d.ts +17 -2
  90. package/views/dist/controls/menu-list/menu-list.js +25 -16
  91. package/views/dist/controls/modal/looks.d.ts +4 -0
  92. package/views/dist/controls/modal/looks.js +25 -0
  93. package/views/dist/controls/modal/modal.d.ts +69 -0
  94. package/views/dist/controls/modal/modal.js +62 -0
  95. package/views/dist/controls/modal/tokens.d.ts +192 -0
  96. package/views/dist/controls/modal/tokens.js +50 -0
  97. package/views/dist/controls/modal.css +130 -0
  98. package/views/dist/controls/notice/notice.d.ts +49 -0
  99. package/views/dist/controls/notice/notice.js +35 -0
  100. package/views/dist/controls/notice/tokens.d.ts +99 -0
  101. package/views/dist/controls/notice/tokens.js +27 -0
  102. package/views/dist/controls/notice.css +100 -0
  103. package/views/dist/controls/number-editor/format.d.ts +31 -0
  104. package/views/dist/controls/number-editor/format.js +79 -0
  105. package/views/dist/controls/number-editor/looks.d.ts +14 -0
  106. package/views/dist/controls/number-editor/looks.js +17 -0
  107. package/views/dist/controls/number-editor/map-number-body.d.ts +16 -0
  108. package/views/dist/controls/number-editor/map-number-body.js +57 -0
  109. package/views/dist/controls/number-editor/number-editor.d.ts +72 -0
  110. package/views/dist/controls/number-editor/number-editor.js +202 -0
  111. package/views/dist/controls/number-editor/tokens.d.ts +28 -0
  112. package/views/dist/controls/number-editor/tokens.js +9 -0
  113. package/views/dist/controls/number-editor/words.d.ts +23 -0
  114. package/views/dist/controls/number-editor/words.js +13 -0
  115. package/views/dist/controls/number-editor.css +37 -0
  116. package/views/dist/controls/number-field/number-field.js +57 -5
  117. package/views/dist/controls/pane/looks.d.ts +4 -0
  118. package/views/dist/controls/pane/looks.js +11 -0
  119. package/views/dist/controls/pane/pane.d.ts +63 -0
  120. package/views/dist/controls/pane/pane.js +98 -0
  121. package/views/dist/controls/pane/state.d.ts +14 -0
  122. package/views/dist/controls/pane/state.js +7 -0
  123. package/views/dist/controls/pane/tokens.d.ts +79 -0
  124. package/views/dist/controls/pane/tokens.js +22 -0
  125. package/views/dist/controls/pane.css +104 -0
  126. package/views/dist/controls/picker/rows.d.ts +4 -2
  127. package/views/dist/controls/picker/rows.js +4 -3
  128. package/views/dist/controls/radio/radio.d.ts +33 -0
  129. package/views/dist/controls/radio/radio.js +19 -0
  130. package/views/dist/controls/radio/tokens.d.ts +127 -0
  131. package/views/dist/controls/radio/tokens.js +34 -0
  132. package/views/dist/controls/radio.css +104 -0
  133. package/views/dist/controls/sort-editor/map-sort-body.d.ts +9 -0
  134. package/views/dist/controls/sort-editor/map-sort-body.js +81 -0
  135. package/views/dist/controls/sort-editor/rules.d.ts +48 -0
  136. package/views/dist/controls/sort-editor/rules.js +24 -0
  137. package/views/dist/controls/sort-editor/sort-editor.d.ts +58 -0
  138. package/views/dist/controls/sort-editor/sort-editor.js +180 -0
  139. package/views/dist/controls/sort-editor/tokens.d.ts +79 -0
  140. package/views/dist/controls/sort-editor/tokens.js +22 -0
  141. package/views/dist/controls/sort-editor/words.d.ts +48 -0
  142. package/views/dist/controls/sort-editor/words.js +25 -0
  143. package/views/dist/controls/sort-editor.css +96 -0
  144. package/views/dist/controls/text-editor/phone-number.d.ts +4 -0
  145. package/views/dist/controls/text-editor/phone-number.js +20 -0
  146. package/views/dist/controls/text-editor/text-editor.js +2 -19
  147. package/views/dist/controls/toast/toast.d.ts +75 -0
  148. package/views/dist/controls/toast/toast.js +99 -0
  149. package/views/dist/controls/toast/tokens.d.ts +100 -0
  150. package/views/dist/controls/toast/tokens.js +27 -0
  151. package/views/dist/controls/toast.css +93 -0
  152. package/views/dist/controls/tokens.js +30 -0
  153. package/views/dist/controls/values-editor/looks.d.ts +16 -0
  154. package/views/dist/controls/values-editor/looks.js +19 -0
  155. package/views/dist/controls/values-editor/map-values-body.d.ts +12 -0
  156. package/views/dist/controls/values-editor/map-values-body.js +71 -0
  157. package/views/dist/controls/values-editor/tokens.d.ts +132 -0
  158. package/views/dist/controls/values-editor/tokens.js +35 -0
  159. package/views/dist/controls/values-editor/values-editor.d.ts +62 -0
  160. package/views/dist/controls/values-editor/values-editor.js +441 -0
  161. package/views/dist/controls/values-editor/values.d.ts +71 -0
  162. package/views/dist/controls/values-editor/values.js +59 -0
  163. package/views/dist/controls/values-editor/words.d.ts +50 -0
  164. package/views/dist/controls/values-editor/words.js +29 -0
  165. package/views/dist/controls/values-editor.css +207 -0
  166. package/views/dist/controls/views-list/looks.d.ts +13 -0
  167. package/views/dist/controls/views-list/looks.js +12 -0
  168. package/views/dist/controls/views-list/map-views-list-body.d.ts +19 -0
  169. package/views/dist/controls/views-list/map-views-list-body.js +65 -0
  170. package/views/dist/controls/views-list/rules.d.ts +72 -0
  171. package/views/dist/controls/views-list/rules.js +4 -0
  172. package/views/dist/controls/views-list/tokens.d.ts +11 -0
  173. package/views/dist/controls/views-list/tokens.js +5 -0
  174. package/views/dist/controls/views-list/views-list.d.ts +44 -0
  175. package/views/dist/controls/views-list/views-list.js +57 -0
  176. package/views/dist/controls/views-list/words.d.ts +22 -0
  177. package/views/dist/controls/views-list/words.js +3 -0
  178. package/views/dist/controls/views-list.css +8 -0
  179. package/views/dist/display/date.js +2 -2
  180. package/views/dist/display/format.js +10 -2
  181. package/views/dist/display/options.d.ts +3 -1
  182. package/views/dist/display/use-display-options.d.ts +3 -0
  183. package/views/dist/display/use-display-options.js +10 -2
  184. package/views/dist/display/viewer.d.ts +1 -1
  185. package/views/dist/display/viewer.js +1 -1
  186. package/views/dist/editors/DateEditor.js +11 -9
  187. package/views/dist/editors/NumberEditor.js +3 -1
  188. package/views/dist/editors/relation-panel.js +7 -1
  189. package/views/dist/editors/relation-picker.d.ts +2 -1
  190. package/views/dist/editors/relation-picker.js +4 -3
  191. package/views/dist/editors/relation-source.d.ts +4 -1
  192. package/views/dist/editors/relation-source.js +5 -2
  193. package/views/dist/field-row/editors/RowNumberEditor.js +2 -2
  194. package/views/dist/fields/number-edit.d.ts +6 -0
  195. package/views/dist/fields/number-edit.js +8 -1
  196. package/views/dist/grid/chrome/GridCellEditors.js +3 -3
  197. package/views/dist/grid/chrome/GridColumnDateSection.d.ts +4 -3
  198. package/views/dist/grid/chrome/GridColumnDateSection.js +4 -4
  199. package/views/dist/grid/chrome/GridColumnDurationSection.js +2 -2
  200. package/views/dist/grid/chrome/GridColumnMenu.js +6 -4
  201. package/views/dist/grid/chrome/GridDateEditor.d.ts +3 -1
  202. package/views/dist/grid/chrome/GridDateEditor.js +2 -1
  203. package/views/dist/grid/chrome/GridFooter.js +2 -2
  204. package/views/dist/grid/chrome/grid-column-menu-items.js +4 -2
  205. package/views/dist/grid/chrome/useGridBandFigures.js +2 -2
  206. package/views/dist/grid/chrome/useGridFittedWidths.d.ts +3 -0
  207. package/views/dist/grid/chrome/useGridFittedWidths.js +9 -3
  208. package/views/dist/grid/chrome/useGridKeyboard.d.ts +4 -1
  209. package/views/dist/grid/chrome/useGridKeyboard.js +5 -2
  210. package/views/dist/grid/chrome/useGridTableInteractionModel.js +2 -1
  211. package/views/dist/grid/core/commit-model.d.ts +7 -0
  212. package/views/dist/grid/core/commit-model.js +5 -1
  213. package/views/dist/grid/core/editing-controller.js +10 -2
  214. package/views/dist/grid/core/editing-model.js +3 -7
  215. package/views/dist/grid/core/undo-owner.d.ts +6 -0
  216. package/views/dist/grid/core/undo-owner.js +13 -0
  217. package/views/dist/grid/core/useGridEditing.d.ts +2 -0
  218. package/views/dist/grid/core/useGridEditing.js +4 -0
  219. package/views/dist/looks/index.d.ts +8 -0
  220. package/views/dist/looks/index.js +8 -0
  221. package/views/dist/looks/pieces.js +16 -0
  222. package/views/dist/panels/model.d.ts +6 -1
  223. package/views/dist/panels/react/customize-body.d.ts +4 -2
  224. package/views/dist/panels/react/customize-body.js +3 -3
  225. package/views/dist/panels/react/customize.js +4 -2
  226. package/views/dist/panels/react/filter/FilterEditor.js +2 -2
  227. package/views/dist/panels/react/filter/PhoneFilterEditor.d.ts +8 -2
  228. package/views/dist/panels/react/filter/PhoneFilterEditor.js +9 -6
  229. package/views/dist/panels/react/filter/filter-body.d.ts +8 -5
  230. package/views/dist/panels/react/filter/filter-body.js +17 -6
  231. package/views/dist/panels/react/filter/filter-part-body.d.ts +4 -1
  232. package/views/dist/panels/react/filter/filter-part-body.js +3 -1
  233. package/views/dist/panels/react/panel-sheet.d.ts +5 -1
  234. package/views/dist/panels/react/panel-sheet.js +6 -2
  235. package/views/dist/panels/react/panel-step.d.ts +12 -0
  236. package/views/dist/panels/react/panel-step.js +26 -0
  237. package/views/dist/panels/react/sort/SortEditor.d.ts +4 -0
  238. package/views/dist/panels/react/sort/SortEditor.js +5 -2
  239. package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +8 -0
  240. package/views/dist/panels/react/toolbar/ReadyToolbar.js +84 -2
  241. package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +2 -2
  242. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.d.ts +16 -0
  243. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +49 -0
  244. package/views/dist/panels/react/toolbar/ToolbarFilterSheet.js +3 -1
  245. package/views/dist/panels/react/toolbar/ToolbarFilters.d.ts +4 -1
  246. package/views/dist/panels/react/toolbar/ToolbarFilters.js +36 -21
  247. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.d.ts +4 -1
  248. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +2 -2
  249. package/views/dist/panels/react/toolbar/ToolbarSortPill.d.ts +5 -0
  250. package/views/dist/panels/react/toolbar/ToolbarSortPill.js +15 -6
  251. package/views/dist/panels/react/toolbar/panel-part.d.ts +5 -1
  252. package/views/dist/panels/react/toolbar/panel-part.js +2 -2
  253. package/views/dist/panels/react/toolbar/use-filter-add.d.ts +16 -0
  254. package/views/dist/panels/react/toolbar/use-filter-add.js +32 -0
  255. package/views/dist/panels/react.d.ts +1 -0
  256. package/views/dist/panels/react.js +1 -0
  257. package/views/dist/panels/settings/filter-groups.js +35 -1
  258. package/views/dist/panels/settings/group-buckets.js +1 -0
  259. package/views/dist/provider/ViewsProvider.d.ts +7 -1
  260. package/views/dist/provider/ViewsProvider.js +23 -3
  261. package/views/dist/provider/components.d.ts +34 -4
  262. package/views/dist/provider/moment.d.ts +6 -0
  263. package/views/dist/provider/moment.js +10 -0
  264. package/views/dist/styles.css +1276 -51
  265. package/views/dist/styles.unlayered.css +1277 -51
  266. package/views/docs/contract.md +23 -15
  267. package/views/docs/controls/alert-dialog.md +37 -0
  268. package/views/docs/controls/alert.md +30 -0
  269. package/views/docs/controls/collapsible.md +22 -0
  270. package/views/docs/controls/filter-editor.md +28 -0
  271. package/views/docs/controls/group-editor.md +11 -0
  272. package/views/docs/controls/links-editor.md +25 -0
  273. package/views/docs/controls/modal.md +55 -0
  274. package/views/docs/controls/notice.md +32 -0
  275. package/views/docs/controls/number-editor.md +12 -0
  276. package/views/docs/controls/pane.md +25 -0
  277. package/views/docs/controls/radio.md +39 -0
  278. package/views/docs/controls/sort-editor.md +27 -0
  279. package/views/docs/controls/toast.md +32 -0
  280. package/views/docs/controls/values-editor.md +40 -0
  281. package/views/docs/controls/views-list.md +8 -0
  282. package/views/docs/guides/cells.md +1 -1
  283. package/views/docs/guides/display.md +1 -1
  284. package/views/docs/guides/the-grid.md +1 -1
  285. package/views/docs/guides/the-provider.md +19 -0
  286. package/views/docs/reference/cells.md +2 -2
  287. package/views/docs/reference/controls.md +326 -8
  288. package/views/docs/reference/display.md +2 -2
  289. package/views/docs/reference/editors-relation.md +1 -1
  290. package/views/docs/reference/looks.md +20 -3
  291. package/views/docs/reference/panels-react.md +7 -6
  292. package/views/docs/reference/panels.md +1 -1
  293. package/views/docs/reference/react.md +8 -8
  294. package/views/docs/reference/views.md +1 -0
@@ -0,0 +1,29 @@
1
+ export const VALUES_EDITOR_WORDS = {
2
+ line: { email: "Add email…", link: "Add link…", domain: "Add domain…" },
3
+ cardLine: { email: "Add email", link: "Add link", domain: "Add domain" },
4
+ add: { email: "Add an email", phone: "Add a phone", link: "Add a link", domain: "Add a domain" },
5
+ nth: { email: (n) => `email ${n}`, phone: (n) => `phone ${n}`, link: (n) => `link ${n}`, domain: (n) => `domain ${n}` },
6
+ addButton: "Add",
7
+ change: (value) => `Change ${value}`,
8
+ copy: (value) => `Copy ${value}`,
9
+ move: (value) => `Move ${value}`,
10
+ remove: (value) => `Remove ${value}`,
11
+ open: { email: (value) => `Email ${value}`, phone: (value) => `Call ${value}`, link: (value) => `Open ${value}`, domain: (value) => `Open ${value}` },
12
+ main: "Main",
13
+ label: "Label",
14
+ labelIs: (label) => `Label: ${label}`,
15
+ noLabel: "none",
16
+ labelSearch: "Search or type a label",
17
+ labelFind: "Find or type a label",
18
+ labels: { work: "Work", personal: "Personal", mobile: "Mobile", other: "Other" },
19
+ country: "Country",
20
+ searchCountry: "Search for a country",
21
+ findCountry: "Find a country",
22
+ countryCode: "Country code",
23
+ countryIs: (country) => `Country: ${country}`,
24
+ countryCodeIs: (country) => `Country code: ${country}`,
25
+ backTo: (label) => `Back to ${label}`,
26
+ close: "Close",
27
+ save: "Save",
28
+ };
29
+ export const valuesWords = (given) => (given ? { ...VALUES_EDITOR_WORDS, ...given } : VALUES_EDITOR_WORDS);
@@ -0,0 +1,207 @@
1
+ /* The Values editor: what a field holding several of one kind is edited in (UI Kit · sketch · several values, round 1). Every
2
+ value is a public name (values-editor/tokens.ts). On a computer, what the Popover holds: the rows (a grip, the value a link, Main on the first,
3
+ its label quiet at the row's end, × under the pointer), a value being edited in its box, then the line to add one, its edge
4
+ to the Popover's, a line over it. On a phone, the Sheet's: a card for each value, the grip ≡ and ⊖ on each, and a
5
+ line with Add at the foot.
6
+ Those are Mihai's look. Attio's (KIT-357, the round-1 sketch Mihai reviewed on 12 Nov), read from the root's own
7
+ data-values-rows, -main, -line and -lists (looks.ts): rows 32 high with no fill, a value under the pointer in a pill with
8
+ copy at its end, the trash at the row's end, a value edited in a hairline box; the line 36 high under a hairline inside the
9
+ Popover's padding, a + in the grips' column, no ring; its refusal's words under it alone.
10
+
11
+ The rules sit in the components layer, so a utility class still wins. */
12
+ @layer components {
13
+
14
+ .o-values-editor { position: relative; display: flex; flex-direction: column; min-width: 0; color: var(--vk-fg); font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); }
15
+ .o-values-editor:focus { outline: none; }
16
+ .o-values-editor svg:where(:not(.o-popup-line > svg)) { flex: none; width: calc(var(--vk-spacing) * 4); height: calc(var(--vk-spacing) * 4); }
17
+ /* A fixed value's tick in its circle (the Picker's) stands at 16 here too, wherever the Picker's stylesheet stands in the page. */
18
+ .o-values-editor .o-picker-circle > svg { width: calc(var(--vk-spacing) * 4); height: calc(var(--vk-spacing) * 4); }
19
+
20
+ /* ── The rows: 34 high, 2 apart ─────────────────────────────────────────────────────────────────────────────────── */
21
+ .o-values-editor-rows { display: flex; flex-direction: column; gap: calc(var(--vk-spacing) * 0.5); }
22
+ .o-values-editor-row {
23
+ position: relative; display: flex; align-items: center; gap: calc(var(--vk-spacing) * 1.5); box-sizing: border-box; height: calc(var(--vk-spacing) * 8.5);
24
+ padding: 0 calc(var(--vk-spacing) * 2) 0 calc(var(--vk-spacing) * 0.5); border-radius: var(--vk-radius-lg); white-space: nowrap;
25
+ }
26
+ /* A hover only on a screen with a pointer (KIT-368: iOS keeps :hover on what was last tapped); a press and the forced state stay out. */
27
+ @media (hover: hover) { .o-values-editor-row:hover { background-color: var(--vk-overlay-hovered); } }
28
+ /* Held by its grip, it lifts over the others. */
29
+ .o-values-editor-row[data-lifted], .o-values-editor [data-lifted] { position: relative; z-index: var(--vk-layer-popup); }
30
+ .o-values-editor-row[data-lifted] { background-color: var(--vk-overlay); box-shadow: var(--vk-shadow-lg), inset 0 0 0 var(--vk-border-width) var(--vk-border); }
31
+ .o-values-editor-grip { flex: none; touch-action: none; }
32
+ .o-values-editor-value:focus-visible, .o-values-editor-label:is(button):not(.o-button):focus-visible, .o-values-editor-minus:not(.o-button):focus-visible {
33
+ outline: var(--vk-focus-width) solid var(--vk-border-brand); outline-offset: calc(-1 * var(--vk-focus-width));
34
+ }
35
+ /* The value: a link to look at; a press edits it. */
36
+ .o-values-editor-value {
37
+ min-width: 0; margin: 0; padding: 0; border: 0; background: transparent; font: inherit; text-align: left; cursor: text;
38
+ overflow: hidden; text-overflow: ellipsis; color: var(--vk-fg-brand); text-decoration: underline; text-underline-offset: calc(var(--vk-spacing) * 0.75); font-variant-numeric: tabular-nums;
39
+ }
40
+ .o-values-editor-main {
41
+ flex: none; display: inline-flex; align-items: center; height: calc(var(--vk-spacing) * 4.5); padding: 0 calc(var(--vk-spacing) * 1.5); border-radius: var(--vk-radius-full);
42
+ background-color: var(--vk-neutral); color: var(--vk-fg-subtle); font-size: var(--vk-font-size-xs); font-weight: var(--vk-font-weight-medium);
43
+ }
44
+ .o-values-editor-label { flex: none; margin-left: auto; color: var(--vk-fg-subtle); font-size: var(--vk-font-size-xs); }
45
+ .o-values-editor-remove { flex: none; opacity: 0; }
46
+ .o-values-editor-row:not(:has(.o-values-editor-label)) .o-values-editor-remove { margin-left: auto; }
47
+ .o-values-editor-remove:focus-visible { opacity: 1; }
48
+ @media (hover: hover) { .o-values-editor-row:hover .o-values-editor-remove { opacity: 1; } }
49
+ /* On a touch screen, where no pointer hovers, every row's remove stands always, as the phone form's does (KIT-425). */
50
+ @media (hover: none) { .o-values-editor-remove { opacity: 1; } }
51
+ /* A value being edited: the kit's Input in a cell (an InputGroup, its label a Button in its end addon), across the row. */
52
+ .o-values-editor-rows .o-values-editor-edit { flex: 1; min-width: 0; }
53
+
54
+ /* ── The line to add one. Every form's: a row, its words on one line, its icon quieter. In Mihai's look on a computer it is the
55
+ shared line across a popup's top, at its foot (ViewKit's popup-line.css, through lib/popup-line, data-at="foot"), its measures the line's own (KIT-498), its line over it; a
56
+ ring in focus, a danger line refused. Attio's (a plus, below) and the phone's (further down) draw their own. ──────────── */
57
+ .o-values-editor-line { display: flex; align-items: center; box-sizing: border-box; white-space: nowrap; }
58
+ .o-values-editor-line > svg { color: var(--vk-fg-subtlest); }
59
+ .o-values-editor-rows + .o-values-editor-error + .o-values-editor-line.o-popup-line, .o-values-editor > .o-values-editor-line.o-popup-line:first-child { margin-top: calc(-1 * var(--popup-line-reach)); }
60
+ .o-values-editor > .o-values-editor-line.o-popup-line:first-child { border-top: 0; }
61
+ .o-values-editor > .o-values-editor-line.o-popup-line:first-child::after { content: none; }
62
+ .o-values-editor-line.o-popup-line:focus-within { box-shadow: inset 0 0 0 var(--vk-focus-width) var(--vk-border-brand); border-radius: 0 0 var(--popover-corners, var(--vk-radius-xl)) var(--popover-corners, var(--vk-radius-xl)); }
63
+ .o-values-editor > .o-values-editor-line.o-popup-line:first-child:focus-within { border-radius: var(--popover-corners, var(--vk-radius-xl)); }
64
+ .o-values-editor .o-values-editor-line.o-popup-line[data-bad] { margin-bottom: 0; box-shadow: inset 0 calc(-1 * var(--vk-focus-width)) 0 var(--vk-border-danger); border-radius: 0; }
65
+ /* The line's box, on a computer and a phone, and each of Mihai's cards' is the kit's Input, bare, its digits lined up (numeric;
66
+ KIT-483): what it draws is the Input's own, a value cut at rest ending in "…". */
67
+ .o-values-editor-code { flex: none; }
68
+ .o-values-editor-prefix { flex: none; color: var(--vk-fg-subtle); font-variant-numeric: tabular-nums; }
69
+ .o-values-editor-error { margin: calc(var(--vk-spacing) * 2) var(--vk-spacing) 0; font-size: var(--vk-font-size-xs); line-height: calc(var(--vk-font-size-xs) * var(--vk-line-height-xs)); color: var(--vk-danger); }
70
+ .o-values-editor-rows + .o-values-editor-error { margin: var(--vk-spacing) var(--vk-spacing) 0; }
71
+ /* A list in the rows' place: a back row, the shared line across a popup's top (ViewKit's popup-line.css, through lib/popup-line), ‹ where the line's icon
72
+ stands, as the Picker's level (KIT-498), then the Picker. */
73
+ .o-values-editor-back { font-weight: var(--vk-font-weight-medium); }
74
+
75
+ /* ── On a phone, Mihai's look: a card for each value, 56 high, the grip ≡, ⊖, and a line with Add at the foot ──────── */
76
+ .o-values-editor[data-values-form="phone"] { display: grid; font-size: var(--vk-font-size-base); line-height: calc(var(--vk-font-size-base) * var(--vk-line-height-base)); }
77
+ /* Its cards and their rows are Field rows' (KIT-622), in the look this editor hands it (values-editor.tsx, MIHAI_CARDS and
78
+ ATTIO_ROWS); what a row holds and where stays here. */
79
+ .o-values-editor-card { white-space: nowrap; }
80
+ .o-values-editor-card .o-values-editor-label { font-size: var(--vk-font-size-sm); }
81
+ .o-values-editor-minus { flex: none; }
82
+ /* Its mark, a drawn bar: the span in the Button's label, never the Button's cut (KIT-645: a bare span inside the Button took the
83
+ cut's two spans too, and ⊖ drew as a red sliver over a white dash). */
84
+ .o-values-editor-minus > [data-slot="vk-button-label"] > span { display: block; width: calc(var(--vk-spacing) * 2.5); height: calc(var(--vk-spacing) * 0.5); border-radius: var(--vk-radius-full); background-color: var(--vk-fg-inverse); }
85
+ .o-values-editor [data-lifted] > .o-values-editor-card { background-color: var(--vk-overlay); box-shadow: var(--vk-shadow-lg); }
86
+ .o-values-editor-adding { display: flex; align-items: center; gap: calc(var(--vk-spacing) * 2.5); }
87
+ .o-values-editor-new { flex: 1; min-width: 0; }
88
+ .o-values-editor-new > svg { color: var(--vk-fg-subtlest); }
89
+ .o-values-editor-new .o-values-editor-prefix { margin-left: calc(var(--vk-spacing) * -1); }
90
+
91
+ /* ── Attio's look on a computer (data-values-rows="copy", data-values-line="plus") ──────────────────────────────────── */
92
+ .o-values-editor[data-values-rows="copy"] .o-values-editor-rows { gap: 0; }
93
+ .o-values-editor[data-values-rows="copy"] .o-values-editor-row { gap: var(--vk-spacing); height: calc(var(--vk-spacing) * 8); padding: 0 var(--vk-spacing) 0 0; border-radius: var(--vk-radius-md); }
94
+ @media (hover: hover) { .o-values-editor[data-values-rows="copy"] .o-values-editor-row:hover { background-color: transparent; } }
95
+ .o-values-editor[data-values-rows="copy"] .o-values-editor-row[data-lifted] { background-color: var(--vk-overlay); }
96
+ .o-values-editor[data-values-holds="one"] .o-values-editor-row { padding-left: var(--vk-spacing); }
97
+ /* The value in its pill: the pill shows under the pointer and in focus, and takes its copy's room after the value's end, so the
98
+ value reads to its last letter, its copy after it (KIT-488, Mihai's pick, 20 Nov 2026: "Make room for it"); only a value too
99
+ long for its row's room gives way, cut with … before its copy. The row's label and trash stay where they stood. */
100
+ .o-values-editor-pill {
101
+ position: relative; display: inline-flex; align-items: center; min-width: 0; max-width: 100%;
102
+ padding: calc(var(--vk-spacing) * 0.5) calc(var(--vk-spacing) * 1.5); margin-left: calc(var(--vk-spacing) * -0.5); border-radius: var(--vk-radius-sm);
103
+ }
104
+ .o-values-editor[data-values-rows="copy"] .o-values-editor-value { display: block; text-decoration-color: var(--vk-brand-subtler); }
105
+ .o-values-editor-copy { opacity: 0; }
106
+ .o-values-editor-row:focus-within .o-values-editor-pill { background-color: var(--vk-overlay-hovered); }
107
+ @media (hover: hover) { .o-values-editor-row:hover .o-values-editor-pill { background-color: var(--vk-overlay-hovered); } }
108
+ .o-values-editor-row:focus-within .o-values-editor-copy, .o-values-editor-copy[data-copied] { opacity: 1; }
109
+ @media (hover: hover) { .o-values-editor-row:hover .o-values-editor-copy { opacity: 1; } }
110
+ .o-values-editor[data-values-rows="copy"] .o-values-editor-row:focus-within .o-values-editor-pill,
111
+ .o-values-editor[data-values-rows="copy"] .o-values-editor-pill:has(> .o-values-editor-copy[data-copied]) { padding-right: calc(var(--vk-spacing) * 6); }
112
+ @media (hover: hover) { .o-values-editor[data-values-rows="copy"] .o-values-editor-row:hover .o-values-editor-pill { padding-right: calc(var(--vk-spacing) * 6); } }
113
+ /* On a touch screen, where no pointer hovers, every value's copy stands always, after the value's end in the pill's own room,
114
+ every value whole (KIT-444, Mihai's pick D, 13 Nov 2026), as under a pointer (KIT-488). */
115
+ @media (hover: none) {
116
+ .o-values-editor-copy { opacity: 1; }
117
+ .o-values-editor[data-values-rows="copy"] .o-values-editor-pill { padding-right: calc(var(--vk-spacing) * 6); }
118
+ }
119
+ /* A long email, on one line: its name cut, its domain whole beside its copy (KIT-455, Mihai's pick C, 13 Nov 2026), on a touch
120
+ screen and under a pointer alike (KIT-808, Mihai's pick, 20 Nov 2026: "As on the phone"), and in Mihai's look's rows too,
121
+ beside Main ("Yes, his look too", the same day). */
122
+ .o-values-editor .o-values-editor-value:has(> .o-values-editor-domain) { display: flex; }
123
+ .o-values-editor-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
124
+ .o-values-editor-domain { flex: none; white-space: nowrap; }
125
+ .o-values-editor[data-values-rows="copy"] .o-values-editor-label { color: var(--vk-fg-subtlest); font-size: var(--vk-font-size-sm); }
126
+ .o-values-editor[data-values-rows="copy"] .o-values-editor-row:not(:has(.o-values-editor-label)) .o-values-editor-remove { margin-left: auto; }
127
+ .o-values-editor[data-values-rows="copy"] .o-values-editor-row:focus-within .o-values-editor-remove { opacity: 1; }
128
+ /* A value edited: the in-cell Input's hairline, 2px further out than the row's words. */
129
+ .o-values-editor[data-values-rows="copy"] .o-values-editor-edit { margin-left: calc(var(--vk-spacing) * -0.5); }
130
+
131
+ /* The line: 36 high under a hairline inside the Popover's padding, a + in the grips' column, the caret and no ring. */
132
+ .o-values-editor[data-values-line="plus"] .o-values-editor-line, .o-values-editor[data-values-line="plus"] .o-values-editor-rows + .o-values-editor-error + .o-values-editor-line {
133
+ gap: var(--vk-spacing); min-height: calc(var(--vk-spacing) * 10 + var(--vk-border-width)); margin: var(--vk-spacing) 0 0; padding: var(--vk-spacing) 0 0; border-top: var(--vk-border-width) solid var(--vk-border-subtle);
134
+ box-shadow: none; border-radius: 0;
135
+ }
136
+ .o-values-editor[data-values-line="plus"] > .o-values-editor-line:first-child { margin: 0; padding: 0; border-top: 0; }
137
+ /* In the Popover its hairline is a line inside a floating surface (KIT-863): drawn in from each end as the list's Dividers say, Inset
138
+ by a row's 8, Rows as wide as the values, Full width to the Popover's edge, inside it, in the Popover's line colour; the first, standing alone, has none. */
139
+ .o-popover :is(.o-values-editor[data-values-line="plus"] .o-values-editor-line:not(:first-child), .o-values-editor[data-values-line="plus"] .o-values-editor-rows + .o-values-editor-error + .o-values-editor-line) {
140
+ --values-line-in: calc(var(--vk-spacing) * 2 * var(--dividers-words, 1) - (1 - var(--dividers-rows, 1)) * var(--divider-reach, 0px));
141
+ position: relative; border-top-color: transparent;
142
+ }
143
+ .o-popover :is(.o-values-editor[data-values-line="plus"] .o-values-editor-line:not(:first-child), .o-values-editor[data-values-line="plus"] .o-values-editor-rows + .o-values-editor-error + .o-values-editor-line)::after {
144
+ content: ""; position: absolute; left: var(--values-line-in); right: var(--values-line-in); top: calc(-1 * var(--vk-border-width)); height: var(--vk-border-width);
145
+ background-color: var(--divider-colour, var(--vk-border-subtle)); pointer-events: none;
146
+ }
147
+ .o-values-editor[data-values-line="plus"] .o-values-editor-line:focus-within, .o-values-editor[data-values-line="plus"] .o-values-editor-line[data-bad] { box-shadow: none; border-radius: 0; }
148
+ .o-values-editor-plus { flex: none; display: grid; place-items: center; width: calc(var(--vk-spacing) * 6); color: var(--vk-fg-subtle); }
149
+ .o-values-editor[data-values-line="plus"] .o-values-editor-prefix { color: var(--vk-fg-subtlest); }
150
+ .o-values-editor[data-values-line="plus"] .o-values-editor-error { margin: var(--vk-spacing) 0 var(--vk-spacing) calc(var(--vk-spacing) * 7); }
151
+
152
+ /* ── Attio's look on a phone (data-values-phone="rows"): one card, rows 48 high at 16, each with its grip, its label, its call,
153
+ write or open and its trash; the line in the card under a line; a refusal's words under the card ─────────────────── */
154
+ .o-values-editor[data-values-phone="rows"] .o-values-editor-card { white-space: normal; }
155
+ /* Its row's inside: the grip at its start's edge, its acts at its end, the computer's row height let go. */
156
+ .o-values-editor[data-values-phone="rows"] .o-values-editor-row { gap: 0; height: auto; padding: 0 var(--vk-spacing) 0 calc(var(--vk-spacing) * 0.5); border-radius: 0; }
157
+ @media (hover: hover) { .o-values-editor[data-values-phone="rows"] .o-values-editor-row:hover { background-color: transparent; } }
158
+ .o-values-editor[data-values-phone="rows"] .o-values-editor-row[data-lifted] { background-color: var(--vk-overlay); box-shadow: var(--vk-shadow-lg); }
159
+ .o-values-editor[data-values-holds="one"][data-values-phone="rows"] .o-values-editor-row { padding-left: calc(var(--vk-spacing) * 3); }
160
+ .o-values-editor[data-values-phone="rows"] .o-values-editor-value { flex: 0 1 auto; min-width: 0; min-height: calc(var(--vk-spacing) * 11); cursor: text; text-decoration-color: var(--vk-brand-subtler); text-underline-offset: var(--vk-spacing); }
161
+ .o-values-editor[data-values-phone="rows"] .o-values-editor-label { margin-left: auto; padding-left: calc(var(--vk-spacing) * 2); color: var(--vk-fg-subtlest); font-size: var(--vk-font-size-sm); }
162
+ .o-values-editor-acts { display: flex; flex: none; margin-left: auto; }
163
+ .o-values-editor-label + .o-values-editor-acts { margin-left: 0; }
164
+ .o-values-editor[data-values-phone="rows"] .o-values-editor-remove { opacity: 1; }
165
+ /* A value edited: the kit's Input in a cell across the row, 4px short of its end; its words the Sheet's, 16 on 24 (KIT-369). */
166
+ .o-values-editor[data-values-phone="rows"] .o-values-editor-card .o-values-editor-edit { flex: 1; min-width: 0; margin: 0 var(--vk-spacing) 0 0; font-size: inherit; line-height: inherit; }
167
+ .o-values-editor[data-values-phone="rows"] .o-values-editor-card > .o-values-editor-error { margin: 0 calc(var(--vk-spacing) * 3) calc(var(--vk-spacing) * 2) calc(var(--vk-spacing) * 8.5); font-size: var(--vk-font-size-sm); }
168
+ .o-values-editor[data-values-phone="rows"] .o-values-editor-line {
169
+ display: flex; align-items: center; gap: calc(var(--vk-spacing) * 0.5); min-height: calc(var(--vk-spacing) * 12); margin: 0; padding: 0 calc(var(--vk-spacing) * 3) 0 calc(var(--vk-spacing) * 0.5);
170
+ border-top: var(--vk-border-width) solid var(--vk-border-overlay-card); box-shadow: none; border-radius: 0;
171
+ }
172
+ .o-values-editor[data-values-phone="rows"] .o-values-editor-card > .o-values-editor-line:first-child { border-top: 0; }
173
+ .o-values-editor[data-values-phone="rows"] .o-values-editor-line .o-values-editor-plus { width: calc(var(--vk-spacing) * 8); }
174
+ .o-values-editor[data-values-phone="rows"] .o-values-editor-line .o-values-editor-plus svg { width: calc(var(--vk-spacing) * 4.5); height: calc(var(--vk-spacing) * 4.5); }
175
+ .o-values-editor[data-values-phone="rows"] .o-values-editor-line .o-values-editor-prefix { margin-right: var(--vk-spacing); color: var(--vk-fg-subtlest); }
176
+ .o-values-editor[data-values-phone="rows"] > .o-values-editor-error { margin: calc(var(--vk-spacing) * 2) var(--vk-spacing) 0; font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); }
177
+
178
+ /* ── Where its buttons stand: the editor's own places, the Button drawing the rest (KIT-492) ─────────────────────────────── */
179
+ .o-values-editor[data-values-form="computer"]:not([data-values-rows="copy"]) .o-values-editor-row .o-button.o-values-editor-remove { margin: 0 calc(var(--vk-spacing) * -1) 0 0; }
180
+ .o-values-editor[data-values-form="computer"] .o-values-editor-row:not(:has(.o-values-editor-label)) .o-button.o-values-editor-remove { margin-left: auto; }
181
+ .o-values-editor[data-values-form="computer"] .o-values-editor-row[data-lifted] .o-button.o-values-editor-grip { cursor: grabbing; }
182
+ /* Copy after the value's end, in the pill's own room (KIT-444, KIT-488). */
183
+ .o-values-editor[data-values-form="computer"] .o-values-editor-row .o-button.o-values-editor-copy { position: absolute; top: 50%; right: 0; margin: calc(var(--vk-spacing) * -2.5) 0 0; }
184
+ .o-values-editor[data-values-form="computer"]:not([data-values-line="plus"]) .o-values-editor-line .o-button.o-values-editor-code { margin: 0 0 0 calc(var(--vk-spacing) * -1); }
185
+ .o-values-editor[data-values-form="phone"] .o-values-editor-row .o-button.o-values-editor-grip { margin-left: calc(var(--vk-spacing) * -1); }
186
+ .o-values-editor[data-values-form="phone"] .o-values-editor-row[data-lifted] .o-button.o-values-editor-grip { cursor: grabbing; }
187
+ .o-values-editor[data-values-form="phone"] .o-values-editor-acts .o-button:is(.o-values-editor-open, .o-values-editor-remove) { margin: 0; }
188
+ .o-values-editor[data-values-form="phone"] .o-values-editor-line .o-button.o-values-editor-code { margin: 0 0 0 calc(var(--vk-spacing) * 0.5); }
189
+ .o-values-editor[data-values-form="phone"] .o-values-editor-cards .o-values-editor-card .o-button.o-values-editor-grip { margin-left: calc(var(--vk-spacing) * -1); }
190
+ .o-values-editor[data-values-form="phone"] .o-values-editor-cards [data-lifted] .o-values-editor-card .o-button.o-values-editor-grip { cursor: grabbing; }
191
+ .o-values-editor[data-values-form="phone"] .o-values-editor-cards .o-values-editor-card .o-button.o-values-editor-label { margin: 0 0 0 auto; }
192
+ .o-values-editor[data-values-form="phone"] .o-values-editor-cards .o-values-editor-card .o-button.o-values-editor-minus, .o-values-editor[data-values-form="phone"] .o-values-editor-new .o-button.o-values-editor-code { margin: 0; }
193
+
194
+ /* The pressing area under 640px (L2, the kit's own rule for packed targets): half the room to the next target, so no area
195
+ reaches another. None where they stand flush: across Attio's phone rows and line, and across and up and down the computer's
196
+ rows (24px buttons in rows of 32 and 34 with no gap); 6px across on Mihai's cards. These need only outweigh press.css's
197
+ rooms (three classes at most). */
198
+ .o-values-editor[data-values-form="computer"] .o-values-editor-row .o-button:is(.o-values-editor-grip, .o-values-editor-remove, .o-values-editor-copy),
199
+ .o-values-editor[data-values-form="computer"] .o-values-editor-edit .o-button.o-values-editor-edit-label { --pressing-room-x: 0px; --pressing-room-y: 0px; }
200
+ .o-values-editor[data-values-form="computer"] .o-values-editor-line .o-button.o-values-editor-code,
201
+ .o-values-editor[data-values-phone="rows"] .o-values-editor-card .o-button:is(.o-values-editor-grip, .o-values-editor-open, .o-values-editor-remove, .o-values-editor-code, .o-values-editor-edit-label) { --pressing-room-x: 0px; }
202
+ .o-values-editor[data-values-phone="cards"] :is(.o-values-editor-cards, .o-values-editor-new) .o-button:is(.o-values-editor-grip, .o-values-editor-label, .o-values-editor-minus, .o-values-editor-code) { --pressing-room-x: calc(var(--vk-spacing) * 1.5); }
203
+ }
204
+
205
+ /* ── On the phone every box typed into is 16px, so iOS never zooms in (KIT-369): the in-cell box is by itself (KIT-531); the
206
+ Values editor's line and cards, the kit's Input bare (KIT-483), which no in-cell box holds, take it here. ── */
207
+ .o-values-editor :is(.o-values-editor-line-input, .o-values-editor-card-input):where([data-vk-phone], [data-vk-phone] *) { font-size: var(--vk-font-size-base); }
@@ -0,0 +1,13 @@
1
+ import { type PieceLooks } from "../../looks/looks.js";
2
+ export type ViewsListOptionId = "private" | "favorites";
3
+ /** What the list, and a view's menu, read from the frame round them. */
4
+ export interface ViewsListWorn {
5
+ privateViews: boolean;
6
+ favorites: boolean;
7
+ }
8
+ /** The views list's options; it has no looks. */
9
+ export declare const VIEWS_LIST_LOOKS: PieceLooks<ViewsListOptionId>;
10
+ /** The options worn round `el`, each from the nearest frame that picks it; outside any frame, both off. */
11
+ export declare function viewsListWornOf(el: Element | null): ViewsListWorn;
12
+ /** The attributes the list watches, so an option changed while it is open reaches it. */
13
+ export declare const VIEWS_LIST_ATTRS: string[];
@@ -0,0 +1,12 @@
1
+ import { lookWornOf } from "../../looks/looks.js";
2
+ const OFF_ON = [{ id: "off", name: "Off" }, { id: "on", name: "On" }];
3
+ const options = [
4
+ { id: "private", name: "Private views", def: "off", values: OFF_ON },
5
+ { id: "favorites", name: "Favorites", def: "off", values: OFF_ON },
6
+ ];
7
+ export const VIEWS_LIST_LOOKS = { id: "views-list", name: "Views list", options, looks: [] };
8
+ export function viewsListWornOf(el) {
9
+ const worn = lookWornOf(VIEWS_LIST_LOOKS, el, ["private", "favorites"]);
10
+ return { privateViews: worn.private === "on", favorites: worn.favorites === "on" };
11
+ }
12
+ export const VIEWS_LIST_ATTRS = VIEWS_LIST_LOOKS.options.map((o) => `data-views-list-${o.id}`);
@@ -0,0 +1,19 @@
1
+ import * as React from "react";
2
+ import { type ViewsMessageResolver } from "../../contract.js";
3
+ import type { ViewsViewsListBodyProps, ViewsViewsListItem } from "../../provider/components.js";
4
+ import { type ViewsListProps } from "./views-list.js";
5
+ import type { ViewsListWords } from "./words.js";
6
+ type AppIcon = React.ComponentType<{
7
+ name: string;
8
+ className?: string;
9
+ }>;
10
+ /** The views list's words in the app's messages: ViewKit's own list's keys, the Picker's, and New view the axis's own word. */
11
+ export declare function viewsListWordsOf(say: ViewsMessageResolver, createLabel?: string): ViewsListWords;
12
+ /** The block an order changed, the shared views or the reader's own, in its new order; null when neither changed, or when a
13
+ * view whose place in it changed is one `canDrag` refuses. */
14
+ export declare function orderToWrite(views: readonly Pick<ViewsViewsListItem, "value" | "private">[], order: string[], canDrag?: (value: string) => boolean): string[] | null;
15
+ /** The slot's props as the views list's. */
16
+ export declare function viewsListPropsOf(p: ViewsViewsListBodyProps, words: ViewsListWords, notNow: string, AppIcon?: AppIcon): ViewsListProps;
17
+ /** ViewKit's views list body, drawn as the views list. */
18
+ export declare function MapViewsListBody(props: ViewsViewsListBodyProps): import("react/jsx-runtime").JSX.Element;
19
+ export {};
@@ -0,0 +1,65 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { resolveViewsMessage } from "../../contract.js";
5
+ import { ViewsContext } from "../../provider/context.js";
6
+ import { menuEntries } from "../menu/map-menu.js";
7
+ import { pickerWordsOf } from "../picker/map-picker.js";
8
+ import { useViewsList } from "./views-list.js";
9
+ export function viewsListWordsOf(say, createLabel) {
10
+ return {
11
+ label: say({ key: "views.panels.views-list" }),
12
+ search: say({ key: "views.panels.views-search" }),
13
+ find: say({ key: "views.panels.views-find" }),
14
+ newView: createLabel ?? say({ key: "views.panels.view-create" }),
15
+ shared: say({ key: "views.panels.views-shared" }),
16
+ justMe: say({ key: "views.panels.views-personal" }),
17
+ none: say({ key: "views.panels.views-none" }),
18
+ picker: pickerWordsOf(say),
19
+ };
20
+ }
21
+ export function orderToWrite(views, order, canDrag) {
22
+ for (const own of [false, true]) {
23
+ const was = views.filter((v) => !!v.private === own).map((v) => v.value);
24
+ const now = order.filter((id) => was.includes(id));
25
+ if (now.length !== was.length || now.every((id, at) => id === was[at]))
26
+ continue;
27
+ if (canDrag && now.some((id, at) => id !== was[at] && !canDrag(id)))
28
+ return null;
29
+ return now;
30
+ }
31
+ return null;
32
+ }
33
+ export function viewsListPropsOf(p, words, notNow, AppIcon) {
34
+ const icons = [...new Set(p.views.flatMap((v) => (v.icon ? [v.icon] : [])))];
35
+ const layouts = AppIcon ? icons.map((icon) => ({ id: icon, name: icon, line: "", mark: _jsx(AppIcon, { name: icon }) })) : [];
36
+ const menuOf = (id) => p.views.find((v) => v.value === id)?.menu;
37
+ return {
38
+ label: p.label,
39
+ views: p.views.map((v) => ({ id: v.value, name: v.label, layout: v.icon ?? "", ...(v.private ? { private: true } : {}), ...(typeof v.count === "number" ? { count: v.count } : {}) })),
40
+ open: p.value,
41
+ layouts,
42
+ form: p.form,
43
+ onChange: (c) => {
44
+ if (c.kind === "open")
45
+ p.onViewChange(c.id);
46
+ else if (c.kind === "order") {
47
+ const block = orderToWrite(p.views, c.ids, p.canDrag);
48
+ if (block)
49
+ p.onReorder?.(block);
50
+ }
51
+ },
52
+ onDone: p.onDone,
53
+ entries: (id) => menuEntries(menuOf(id) ?? [], notNow),
54
+ ...(p.onCreate ? { onNew: p.onCreate } : {}),
55
+ privateViews: p.views.some((v) => v.private),
56
+ reorder: !!p.onReorder,
57
+ words,
58
+ };
59
+ }
60
+ export function MapViewsListBody(props) {
61
+ const context = React.useContext(ViewsContext);
62
+ const say = context?.messages ?? resolveViewsMessage;
63
+ const words = React.useMemo(() => viewsListWordsOf(say, props.createLabel), [say, props.createLabel]);
64
+ return _jsx(_Fragment, { children: useViewsList(viewsListPropsOf(props, words, say({ key: "views.menus.not-now" }), context?.components.AppIcon)).body });
65
+ }
@@ -0,0 +1,72 @@
1
+ import type { ReactNode } from "react";
2
+ /** A list's view, as an app hands it. */
3
+ export interface ListView {
4
+ id: string;
5
+ name: string;
6
+ layout: string;
7
+ private?: boolean;
8
+ favorite?: boolean;
9
+ changed?: boolean;
10
+ count?: number;
11
+ }
12
+ /** A layout a new view can take: its mark, its name, its one line; `columns` where it asks which field makes its columns (a board). */
13
+ export interface ViewsListLayout {
14
+ id: string;
15
+ name: string;
16
+ mark: ReactNode;
17
+ line: string;
18
+ columns?: boolean;
19
+ }
20
+ /** What happened, handed on as it happens. The list itself hands on `open` and `order`; the rest are its menu's. */
21
+ export type ViewsListChange = {
22
+ kind: "open";
23
+ id: string;
24
+ } | {
25
+ kind: "order";
26
+ ids: string[];
27
+ } | {
28
+ kind: "rename";
29
+ id: string;
30
+ name: string;
31
+ } | {
32
+ kind: "create";
33
+ layout: string;
34
+ name: string;
35
+ columns?: string;
36
+ from?: string;
37
+ } | {
38
+ kind: "duplicate";
39
+ id: string;
40
+ } | {
41
+ kind: "delete";
42
+ id: string;
43
+ } | {
44
+ kind: "restore";
45
+ view: ListView;
46
+ at: number;
47
+ open: boolean;
48
+ } | {
49
+ kind: "save";
50
+ id: string;
51
+ } | {
52
+ kind: "reset";
53
+ id: string;
54
+ } | {
55
+ kind: "edit";
56
+ id: string;
57
+ } | {
58
+ kind: "link";
59
+ id: string;
60
+ } | {
61
+ kind: "favorite";
62
+ id: string;
63
+ on: boolean;
64
+ } | {
65
+ kind: "private";
66
+ id: string;
67
+ on: boolean;
68
+ };
69
+ /** The two headings the list holds where an app has private views on: the default words (`ViewsListWords.shared`, `justMe`). */
70
+ export declare const SHARED = "Shared", JUST_ME = "Just me";
71
+ /** The views as the list shows them: as they are; with private views on, the shared ones, then the private ones, each in its order. */
72
+ export declare function listed(views: ListView[], privateViews: boolean): ListView[];
@@ -0,0 +1,4 @@
1
+ export const SHARED = "Shared", JUST_ME = "Just me";
2
+ export function listed(views, privateViews) {
3
+ return privateViews ? [...views.filter((v) => !v.private), ...views.filter((v) => v.private)] : views;
4
+ }
@@ -0,0 +1,11 @@
1
+ export declare const VIEWS_LIST_TOKENS: readonly [{
2
+ readonly name: "--vk-fg-subtle";
3
+ readonly kind: "colour";
4
+ readonly outright: "--text-subtle";
5
+ }, {
6
+ readonly name: "--vk-spacing";
7
+ readonly kind: "size";
8
+ readonly outright: "--spacing";
9
+ }];
10
+ /** The views list has no machinery of its own. */
11
+ export declare const VIEWS_LIST_PRIVATE: readonly [];
@@ -0,0 +1,5 @@
1
+ export const VIEWS_LIST_TOKENS = [
2
+ { name: "--vk-fg-subtle", kind: "colour", outright: "--text-subtle" },
3
+ { name: "--vk-spacing", kind: "size", outright: "--spacing" },
4
+ ];
5
+ export const VIEWS_LIST_PRIVATE = [];
@@ -0,0 +1,44 @@
1
+ import * as React from "react";
2
+ import type { MenuEntry } from "../menu-list/menu-list.js";
3
+ import { type PickerParts } from "../picker/picker.js";
4
+ import { type ListView, type ViewsListChange, type ViewsListLayout } from "./rules.js";
5
+ import { type ViewsListWords } from "./words.js";
6
+ /** Held back from the controls door until VK-727: `viewkitjs/views/react`'s atom already has the name. */
7
+ export interface ViewsListProps {
8
+ /** What it lists, as its shell names it: the list's name to a screen reader ("Views"); left out, the words'. */
9
+ label?: string;
10
+ views: ListView[];
11
+ /** The view open. */
12
+ open: string;
13
+ /** The layouts the views take, for their marks. */
14
+ layouts: ViewsListLayout[];
15
+ /** What happened in the list: it hands on only `open` and `order`. */
16
+ onChange: (change: ViewsListChange) => void;
17
+ /** A view opened: what holds the list closes it. */
18
+ onDone?: () => void;
19
+ /** Which form; by default the phone's in a phone's window or in a PhoneHost screen, else the computer's. */
20
+ form?: "computer" | "phone";
21
+ /** A view's menu, by its id, as its ⋮ opens it; left out, no row has one. */
22
+ entries?: (id: string) => MenuEntry[];
23
+ /** New view, the list's action; left out, no action. */
24
+ onNew?: () => void;
25
+ /** Shared and Just me, a private view's lock; left out, the Private views option worn round it. */
26
+ privateViews?: boolean;
27
+ /** false: no row moves. */
28
+ reorder?: boolean;
29
+ words?: Partial<ViewsListWords>;
30
+ }
31
+ export interface ViewsListParts {
32
+ body: React.ReactNode;
33
+ /** On a phone, the Sheet head's buttons, the Picker's; {} on a computer. */
34
+ head: PickerParts["head"];
35
+ }
36
+ /** A private view's lock, as the list draws it after its name. */
37
+ export declare const LOCK: import("react/jsx-runtime").JSX.Element;
38
+ /** The views list's options worn round `el`, read again as they change. */
39
+ export declare function useViewsListWorn(el: Element | null): import("./looks.js").ViewsListWorn;
40
+ /** The views list's state and the parts a shell pours in. */
41
+ export declare function useViewsList(props: ViewsListProps): ViewsListParts;
42
+ /** The body alone, for a shell that holds only a body (the Popover): placed inside it, so the list starts afresh each time it
43
+ * opens, nothing typed in its search. */
44
+ export declare function ViewsList(props: ViewsListProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,57 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { Icon } from "../internal/icons.js";
5
+ import { PhoneHost, phoneMark, usePhone } from "../internal/phone.js";
6
+ import { MENU_LIST_CARD_FRAME } from "../menu-list/looks.js";
7
+ import { usePicker } from "../picker/picker.js";
8
+ import { VIEWS_LIST_ATTRS, viewsListWornOf } from "./looks.js";
9
+ import { listed } from "./rules.js";
10
+ import { viewsListWords } from "./words.js";
11
+ export const LOCK = (_jsxs("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("path", { d: "M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6z" }), _jsx("path", { d: "M8 11v-4a4 4 0 1 1 8 0v4" })] }));
12
+ export function useViewsListWorn(el) {
13
+ const [worn, setWorn] = React.useState(() => viewsListWornOf(null));
14
+ React.useLayoutEffect(() => {
15
+ if (!el)
16
+ return;
17
+ const read = () => setWorn((now) => { const next = viewsListWornOf(el); return now.privateViews === next.privateViews && now.favorites === next.favorites ? now : next; });
18
+ read();
19
+ const watch = new MutationObserver(read);
20
+ watch.observe(document.documentElement, { attributes: true, subtree: true, attributeFilter: VIEWS_LIST_ATTRS });
21
+ return () => watch.disconnect();
22
+ }, [el]);
23
+ return worn;
24
+ }
25
+ export function useViewsList(props) {
26
+ const { views, open, layouts, onChange, onDone } = props;
27
+ const w = viewsListWords(props.words);
28
+ const screen = React.useContext(PhoneHost), small = usePhone(), phone = (props.form ?? (screen || small ? "phone" : "computer")) === "phone";
29
+ const [root, setRoot] = React.useState(null), worn = useViewsListWorn(props.privateViews === undefined ? root : null);
30
+ const privateViews = props.privateViews ?? worn.privateViews;
31
+ const markOf = (layout) => {
32
+ const mark = layouts.find((l) => l.id === layout)?.mark;
33
+ return mark == null ? {} : { as: { mark: _jsx("span", { className: "o-views-list-mark", children: mark }) } };
34
+ };
35
+ const items = listed(views, privateViews).map((v) => ({
36
+ value: v.id, label: v.name, ...markOf(v.layout),
37
+ ...(props.entries ? { menu: props.entries(v.id) } : {}),
38
+ ...(typeof v.count === "number" ? { count: v.count } : {}),
39
+ ...(privateViews ? { group: v.private ? w.justMe : w.shared, ...(v.private ? { after: LOCK } : {}) } : {}),
40
+ }));
41
+ const picker = usePicker({
42
+ label: props.label ?? w.label, items, value: open, form: phone ? "phone" : "computer",
43
+ onValueChange: (v) => { if (typeof v === "string" && v !== open)
44
+ onChange({ kind: "open", id: v }); },
45
+ onDone,
46
+ ...(props.reorder !== false ? { onOrderChange: (ids) => onChange({ kind: "order", ids }) } : {}),
47
+ ...(props.onNew ? { actions: [{ id: "new", label: w.newView, icon: _jsx(Icon, { name: "plus" }), onSelect: props.onNew }] } : {}),
48
+ search: phone ? w.find : w.search, searchShown: true, heldInPlace: true, actionsUnder: true, fromHeld: true,
49
+ ...(w.none ? { none: w.none } : {}), ...(w.picker ? { words: w.picker } : {}),
50
+ menuFrame: MENU_LIST_CARD_FRAME,
51
+ });
52
+ const body = (_jsx("div", { ref: setRoot, className: "o-views-list", "data-kit": "views-list", "data-views-form": phone ? "phone" : "computer", ...phoneMark(!!screen || small), children: picker.body }));
53
+ return { body, head: picker.head };
54
+ }
55
+ export function ViewsList(props) {
56
+ return _jsx(_Fragment, { children: useViewsList(props).body });
57
+ }
@@ -0,0 +1,22 @@
1
+ import type { PickerWords } from "../picker/picker.js";
2
+ export interface ViewsListWords {
3
+ /** What it lists: the list's name to a screen reader. */
4
+ label: string;
5
+ /** Its search on a computer, its first row. */
6
+ search: string;
7
+ /** Its search on a phone, at the Sheet's foot. */
8
+ find: string;
9
+ /** The action that makes a new view. */
10
+ newView: string;
11
+ /** The shared views' heading, where private views are on. */
12
+ shared: string;
13
+ /** The reader's own views' heading. */
14
+ justMe: string;
15
+ /** What a search that matches nothing says; left out, the Picker's own. */
16
+ none?: string;
17
+ /** The words of the list itself. */
18
+ picker?: Partial<PickerWords>;
19
+ }
20
+ export declare const VIEWS_LIST_WORDS: ViewsListWords;
21
+ /** The words handed over the English. */
22
+ export declare const viewsListWords: (given?: Partial<ViewsListWords>) => ViewsListWords;
@@ -0,0 +1,3 @@
1
+ import { JUST_ME, SHARED } from "./rules.js";
2
+ export const VIEWS_LIST_WORDS = { label: "Views", search: "Search views", find: "Find a view", newView: "New view", shared: SHARED, justMe: JUST_ME };
3
+ export const viewsListWords = (given) => (given ? { ...VIEWS_LIST_WORDS, ...given } : VIEWS_LIST_WORDS);
@@ -0,0 +1,8 @@
1
+ /* The views list (VK-723, from the Outright kit's KIT-678): only what is its own. Its list is the Picker, its menus the Menu, each as
2
+ it is. Here: a view's layout mark at a row's icon size (16 on a computer, 20 on a phone, the subtle text). */
3
+ @layer components {
4
+ .o-views-list { display: contents; }
5
+ .o-views-list-mark { display: inline-grid; place-items: center; color: var(--vk-fg-subtle); }
6
+ .o-views-list-mark > svg { width: calc(var(--vk-spacing) * 4); height: calc(var(--vk-spacing) * 4); }
7
+ .o-picker[data-picker-form="phone"] .o-views-list-mark > svg { width: calc(var(--vk-spacing) * 5); height: calc(var(--vk-spacing) * 5); }
8
+ }
@@ -6,12 +6,12 @@ import { cx } from "../internal/cx.js";
6
6
  import { useViews } from "../provider/context.js";
7
7
  import { formatDateValue } from "./format.js";
8
8
  import { cellTextClass } from "./text-class.js";
9
- import { useDisplayOptions } from "./use-display-options.js";
9
+ import { useDateDisplayOptions } from "./use-display-options.js";
10
10
  export function renderDate(field, value, opts) {
11
11
  return _jsx(DateValue, { field: field, value: value, opts: opts });
12
12
  }
13
13
  function DateValue({ field, value, opts: given, }) {
14
- const opts = useDisplayOptions(given);
14
+ const opts = useDateDisplayOptions(given);
15
15
  const { Tooltip } = useViews().components;
16
16
  const [pointed, setPointed] = useState(false);
17
17
  const [pressed, setPressed] = useState(false);