viewkitjs 0.27.0 → 0.29.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 (469) hide show
  1. package/CHANGELOG.md +178 -0
  2. package/MIGRATION.md +123 -5
  3. package/fields/dist/derived.d.ts +2 -1
  4. package/fields/dist/derived.js +9 -3
  5. package/fields/dist/entities.js +41 -3
  6. package/fields/dist/index.d.ts +1 -1
  7. package/fields/dist/index.js +1 -1
  8. package/fields/dist/messages.d.ts +8 -2
  9. package/fields/dist/messages.js +3 -0
  10. package/fields/dist/range.d.ts +6 -0
  11. package/fields/dist/range.js +8 -0
  12. package/fields/dist/registry.js +11 -1
  13. package/fields/dist/spec-changes.js +1 -0
  14. package/fields/dist/types.d.ts +23 -1
  15. package/fields/docs/guides/derived-fields.md +7 -5
  16. package/fields/docs/guides/field-types.md +2 -2
  17. package/fields/docs/guides/the-index.md +1 -1
  18. package/fields/docs/reference/fields.md +3 -1
  19. package/fields/docs/reference/types.md +3 -1
  20. package/fields/skills/viewkit/SKILL.md +1 -1
  21. package/package.json +2 -1
  22. package/postgres/dist/definitions/build.js +29 -5
  23. package/postgres/dist/definitions/label.d.ts +7 -0
  24. package/postgres/dist/definitions/label.js +9 -1
  25. package/postgres/dist/definitions/lookup.js +6 -2
  26. package/postgres/dist/definitions/place.d.ts +6 -3
  27. package/postgres/dist/definitions/rollup.js +5 -1
  28. package/postgres/dist/definitions/storage.d.ts +15 -0
  29. package/postgres/dist/definitions/storage.js +52 -1
  30. package/postgres/dist/definitions/stored.js +21 -0
  31. package/postgres/dist/phone.d.ts +13 -1
  32. package/postgres/dist/phone.js +23 -3
  33. package/postgres/dist/search-indexes.d.ts +6 -1
  34. package/postgres/dist/search-indexes.js +71 -25
  35. package/postgres/dist/search.js +3 -3
  36. package/postgres/docs/guides/definitions.md +22 -5
  37. package/postgres/docs/guides/field-map.md +5 -4
  38. package/postgres/docs/reference/definitions.md +3 -3
  39. package/postgres/docs/reference/postgres.md +1 -1
  40. package/views/dist/cells/cell-format.d.ts +3 -1
  41. package/views/dist/cells/cell-format.js +3 -3
  42. package/views/dist/cells/cell-values.js +9 -10
  43. package/views/dist/cells/use-cell-format.d.ts +8 -1
  44. package/views/dist/cells/use-cell-format.js +13 -2
  45. package/views/dist/contract.d.ts +218 -5
  46. package/views/dist/contract.js +233 -1
  47. package/views/dist/controls/alert/alert.d.ts +46 -0
  48. package/views/dist/controls/alert/alert.js +11 -0
  49. package/views/dist/controls/alert/looks.d.ts +4 -0
  50. package/views/dist/controls/alert/looks.js +19 -0
  51. package/views/dist/controls/alert/tokens.d.ts +92 -0
  52. package/views/dist/controls/alert/tokens.js +25 -0
  53. package/views/dist/controls/alert-dialog/alert-dialog.d.ts +50 -0
  54. package/views/dist/controls/alert-dialog/alert-dialog.js +67 -0
  55. package/views/dist/controls/alert-dialog/confirm.d.ts +13 -0
  56. package/views/dist/controls/alert-dialog/confirm.js +11 -0
  57. package/views/dist/controls/alert-dialog/looks.d.ts +4 -0
  58. package/views/dist/controls/alert-dialog/looks.js +17 -0
  59. package/views/dist/controls/alert-dialog/tokens.d.ts +119 -0
  60. package/views/dist/controls/alert-dialog/tokens.js +32 -0
  61. package/views/dist/controls/alert-dialog.css +95 -0
  62. package/views/dist/controls/alert.css +51 -0
  63. package/views/dist/controls/bulk-bar/bulk-bar-of.d.ts +66 -0
  64. package/views/dist/controls/bulk-bar/bulk-bar-of.js +22 -0
  65. package/views/dist/controls/bulk-bar/bulk-bar.d.ts +40 -0
  66. package/views/dist/controls/bulk-bar/bulk-bar.js +278 -0
  67. package/views/dist/controls/bulk-bar/looks.d.ts +10 -0
  68. package/views/dist/controls/bulk-bar/looks.js +14 -0
  69. package/views/dist/controls/bulk-bar/map-selection-bar.d.ts +19 -0
  70. package/views/dist/controls/bulk-bar/map-selection-bar.js +57 -0
  71. package/views/dist/controls/bulk-bar/tokens.d.ts +136 -0
  72. package/views/dist/controls/bulk-bar/tokens.js +36 -0
  73. package/views/dist/controls/bulk-bar/words.d.ts +50 -0
  74. package/views/dist/controls/bulk-bar/words.js +19 -0
  75. package/views/dist/controls/bulk-bar.css +96 -0
  76. package/views/dist/controls/button/button.js +3 -1
  77. package/views/dist/controls/button.css +5 -4
  78. package/views/dist/controls/checkbox/checkbox.js +3 -1
  79. package/views/dist/controls/checkbox.css +1 -1
  80. package/views/dist/controls/choice/tokens.d.ts +79 -0
  81. package/views/dist/controls/choice/tokens.js +22 -0
  82. package/views/dist/controls/choice.css +31 -0
  83. package/views/dist/controls/collapsible/collapsible.d.ts +39 -0
  84. package/views/dist/controls/collapsible/collapsible.js +18 -0
  85. package/views/dist/controls/collapsible/looks.d.ts +4 -0
  86. package/views/dist/controls/collapsible/looks.js +5 -0
  87. package/views/dist/controls/collapsible/map-collapse.d.ts +2 -0
  88. package/views/dist/controls/collapsible/map-collapse.js +6 -0
  89. package/views/dist/controls/collapsible/tokens.d.ts +68 -0
  90. package/views/dist/controls/collapsible/tokens.js +19 -0
  91. package/views/dist/controls/collapsible.css +83 -0
  92. package/views/dist/controls/compound-editor/looks.js +1 -1
  93. package/views/dist/controls/compound-editor/place-parts.js +5 -1
  94. package/views/dist/controls/controls.d.ts +19 -0
  95. package/views/dist/controls/controls.js +17 -0
  96. package/views/dist/controls/customize/customize.d.ts +125 -0
  97. package/views/dist/controls/customize/customize.js +243 -0
  98. package/views/dist/controls/customize/glide.d.ts +10 -0
  99. package/views/dist/controls/customize/glide.js +55 -0
  100. package/views/dist/controls/customize/looks.d.ts +13 -0
  101. package/views/dist/controls/customize/looks.js +11 -0
  102. package/views/dist/controls/customize/map-customize-body.d.ts +18 -0
  103. package/views/dist/controls/customize/map-customize-body.js +160 -0
  104. package/views/dist/controls/customize/rules.d.ts +23 -0
  105. package/views/dist/controls/customize/rules.js +19 -0
  106. package/views/dist/controls/customize/tokens.d.ts +40 -0
  107. package/views/dist/controls/customize/tokens.js +12 -0
  108. package/views/dist/controls/customize/words.d.ts +58 -0
  109. package/views/dist/controls/customize/words.js +37 -0
  110. package/views/dist/controls/customize.css +54 -0
  111. package/views/dist/controls/date-editor/date-editor.d.ts +2 -1
  112. package/views/dist/controls/date-editor/looks.js +1 -1
  113. package/views/dist/controls/date-editor/map-calendar.js +3 -1
  114. package/views/dist/controls/filter-editor/block.d.ts +31 -0
  115. package/views/dist/controls/filter-editor/block.js +27 -0
  116. package/views/dist/controls/filter-editor/filter-editor.d.ts +58 -0
  117. package/views/dist/controls/filter-editor/filter-editor.js +250 -0
  118. package/views/dist/controls/filter-editor/how.d.ts +23 -0
  119. package/views/dist/controls/filter-editor/how.js +14 -0
  120. package/views/dist/controls/filter-editor/map-filter-body.d.ts +33 -0
  121. package/views/dist/controls/filter-editor/map-filter-body.js +190 -0
  122. package/views/dist/controls/filter-editor/map-rules.d.ts +101 -0
  123. package/views/dist/controls/filter-editor/map-rules.js +304 -0
  124. package/views/dist/controls/filter-editor/parts.d.ts +46 -0
  125. package/views/dist/controls/filter-editor/parts.js +75 -0
  126. package/views/dist/controls/filter-editor/rules.d.ts +142 -0
  127. package/views/dist/controls/filter-editor/rules.js +201 -0
  128. package/views/dist/controls/filter-editor/tokens.d.ts +83 -0
  129. package/views/dist/controls/filter-editor/tokens.js +23 -0
  130. package/views/dist/controls/filter-editor/words.d.ts +74 -0
  131. package/views/dist/controls/filter-editor/words.js +46 -0
  132. package/views/dist/controls/filter-editor.css +142 -0
  133. package/views/dist/controls/group-editor/group-editor.d.ts +56 -0
  134. package/views/dist/controls/group-editor/group-editor.js +126 -0
  135. package/views/dist/controls/group-editor/map-group-body.d.ts +19 -0
  136. package/views/dist/controls/group-editor/map-group-body.js +106 -0
  137. package/views/dist/controls/group-editor/rules.d.ts +48 -0
  138. package/views/dist/controls/group-editor/rules.js +41 -0
  139. package/views/dist/controls/group-editor/tokens.d.ts +15 -0
  140. package/views/dist/controls/group-editor/tokens.js +6 -0
  141. package/views/dist/controls/group-editor/words.d.ts +39 -0
  142. package/views/dist/controls/group-editor/words.js +21 -0
  143. package/views/dist/controls/group-editor.css +20 -0
  144. package/views/dist/controls/index.d.ts +45 -3
  145. package/views/dist/controls/index.js +44 -3
  146. package/views/dist/controls/inline-input/looks.js +1 -1
  147. package/views/dist/controls/input/input.js +10 -4
  148. package/views/dist/controls/internal/editor-parts.d.ts +8 -1
  149. package/views/dist/controls/internal/editor-parts.js +5 -0
  150. package/views/dist/controls/internal/phone.d.ts +5 -4
  151. package/views/dist/controls/internal/phone.js +7 -7
  152. package/views/dist/controls/internal/scroll.js +5 -1
  153. package/views/dist/controls/internal/step-return.d.ts +9 -0
  154. package/views/dist/controls/internal/step-return.js +27 -0
  155. package/views/dist/controls/internal/typed-run.d.ts +2 -0
  156. package/views/dist/controls/internal/typed-run.js +5 -0
  157. package/views/dist/controls/links-editor/links-editor.d.ts +5 -3
  158. package/views/dist/controls/links-editor/links-editor.js +38 -17
  159. package/views/dist/controls/links-editor/map-links-body.js +4 -1
  160. package/views/dist/controls/links-editor.css +1 -1
  161. package/views/dist/controls/menu/map-menu.js +2 -2
  162. package/views/dist/controls/menu-list/menu-list.d.ts +17 -2
  163. package/views/dist/controls/menu-list/menu-list.js +25 -16
  164. package/views/dist/controls/modal/looks.d.ts +4 -0
  165. package/views/dist/controls/modal/looks.js +25 -0
  166. package/views/dist/controls/modal/modal.d.ts +69 -0
  167. package/views/dist/controls/modal/modal.js +62 -0
  168. package/views/dist/controls/modal/tokens.d.ts +192 -0
  169. package/views/dist/controls/modal/tokens.js +50 -0
  170. package/views/dist/controls/modal.css +130 -0
  171. package/views/dist/controls/notice/notice.d.ts +49 -0
  172. package/views/dist/controls/notice/notice.js +35 -0
  173. package/views/dist/controls/notice/tokens.d.ts +99 -0
  174. package/views/dist/controls/notice/tokens.js +27 -0
  175. package/views/dist/controls/notice.css +100 -0
  176. package/views/dist/controls/number-editor/looks.js +1 -1
  177. package/views/dist/controls/number-editor/number-editor.js +1 -1
  178. package/views/dist/controls/option/option.js +3 -1
  179. package/views/dist/controls/option.css +1 -1
  180. package/views/dist/controls/pane/looks.d.ts +4 -0
  181. package/views/dist/controls/pane/looks.js +11 -0
  182. package/views/dist/controls/pane/pane.d.ts +67 -0
  183. package/views/dist/controls/pane/pane.js +99 -0
  184. package/views/dist/controls/pane/state.d.ts +14 -0
  185. package/views/dist/controls/pane/state.js +7 -0
  186. package/views/dist/controls/pane/tokens.d.ts +79 -0
  187. package/views/dist/controls/pane/tokens.js +22 -0
  188. package/views/dist/controls/pane.css +104 -0
  189. package/views/dist/controls/picker/looks.js +1 -1
  190. package/views/dist/controls/picker/map-picker.d.ts +6 -2
  191. package/views/dist/controls/picker/map-picker.js +4 -2
  192. package/views/dist/controls/picker/picker.d.ts +7 -0
  193. package/views/dist/controls/picker/picker.js +57 -8
  194. package/views/dist/controls/picker/rows.d.ts +4 -2
  195. package/views/dist/controls/picker/rows.js +4 -3
  196. package/views/dist/controls/popover/map-popover.d.ts +1 -1
  197. package/views/dist/controls/popover/map-popover.js +2 -2
  198. package/views/dist/controls/popover/popover.js +2 -1
  199. package/views/dist/controls/popover.css +3 -0
  200. package/views/dist/controls/ports-host/map-ports-host.d.ts +7 -0
  201. package/views/dist/controls/ports-host/map-ports-host.js +43 -0
  202. package/views/dist/controls/press/tokens.d.ts +8 -0
  203. package/views/dist/controls/press/tokens.js +4 -0
  204. package/views/dist/controls/press.css +44 -0
  205. package/views/dist/controls/quick-filters/looks.d.ts +11 -0
  206. package/views/dist/controls/quick-filters/looks.js +9 -0
  207. package/views/dist/controls/quick-filters/map-quick-filters-body.d.ts +31 -0
  208. package/views/dist/controls/quick-filters/map-quick-filters-body.js +56 -0
  209. package/views/dist/controls/quick-filters/quick-filters.d.ts +37 -0
  210. package/views/dist/controls/quick-filters/quick-filters.js +89 -0
  211. package/views/dist/controls/quick-filters/reminder.d.ts +18 -0
  212. package/views/dist/controls/quick-filters/reminder.js +41 -0
  213. package/views/dist/controls/quick-filters/rules.d.ts +89 -0
  214. package/views/dist/controls/quick-filters/rules.js +52 -0
  215. package/views/dist/controls/quick-filters/tokens.d.ts +112 -0
  216. package/views/dist/controls/quick-filters/tokens.js +30 -0
  217. package/views/dist/controls/quick-filters/words.d.ts +25 -0
  218. package/views/dist/controls/quick-filters/words.js +13 -0
  219. package/views/dist/controls/quick-filters.css +118 -0
  220. package/views/dist/controls/sheet/bottom-sheet.d.ts +9 -4
  221. package/views/dist/controls/sheet/bottom-sheet.js +4 -4
  222. package/views/dist/controls/sheet/map-sheet.d.ts +4 -1
  223. package/views/dist/controls/sheet/map-sheet.js +19 -6
  224. package/views/dist/controls/sheet/sheet-parts.d.ts +10 -0
  225. package/views/dist/controls/sheet/sheet-parts.js +2 -0
  226. package/views/dist/controls/sort-editor/map-sort-body.d.ts +9 -0
  227. package/views/dist/controls/sort-editor/map-sort-body.js +81 -0
  228. package/views/dist/controls/sort-editor/rules.d.ts +48 -0
  229. package/views/dist/controls/sort-editor/rules.js +24 -0
  230. package/views/dist/controls/sort-editor/sort-editor.d.ts +58 -0
  231. package/views/dist/controls/sort-editor/sort-editor.js +180 -0
  232. package/views/dist/controls/sort-editor/tokens.d.ts +79 -0
  233. package/views/dist/controls/sort-editor/tokens.js +22 -0
  234. package/views/dist/controls/sort-editor/words.d.ts +48 -0
  235. package/views/dist/controls/sort-editor/words.js +25 -0
  236. package/views/dist/controls/sort-editor.css +96 -0
  237. package/views/dist/controls/switch-row/switch-row.d.ts +15 -0
  238. package/views/dist/controls/switch-row/switch-row.js +9 -0
  239. package/views/dist/controls/switch-row/tokens.d.ts +51 -0
  240. package/views/dist/controls/switch-row/tokens.js +15 -0
  241. package/views/dist/controls/switch-row.css +39 -0
  242. package/views/dist/controls/switch.css +1 -1
  243. package/views/dist/controls/tag/tag.js +3 -1
  244. package/views/dist/controls/tag-field/tag-field.d.ts +20 -0
  245. package/views/dist/controls/tag-field/tag-field.js +19 -0
  246. package/views/dist/controls/tag-field/tokens.d.ts +7 -0
  247. package/views/dist/controls/tag-field/tokens.js +4 -0
  248. package/views/dist/controls/tag-field.css +13 -0
  249. package/views/dist/controls/text-editor/looks.js +1 -1
  250. package/views/dist/controls/text-editor/text-editor.js +1 -5
  251. package/views/dist/controls/toast/toast.d.ts +79 -0
  252. package/views/dist/controls/toast/toast.js +101 -0
  253. package/views/dist/controls/toast/tokens.d.ts +100 -0
  254. package/views/dist/controls/toast/tokens.js +27 -0
  255. package/views/dist/controls/toast.css +93 -0
  256. package/views/dist/controls/tokens.js +38 -0
  257. package/views/dist/controls/toolbar/keys.d.ts +3 -0
  258. package/views/dist/controls/toolbar/keys.js +11 -0
  259. package/views/dist/controls/toolbar/looks.d.ts +10 -0
  260. package/views/dist/controls/toolbar/looks.js +40 -0
  261. package/views/dist/controls/toolbar/tokens.d.ts +28 -0
  262. package/views/dist/controls/toolbar/tokens.js +9 -0
  263. package/views/dist/controls/toolbar/toolbar.d.ts +111 -0
  264. package/views/dist/controls/toolbar/toolbar.js +370 -0
  265. package/views/dist/controls/toolbar/words.d.ts +28 -0
  266. package/views/dist/controls/toolbar/words.js +17 -0
  267. package/views/dist/controls/toolbar-button/looks.d.ts +4 -0
  268. package/views/dist/controls/toolbar-button/looks.js +21 -0
  269. package/views/dist/controls/toolbar-button/tokens.d.ts +103 -0
  270. package/views/dist/controls/toolbar-button/tokens.js +28 -0
  271. package/views/dist/controls/toolbar-button/toolbar-button.d.ts +66 -0
  272. package/views/dist/controls/toolbar-button/toolbar-button.js +51 -0
  273. package/views/dist/controls/toolbar-button.css +75 -0
  274. package/views/dist/controls/toolbar.css +65 -0
  275. package/views/dist/controls/tooltip/map-tooltip.d.ts +1 -1
  276. package/views/dist/controls/tooltip/map-tooltip.js +2 -2
  277. package/views/dist/controls/tooltip/tooltip.d.ts +3 -1
  278. package/views/dist/controls/tooltip/tooltip.js +2 -2
  279. package/views/dist/controls/values-editor/looks.js +1 -1
  280. package/views/dist/controls/values-editor/values-editor.js +7 -1
  281. package/views/dist/controls/views-list/map-views-list-body.d.ts +4 -1
  282. package/views/dist/controls/views-list/map-views-list-body.js +128 -4
  283. package/views/dist/controls/views-list/rules.d.ts +26 -0
  284. package/views/dist/controls/views-list/rules.js +63 -0
  285. package/views/dist/controls/views-list/view-menu.d.ts +84 -0
  286. package/views/dist/controls/views-list/view-menu.js +201 -0
  287. package/views/dist/controls/views-list/views-list.d.ts +8 -1
  288. package/views/dist/controls/views-list/views-list.js +18 -3
  289. package/views/dist/controls/views-list/words.d.ts +54 -0
  290. package/views/dist/controls/views-list/words.js +10 -1
  291. package/views/dist/controls/views-list.css +5 -1
  292. package/views/dist/display/date.js +5 -5
  293. package/views/dist/display/format.d.ts +6 -0
  294. package/views/dist/display/format.js +13 -2
  295. package/views/dist/display/index.d.ts +1 -1
  296. package/views/dist/display/index.js +1 -1
  297. package/views/dist/display/options.d.ts +3 -1
  298. package/views/dist/display/range.d.ts +2 -1
  299. package/views/dist/display/range.js +4 -1
  300. package/views/dist/display/use-display-options.d.ts +3 -0
  301. package/views/dist/display/use-display-options.js +10 -2
  302. package/views/dist/display/viewer.d.ts +1 -1
  303. package/views/dist/display/viewer.js +1 -1
  304. package/views/dist/editors/DateEditor.js +11 -9
  305. package/views/dist/editors/relation-panel.js +7 -1
  306. package/views/dist/editors/relation-picker.d.ts +2 -1
  307. package/views/dist/editors/relation-picker.js +4 -3
  308. package/views/dist/editors/relation-source.d.ts +4 -1
  309. package/views/dist/editors/relation-source.js +5 -2
  310. package/views/dist/field-row/editors/RowNumberEditor.js +2 -2
  311. package/views/dist/fields/number-edit.d.ts +6 -0
  312. package/views/dist/fields/number-edit.js +8 -1
  313. package/views/dist/grid/chrome/GridCellEditors.js +2 -2
  314. package/views/dist/grid/chrome/GridColumnDateSection.d.ts +4 -3
  315. package/views/dist/grid/chrome/GridColumnDateSection.js +4 -4
  316. package/views/dist/grid/chrome/GridColumnDurationSection.js +2 -2
  317. package/views/dist/grid/chrome/GridColumnMenu.js +6 -4
  318. package/views/dist/grid/chrome/GridFooter.js +2 -2
  319. package/views/dist/grid/chrome/GridHeader.js +2 -1
  320. package/views/dist/grid/chrome/GridNumberEditor.js +2 -2
  321. package/views/dist/grid/chrome/GridRowCells.js +2 -1
  322. package/views/dist/grid/chrome/GridTextEditor.js +2 -2
  323. package/views/dist/grid/chrome/grid-column-menu-items.js +4 -2
  324. package/views/dist/grid/chrome/grid-editor-layer.d.ts +5 -1
  325. package/views/dist/grid/chrome/grid-editor-layer.js +1 -0
  326. package/views/dist/grid/chrome/grid-fitted-box.d.ts +7 -1
  327. package/views/dist/grid/chrome/grid-fitted-box.js +4 -4
  328. package/views/dist/grid/chrome/useGridBandFigures.js +2 -2
  329. package/views/dist/grid/chrome/useGridFittedWidths.d.ts +3 -0
  330. package/views/dist/grid/chrome/useGridFittedWidths.js +9 -3
  331. package/views/dist/grid/chrome/useGridKeyboard.d.ts +4 -1
  332. package/views/dist/grid/chrome/useGridKeyboard.js +5 -2
  333. package/views/dist/grid/chrome/useGridTableInteractionModel.js +2 -1
  334. package/views/dist/grid/core/clipboard-model.js +9 -4
  335. package/views/dist/grid/core/commit-model.d.ts +7 -0
  336. package/views/dist/grid/core/commit-model.js +5 -1
  337. package/views/dist/grid/core/editing-controller.js +10 -2
  338. package/views/dist/grid/core/editing-model.js +3 -7
  339. package/views/dist/grid/core/undo-owner.d.ts +6 -0
  340. package/views/dist/grid/core/undo-owner.js +13 -0
  341. package/views/dist/grid/core/useGridEditing.d.ts +2 -0
  342. package/views/dist/grid/core/useGridEditing.js +4 -0
  343. package/views/dist/grid/grid.css +240 -0
  344. package/views/dist/grid/looks.d.ts +5 -1
  345. package/views/dist/grid/looks.js +20 -12
  346. package/views/dist/grid-tokens.d.ts +109 -0
  347. package/views/dist/grid-tokens.js +29 -0
  348. package/views/dist/looks/index.d.ts +10 -0
  349. package/views/dist/looks/index.js +10 -0
  350. package/views/dist/looks/pieces.js +20 -0
  351. package/views/dist/model/column-capabilities.d.ts +2 -0
  352. package/views/dist/model/column-filters.d.ts +2 -1
  353. package/views/dist/model/column-from.js +2 -2
  354. package/views/dist/model/relation-filters.d.ts +2 -0
  355. package/views/dist/panels/index.d.ts +2 -2
  356. package/views/dist/panels/index.js +2 -2
  357. package/views/dist/panels/labels.d.ts +4 -0
  358. package/views/dist/panels/labels.js +8 -0
  359. package/views/dist/panels/model.d.ts +14 -1
  360. package/views/dist/panels/quick/model.d.ts +4 -0
  361. package/views/dist/panels/react/customize-body.d.ts +12 -5
  362. package/views/dist/panels/react/customize-body.js +41 -13
  363. package/views/dist/panels/react/customize.d.ts +8 -1
  364. package/views/dist/panels/react/customize.js +11 -6
  365. package/views/dist/panels/react/filter/FilterEditor.js +6 -6
  366. package/views/dist/panels/react/filter/FilterFieldList.js +10 -2
  367. package/views/dist/panels/react/filter/PhoneFilterEditor.d.ts +8 -2
  368. package/views/dist/panels/react/filter/PhoneFilterEditor.js +12 -9
  369. package/views/dist/panels/react/filter/filter-body.d.ts +8 -5
  370. package/views/dist/panels/react/filter/filter-body.js +21 -7
  371. package/views/dist/panels/react/filter/filter-part-body.d.ts +4 -1
  372. package/views/dist/panels/react/filter/filter-part-body.js +3 -1
  373. package/views/dist/panels/react/panel-sheet.d.ts +5 -1
  374. package/views/dist/panels/react/panel-sheet.js +6 -2
  375. package/views/dist/panels/react/panel-step.d.ts +15 -0
  376. package/views/dist/panels/react/panel-step.js +27 -0
  377. package/views/dist/panels/react/quick/QuickFiltersPanel.js +1 -0
  378. package/views/dist/panels/react/sort/SortEditor.d.ts +4 -0
  379. package/views/dist/panels/react/sort/SortEditor.js +5 -2
  380. package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +18 -0
  381. package/views/dist/panels/react/toolbar/ReadyToolbar.js +93 -4
  382. package/views/dist/panels/react/toolbar/Toolbar.js +1 -1
  383. package/views/dist/panels/react/toolbar/ToolbarAsideFilter.js +2 -2
  384. package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +15 -5
  385. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.d.ts +16 -0
  386. package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +50 -0
  387. package/views/dist/panels/react/toolbar/ToolbarFilterSheet.js +3 -1
  388. package/views/dist/panels/react/toolbar/ToolbarFilters.d.ts +4 -1
  389. package/views/dist/panels/react/toolbar/ToolbarFilters.js +38 -23
  390. package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +12 -4
  391. package/views/dist/panels/react/toolbar/ToolbarOptions.js +6 -2
  392. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.d.ts +4 -1
  393. package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +2 -2
  394. package/views/dist/panels/react/toolbar/ToolbarSortPill.d.ts +5 -0
  395. package/views/dist/panels/react/toolbar/ToolbarSortPill.js +15 -6
  396. package/views/dist/panels/react/toolbar/panel-part.d.ts +5 -1
  397. package/views/dist/panels/react/toolbar/panel-part.js +2 -2
  398. package/views/dist/panels/react/toolbar/use-filter-add.d.ts +16 -0
  399. package/views/dist/panels/react/toolbar/use-filter-add.js +32 -0
  400. package/views/dist/panels/react/view-footer.d.ts +1 -1
  401. package/views/dist/panels/react/views-row/ViewPicker.js +25 -4
  402. package/views/dist/panels/react.d.ts +1 -0
  403. package/views/dist/panels/react.js +1 -0
  404. package/views/dist/panels/settings/filter-groups.d.ts +3 -0
  405. package/views/dist/panels/settings/filter-groups.js +72 -7
  406. package/views/dist/panels/settings/filters.d.ts +5 -0
  407. package/views/dist/panels/settings/filters.js +12 -6
  408. package/views/dist/panels/settings/group-buckets.js +1 -0
  409. package/views/dist/panels/views-row/model.d.ts +10 -1
  410. package/views/dist/provider/ViewsProvider.d.ts +7 -1
  411. package/views/dist/provider/ViewsProvider.js +50 -6
  412. package/views/dist/provider/components.d.ts +178 -11
  413. package/views/dist/provider/context.d.ts +6 -0
  414. package/views/dist/provider/moment.d.ts +6 -0
  415. package/views/dist/provider/moment.js +10 -0
  416. package/views/dist/provider/ports.d.ts +18 -6
  417. package/views/dist/provider/ports.js +2 -1
  418. package/views/dist/react.d.ts +2 -2
  419. package/views/dist/react.js +1 -1
  420. package/views/dist/selection/SelectionBar.d.ts +2 -16
  421. package/views/dist/selection/SelectionBar.js +4 -1
  422. package/views/dist/selection/bar-props.d.ts +26 -0
  423. package/views/dist/selection/bar-props.js +1 -0
  424. package/views/dist/selection/index.d.ts +1 -1
  425. package/views/dist/selection/verbs.d.ts +32 -5
  426. package/views/dist/styles.css +1499 -73
  427. package/views/dist/styles.unlayered.css +1497 -70
  428. package/views/docs/contract.md +56 -23
  429. package/views/docs/controls/alert-dialog.md +37 -0
  430. package/views/docs/controls/alert.md +30 -0
  431. package/views/docs/controls/bulk-bar.md +41 -0
  432. package/views/docs/controls/choice.md +25 -0
  433. package/views/docs/controls/collapsible.md +22 -0
  434. package/views/docs/controls/customize.md +17 -0
  435. package/views/docs/controls/filter-editor.md +28 -0
  436. package/views/docs/controls/group-editor.md +11 -0
  437. package/views/docs/controls/modal.md +55 -0
  438. package/views/docs/controls/notice.md +32 -0
  439. package/views/docs/controls/pane.md +25 -0
  440. package/views/docs/controls/popover.md +2 -0
  441. package/views/docs/controls/press.md +9 -0
  442. package/views/docs/controls/quick-filters.md +35 -0
  443. package/views/docs/controls/radio.md +1 -1
  444. package/views/docs/controls/sort-editor.md +27 -0
  445. package/views/docs/controls/switch-row.md +18 -0
  446. package/views/docs/controls/tag-field.md +7 -0
  447. package/views/docs/controls/toast.md +32 -0
  448. package/views/docs/controls/toolbar-button.md +31 -0
  449. package/views/docs/controls/toolbar.md +14 -0
  450. package/views/docs/guides/atoms.md +2 -2
  451. package/views/docs/guides/cells.md +3 -3
  452. package/views/docs/guides/display.md +3 -3
  453. package/views/docs/guides/looks.md +8 -2
  454. package/views/docs/guides/ports.md +6 -6
  455. package/views/docs/guides/selection.md +5 -1
  456. package/views/docs/guides/the-grid.md +2 -2
  457. package/views/docs/guides/the-provider.md +21 -2
  458. package/views/docs/install.md +4 -1
  459. package/views/docs/reference/cells.md +3 -3
  460. package/views/docs/reference/controls.md +403 -16
  461. package/views/docs/reference/display.md +3 -2
  462. package/views/docs/reference/editors-relation.md +1 -1
  463. package/views/docs/reference/looks.md +35 -11
  464. package/views/docs/reference/panels-react.md +11 -10
  465. package/views/docs/reference/panels.md +9 -7
  466. package/views/docs/reference/react.md +20 -13
  467. package/views/docs/reference/selection.md +4 -2
  468. package/views/docs/reference/views.md +8 -6
  469. package/views/skills/views/SKILL.md +2 -2
@@ -0,0 +1,130 @@
1
+ /* The Modal. Every value it draws with is a public name (controls/modal/tokens.ts); this file only says which name each part takes. Its options
2
+ (looks.ts) are data attributes on the frame around it, and each one only chooses other names:
3
+
4
+ data-modal-edge ring · outline a hairline ring set inside its edge, or one clear edge
5
+ data-modal-lines shown · none a line under its head and one over its foot
6
+ data-modal-buttons own · pill its foot's buttons: the Button's own corners, or pills
7
+ data-modal-head bar · margin its head and foot as bars, or standing in its margin
8
+ data-modal-size 28 · 32 · 36 its foot's buttons' height
9
+ data-modal-corners lg · xl · 2xl which radius it takes
10
+ data-modal-smoothing round · smooth how its corners bend
11
+ data-modal-padding 16 · 20 · 24 how far what it holds stands from its edge
12
+ data-modal-behind dim · veil what stands over the page behind it: dark or light
13
+ data-modal-strength light · medium · deep how strong that is
14
+ data-modal-blur 0 · 4 · 8 · 12 · 24 how far the page blurs under it
15
+ data-modal-shadow none · lg · xl · 2xl its shadow
16
+
17
+ data-width on the Modal says how wide it stands, which each one is handed. On the phone a Modal is the Sheet, which none of these
18
+ reach. The rules sit in the components layer, so a utility class still wins. */
19
+ @layer components {
20
+
21
+ /* ── What's behind it, and where it stands: in the middle of the screen, under any popup but the Popover it opens from ──────────── */
22
+ .o-modal-backdrop, .o-modal-viewport { position: fixed; inset: 0; z-index: var(--vk-layer-drawer); }
23
+ /* Opened from inside a Popover, at the popups' layer: over the Popover, added before it, and under what opens from it. */
24
+ .o-modal-backdrop[data-over-popup], .o-modal-viewport[data-over-popup] { z-index: var(--vk-layer-popup); }
25
+ .o-modal-backdrop { background-color: var(--vk-backdrop-modal-light); transition: opacity var(--vk-duration-base) var(--vk-ease-out); }
26
+ .o-modal-backdrop:is([data-starting-style], [data-ending-style]) { opacity: 0; }
27
+ [data-modal-strength="medium"] .o-modal-backdrop { background-color: var(--vk-backdrop-modal-medium); }
28
+ [data-modal-strength="deep"] .o-modal-backdrop { background-color: var(--vk-backdrop-modal-deep); }
29
+ [data-modal-behind="veil"] .o-modal-backdrop { background-color: var(--vk-backdrop-modal-veil-light); }
30
+ [data-modal-behind="veil"][data-modal-strength="medium"] .o-modal-backdrop { background-color: var(--vk-backdrop-modal-veil-medium); }
31
+ [data-modal-behind="veil"][data-modal-strength="deep"] .o-modal-backdrop { background-color: var(--vk-backdrop-modal-veil-deep); }
32
+ /* No blur at all at none, since blur(0) still builds a backdrop root. */
33
+ [data-modal-blur="4"] .o-modal-backdrop { -webkit-backdrop-filter: blur(var(--vk-blur-xs)); backdrop-filter: blur(var(--vk-blur-xs)); }
34
+ [data-modal-blur="8"] .o-modal-backdrop { -webkit-backdrop-filter: blur(var(--vk-blur-sm)); backdrop-filter: blur(var(--vk-blur-sm)); }
35
+ [data-modal-blur="12"] .o-modal-backdrop { -webkit-backdrop-filter: blur(var(--vk-blur-md)); backdrop-filter: blur(var(--vk-blur-md)); }
36
+ [data-modal-blur="24"] .o-modal-backdrop { -webkit-backdrop-filter: blur(var(--vk-blur-lg)); backdrop-filter: blur(var(--vk-blur-lg)); }
37
+ /* It keeps 48 from the screen's edges; a screen drawn on a page sets --modal-room to keep less. */
38
+ .o-modal-viewport { box-sizing: border-box; display: flex; align-items: center; justify-content: center; padding: var(--modal-room, calc(var(--vk-spacing) * 12)); overflow-y: auto; outline: none; }
39
+
40
+ /* ── The shell: on the overlay's ground, as wide as it is handed, never taller than the screen ───────────────────────────────────── */
41
+ .o-modal {
42
+ --modal-corners: var(--vk-radius-xl); --modal-pad: calc(var(--vk-spacing) * 5); --modal-width: var(--vk-container-2xl);
43
+ box-sizing: border-box; position: relative; display: flex; flex-direction: column; width: 100%; max-width: var(--modal-width); max-height: 100%; min-width: 0;
44
+ border-radius: var(--modal-corners); background-color: var(--vk-overlay); box-shadow: var(--vk-shadow-2xl); color: var(--vk-fg); outline: none;
45
+ transition: opacity var(--vk-duration-base) var(--vk-ease-out), scale var(--vk-duration-base) var(--vk-ease-out);
46
+ }
47
+ .o-modal[data-width="sm"] { --modal-width: var(--vk-container-lg); }
48
+ .o-modal[data-width="lg"] { --modal-width: var(--vk-container-4xl); }
49
+ .o-modal[data-width="xl"] { --modal-width: var(--vk-container-5xl); }
50
+ .o-modal:is([data-starting-style], [data-ending-style]) { opacity: 0; scale: var(--vk-push-scale); }
51
+ .o-modal[data-ending-style] { transition-duration: var(--vk-duration-fast); transition-timing-function: var(--vk-ease-in); }
52
+ /* An Alert Dialog over it steps it back. */
53
+ .o-modal[data-nested-dialog-open] { scale: var(--vk-press-scale); }
54
+ [data-modal-corners="lg"] .o-modal { --modal-corners: var(--vk-radius-lg); }
55
+ [data-modal-corners="2xl"] .o-modal { --modal-corners: var(--vk-radius-2xl); }
56
+ [data-modal-padding="16"] .o-modal { --modal-pad: calc(var(--vk-spacing) * 4); }
57
+ [data-modal-padding="24"] .o-modal { --modal-pad: calc(var(--vk-spacing) * 6); }
58
+ [data-modal-shadow="none"] .o-modal { box-shadow: none; }
59
+ [data-modal-shadow="lg"] .o-modal { box-shadow: var(--vk-shadow-lg); }
60
+ [data-modal-shadow="xl"] .o-modal { box-shadow: var(--vk-shadow-xl); }
61
+
62
+ /* What it holds, inside its edge. Ring: no edge of its own, a hairline ring 3 inside it, and what it holds 4 in, so a line under the
63
+ head runs ring to ring. Outline: one clear edge, and what it holds reaches it. The line is drawn as two shapes, never a border: the
64
+ line's colour (::before), and the ground just inside it (::after), one line narrower. Each takes its own corner, its inset less, so
65
+ the line follows the edge's corners exactly, round or smooth. */
66
+ .o-modal-cut { position: relative; isolation: isolate; box-sizing: border-box; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; max-height: 100%; padding: var(--vk-spacing); border-radius: inherit; background-color: inherit; }
67
+ .o-modal-cut::before, .o-modal-cut::after { content: ""; position: absolute; z-index: -1; border-radius: var(--modal-c); pointer-events: none; }
68
+ .o-modal-cut::before { --modal-c: calc(var(--modal-corners) - var(--vk-spacing) * 0.75); inset: calc(var(--vk-spacing) * 0.75); background-color: var(--vk-border-modal-ring); }
69
+ .o-modal-cut::after { --modal-c: calc(var(--modal-corners) - var(--vk-spacing) * 0.75 - var(--vk-border-width)); inset: calc(var(--vk-spacing) * 0.75 + var(--vk-border-width)); background-color: var(--vk-overlay); }
70
+ [data-modal-edge="outline"] .o-modal-cut { padding: 0; }
71
+ [data-modal-edge="outline"] .o-modal-cut::before { --modal-c: var(--modal-corners); inset: 0; background-color: var(--vk-border-modal-edge); }
72
+ [data-modal-edge="outline"] .o-modal-cut::after { --modal-c: calc(var(--modal-corners) - var(--vk-border-width)); inset: var(--vk-border-width); }
73
+
74
+ /* ── Its head: a bar, or standing in its margin; its mark, where it was opened, its title, then Open as a page and the X ─────────── */
75
+ .o-modal-head { box-sizing: border-box; display: flex; align-items: center; gap: calc(var(--vk-spacing) * 2); flex: none; min-width: 0; min-height: calc(var(--vk-spacing) * 11); padding: 0 calc(var(--vk-spacing) * 2) 0 var(--modal-pad); }
76
+ [data-modal-head="margin"] .o-modal-head { min-height: 0; padding: calc(var(--vk-spacing) * 4) calc(var(--vk-spacing) * 3) 0 var(--modal-pad); }
77
+ [data-modal-lines="shown"] .o-modal-head { border-bottom: var(--vk-border-width) solid var(--vk-border); }
78
+ /* Its line under the head's height: the head is 11 tall above its line. */
79
+ [data-modal-lines="shown"]:not([data-modal-head="margin"]) .o-modal-head { min-height: calc(var(--vk-spacing) * 11 + var(--vk-border-width)); }
80
+ [data-modal-lines="shown"][data-modal-head="margin"] .o-modal-head { padding-bottom: calc(var(--vk-spacing) * 3); }
81
+ .o-modal-title { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--vk-font-size-base); line-height: calc(var(--vk-font-size-base) * var(--vk-line-height-base)); font-weight: var(--vk-font-weight-medium); }
82
+ .o-modal-path ~ .o-modal-title { font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); }
83
+ .o-modal-tools { display: flex; align-items: center; gap: calc(var(--vk-spacing) * 0.5); flex: none; margin-left: auto; }
84
+ .o-modal-mark { display: grid; place-items: center; flex: none; width: calc(var(--vk-spacing) * 5); height: calc(var(--vk-spacing) * 5); border-radius: var(--vk-radius-sm); background-color: var(--vk-brand); color: var(--vk-fg-on-brand); }
85
+ .o-modal-mark > svg { width: calc(var(--vk-spacing) * 3.25); height: calc(var(--vk-spacing) * 3.25); }
86
+ [data-modal-head="margin"] .o-modal-mark { width: calc(var(--vk-spacing) * 4); background-color: transparent; color: var(--vk-fg-subtle); }
87
+ [data-modal-head="margin"] .o-modal-mark > svg { width: calc(var(--vk-spacing) * 4); height: calc(var(--vk-spacing) * 4); }
88
+ /* Where it was opened gives way before its title: the path's words shorten first. */
89
+ .o-modal-path { display: flex; align-items: center; gap: calc(var(--vk-spacing) * 1.5); flex: 0 100 auto; min-width: calc(var(--vk-spacing) * 16); color: var(--vk-fg-subtlest); }
90
+ .o-modal-path > svg { flex: none; width: calc(var(--vk-spacing) * 3.5); height: calc(var(--vk-spacing) * 3.5); }
91
+ .o-modal-chip { display: inline-flex; align-items: center; gap: calc(var(--vk-spacing) * 1.5); min-width: 0; height: calc(var(--vk-spacing) * 6.5); padding: 0 calc(var(--vk-spacing) * 2.5) 0 calc(var(--vk-spacing) * 2); border-radius: var(--vk-radius-full); background-color: var(--vk-overlay-card); color: var(--vk-fg-subtle); font-size: var(--vk-font-size-sm); font-weight: var(--vk-font-weight-medium); white-space: nowrap; }
92
+ .o-modal-chip > :first-child { flex: none; }
93
+ .o-modal-chip > svg { width: calc(var(--vk-spacing) * 3.5); height: calc(var(--vk-spacing) * 3.5); }
94
+ .o-modal-chip-word { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
95
+
96
+ /* ── What it holds: it scrolls between a head and a foot that stay ───────────────────────────────────────────────────────────────── */
97
+ .o-modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--modal-pad); }
98
+ .o-modal-failed { margin-bottom: calc(var(--vk-spacing) * 4); }
99
+
100
+ /* ── Its foot: what stands at its start, then the way out and the action at its end ──────────────────────────────────────────────── */
101
+ .o-modal-foot { box-sizing: border-box; display: flex; align-items: center; gap: calc(var(--vk-spacing) * 2); flex: none; min-height: calc(var(--vk-spacing) * 11); padding: 0 calc(var(--vk-spacing) * 2); }
102
+ [data-modal-head="margin"] .o-modal-foot { min-height: 0; padding: calc(var(--vk-spacing) * 1) calc(var(--vk-spacing) * 4) calc(var(--vk-spacing) * 4); }
103
+ [data-modal-lines="shown"] .o-modal-foot { border-top: var(--vk-border-width) solid var(--vk-border); }
104
+ [data-modal-lines="shown"]:not([data-modal-head="margin"]) .o-modal-foot { min-height: calc(var(--vk-spacing) * 11 + var(--vk-border-width)); }
105
+ [data-modal-lines="shown"][data-modal-head="margin"] .o-modal-foot { padding-top: calc(var(--vk-spacing) * 3); }
106
+ .o-modal-start { display: flex; align-items: center; gap: calc(var(--vk-spacing) * 2); min-width: 0; }
107
+ .o-modal-end { display: flex; align-items: center; gap: calc(var(--vk-spacing) * 2); margin-left: auto; }
108
+ .o-modal-end > .o-button { height: calc(var(--vk-spacing) * 7); --button-side: calc(var(--vk-spacing) * 7); padding-inline: calc(var(--vk-spacing) * 3); }
109
+ [data-modal-size="32"] .o-modal-end > .o-button { height: calc(var(--vk-spacing) * 8); --button-side: calc(var(--vk-spacing) * 8); }
110
+ [data-modal-size="36"] .o-modal-end > .o-button { height: calc(var(--vk-spacing) * 9); --button-side: calc(var(--vk-spacing) * 9); padding-inline: calc(var(--vk-spacing) * 3.5); }
111
+ [data-modal-buttons="pill"] .o-modal-foot .o-button:not(.o-button-round) { --button-r: var(--vk-radius-full); }
112
+
113
+ /* ── Its corners smooth: the smooth outline (smooth.css), Apple's curve as measured, so every browser that knows shape() shows it; one that doesn't
114
+ keeps the corners above. The Modal keeps its shadow, which a cut would take with it, so .o-modal-cut inside it is cut instead, and
115
+ the line's two shapes each by the same outline at its own corner, so the ring stays the edge's curve, set inside it ───────────── */
116
+ @supports (clip-path: shape(from 0 0, curve by 1px 1px with 1px 0 / 1px 0, close)) {
117
+ [data-modal-smoothing="smooth"] .o-modal { background-color: transparent; }
118
+ [data-modal-smoothing="smooth"] .o-modal-cut { --modal-c: var(--modal-corners); background-color: var(--vk-overlay); }
119
+ [data-modal-smoothing="smooth"] .o-modal-cut::before, [data-modal-smoothing="smooth"] .o-modal-cut::after { border-radius: 0; }
120
+ [data-modal-smoothing="smooth"] .o-modal-cut, [data-modal-smoothing="smooth"] .o-modal-cut::before, [data-modal-smoothing="smooth"] .o-modal-cut::after {
121
+ --smooth-t: var(--modal-c); clip-path: shape(var(--smooth-outline));
122
+ }
123
+ }
124
+
125
+ /* Less motion: a fade, no scale. */
126
+ @media (prefers-reduced-motion: reduce) {
127
+ .o-modal { transition: opacity var(--vk-duration-base) var(--vk-ease-out); }
128
+ .o-modal:is([data-starting-style], [data-ending-style], [data-nested-dialog-open]) { scale: 1; }
129
+ }
130
+ }
@@ -0,0 +1,49 @@
1
+ import * as React from "react";
2
+ export type NoticeMeaning = "information" | "success" | "warning" | "danger";
3
+ export declare const NOTICE_ICONS: Record<NoticeMeaning, string[]>;
4
+ /** An action drawn from its words: the Button's text kind, extra small. */
5
+ export interface NoticeAction {
6
+ label: string;
7
+ onClick?: () => void;
8
+ }
9
+ /** The words a Notice draws of its own: Retry, while it retries, and the ×'s name. */
10
+ export type NoticeWords = {
11
+ retry: string;
12
+ retrying: string;
13
+ dismiss: string;
14
+ };
15
+ /** Its words in English. */
16
+ export declare const NOTICE_WORDS: NoticeWords;
17
+ export interface NoticeProps {
18
+ /** What it means: worth knowing (information, the default), done (success), careful (warning), wrong
19
+ * (danger), or a plain fact with no colour of its own (neutral: where something came from, who can see it).
20
+ * The icon and the ground say it; the words stay in the text colour. */
21
+ meaning?: NoticeMeaning | "neutral";
22
+ /** Its own icon (a 16px icon, drawn in its meaning's colour), or false for none. Left out, its meaning's. */
23
+ icon?: React.ReactNode | false;
24
+ /** A title over the sentence, when one line isn't enough. */
25
+ title?: React.ReactNode;
26
+ /** The sentence, or several paragraphs as <p>, 8px apart. Wrong says what still works, and how to fix it. */
27
+ children: React.ReactNode;
28
+ /** What to do about it, at most two: the verb that happens ("Assign owners"), the way out last ("Not now"). Each is
29
+ * { label } for the text Button, or any element: a kit Button is drawn at the notice's size (extra small) whatever it
30
+ * was given, so an outline first then words; a link is the Button drawn as a link. */
31
+ actions?: (NoticeAction | React.ReactElement)[];
32
+ /** Retry, first among the actions: it turns into "Retrying…" while it works, and when it works the notice goes. */
33
+ onRetry?: () => Promise<unknown>;
34
+ /** Put away once read: × at the end, named "Dismiss". A notice about something still wrong has none. */
35
+ dismissible?: boolean;
36
+ onDismiss?: () => void;
37
+ /** An error that has just happened: read out at once (role="alert") rather than politely. */
38
+ urgent?: boolean;
39
+ /** It appears because of something just done: it fades in. */
40
+ arrived?: boolean;
41
+ className?: string;
42
+ /** Its × drawn as under the pointer or in focus, as a page that shows it draws it. */
43
+ "data-force"?: "hover" | "focus";
44
+ /** Its own words, over the English: Retry, Retrying…, and the ×'s name. */
45
+ words?: Partial<NoticeWords>;
46
+ }
47
+ /** A sentence set into the page on its meaning's ground: worth knowing, done, careful, wrong or a plain fact (neutral). It can
48
+ * carry what to do about it, a title, or a way to put it away. */
49
+ export declare function Notice({ meaning, icon, title, children, actions, onRetry, dismissible, onDismiss, urgent, arrived, className, "data-force": force, words }: NoticeProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { cx } from "../../internal/cx.js";
4
+ import { Button } from "../button/button.js";
5
+ import { phoneMark, usePhoneForm } from "../internal/phone.js";
6
+ export const NOTICE_ICONS = {
7
+ information: ["M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0", "M12 9h.01", "M11 12h1v4h1"],
8
+ success: ["M3 12a9 9 0 1 0 18 0a9 9 0 1 0 -18 0", "M9 12l2 2l4 -4"],
9
+ warning: ["M12 9v4", "M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0", "M12 16h.01"],
10
+ danger: ["M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0", "M12 8v4", "M12 16h.01"],
11
+ };
12
+ const X = ["M18 6l-12 12", "M6 6l12 12"];
13
+ const glyph = (paths, className, strokeWidth = 2) => (_jsx("svg", { className: className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: paths.map((d) => _jsx("path", { d: d }, d)) }));
14
+ const still = () => typeof matchMedia !== "undefined" && matchMedia("(prefers-reduced-motion: reduce)").matches;
15
+ export const NOTICE_WORDS = { retry: "Retry", retrying: "Retrying…", dismiss: "Dismiss" };
16
+ export function Notice({ meaning = "information", icon, title, children, actions = [], onRetry, dismissible, onDismiss, urgent, arrived, className, "data-force": force, words }) {
17
+ const said = { ...NOTICE_WORDS, ...words }, phone = usePhoneForm();
18
+ const [phase, setPhase] = React.useState("here"), [retrying, setRetrying] = React.useState(false);
19
+ const away = () => { if (still()) {
20
+ setPhase("gone");
21
+ onDismiss?.();
22
+ }
23
+ else
24
+ setPhase("going"); };
25
+ const retry = () => { if (retrying || !onRetry)
26
+ return; setRetrying(true); onRetry().then(away, () => setRetrying(false)); };
27
+ if (phase === "gone")
28
+ return null;
29
+ const acts = (onRetry || actions.length > 0) && (_jsxs(_Fragment, { children: [onRetry && _jsx(Button, { kind: "text", size: "xs", "aria-busy": retrying || undefined, onClick: retry, children: retrying ? said.retrying : said.retry }), actions.map((a, i) => !React.isValidElement(a) ? _jsx(Button, { kind: "text", size: "xs", onClick: a.onClick, children: a.label }, a.label)
30
+ : React.cloneElement(a, { key: a.key ?? i, ...(a.type === Button ? { size: "xs" } : {}) }))] }));
31
+ return (_jsxs("div", { role: urgent ? "alert" : "status", "data-meaning": meaning, "data-kit": "notice", ...phoneMark(phone), className: cx("o-notice o-smooth o-smooth-ease", title != null && "o-notice-titled", arrived && "o-notice-arrived", phase === "going" && "o-notice-going", className), onTransitionEnd: (e) => { if (phase === "going" && e.target === e.currentTarget && e.propertyName === "opacity") {
32
+ setPhase("gone");
33
+ onDismiss?.();
34
+ } }, children: [icon === false ? null : icon != null ? _jsx("span", { className: "o-notice-icon", "aria-hidden": "true", children: icon }) : glyph(NOTICE_ICONS[meaning === "neutral" ? "information" : meaning], "o-notice-icon"), _jsxs("div", { className: "o-notice-body", children: [title != null && _jsx("p", { className: "o-notice-title", children: title }), _jsx("div", { className: "o-notice-text", children: children }), title != null && acts && _jsx("div", { className: "o-notice-below", children: acts })] }), title == null && acts && _jsx("div", { className: "o-notice-acts", children: acts }), dismissible && _jsx(Button, { kind: "quiet", size: "xs", shape: "icon", className: "o-notice-x", "aria-label": said.dismiss, "data-force": force, icon: glyph(X, "", 2.25), onClick: away })] }));
35
+ }
@@ -0,0 +1,99 @@
1
+ export declare const NOTICE_TOKENS: readonly [{
2
+ readonly name: "--vk-spacing";
3
+ readonly kind: "size";
4
+ readonly outright: "--spacing";
5
+ }, {
6
+ readonly name: "--vk-radius-lg";
7
+ readonly kind: "size";
8
+ readonly outright: "--radius-lg";
9
+ }, {
10
+ readonly name: "--vk-fg";
11
+ readonly kind: "colour";
12
+ readonly outright: "--text";
13
+ }, {
14
+ readonly name: "--vk-font-size-sm";
15
+ readonly kind: "size";
16
+ readonly outright: "--text-sm";
17
+ }, {
18
+ readonly name: "--vk-line-height-sm";
19
+ readonly kind: "size";
20
+ readonly outright: "--text-sm--line-height";
21
+ }, {
22
+ readonly name: "--vk-duration-fast";
23
+ readonly kind: "motion";
24
+ readonly outright: "--duration-fast";
25
+ }, {
26
+ readonly name: "--vk-ease-in";
27
+ readonly kind: "motion";
28
+ readonly outright: "--ease-in";
29
+ }, {
30
+ readonly name: "--vk-info-subtler";
31
+ readonly kind: "colour";
32
+ readonly outright: "--background-information-subtler";
33
+ }, {
34
+ readonly name: "--vk-info";
35
+ readonly kind: "colour";
36
+ readonly outright: "--text-information";
37
+ }, {
38
+ readonly name: "--vk-success-subtler";
39
+ readonly kind: "colour";
40
+ readonly outright: "--background-success-subtler";
41
+ }, {
42
+ readonly name: "--vk-success";
43
+ readonly kind: "colour";
44
+ readonly outright: "--text-success";
45
+ }, {
46
+ readonly name: "--vk-warning-subtler";
47
+ readonly kind: "colour";
48
+ readonly outright: "--background-warning-subtler";
49
+ }, {
50
+ readonly name: "--vk-warning";
51
+ readonly kind: "colour";
52
+ readonly outright: "--text-warning";
53
+ }, {
54
+ readonly name: "--vk-danger-subtler";
55
+ readonly kind: "colour";
56
+ readonly outright: "--background-danger-subtler";
57
+ }, {
58
+ readonly name: "--vk-danger";
59
+ readonly kind: "colour";
60
+ readonly outright: "--text-danger";
61
+ }, {
62
+ readonly name: "--vk-sunken";
63
+ readonly kind: "colour";
64
+ readonly outright: "--surface-sunken";
65
+ }, {
66
+ readonly name: "--vk-border-subtle";
67
+ readonly kind: "colour";
68
+ readonly outright: "--border-subtle";
69
+ }, {
70
+ readonly name: "--vk-border-width";
71
+ readonly kind: "size";
72
+ readonly outright: "--border-width";
73
+ }, {
74
+ readonly name: "--vk-fg-subtle";
75
+ readonly kind: "colour";
76
+ readonly outright: "--text-subtle";
77
+ }, {
78
+ readonly name: "--vk-fg-subtlest";
79
+ readonly kind: "colour";
80
+ readonly outright: "--text-subtlest";
81
+ }, {
82
+ readonly name: "--vk-font-weight-semibold";
83
+ readonly kind: "size";
84
+ readonly outright: "--font-weight-semibold";
85
+ }, {
86
+ readonly name: "--vk-duration-base";
87
+ readonly kind: "motion";
88
+ readonly outright: "--duration-base";
89
+ }, {
90
+ readonly name: "--vk-ease-out";
91
+ readonly kind: "motion";
92
+ readonly outright: "--ease-out";
93
+ }, {
94
+ readonly name: "--vk-corner-smoothing";
95
+ readonly kind: "size";
96
+ readonly outright: "--corner-smoothing";
97
+ }];
98
+ /** The Notice's own machinery: its meaning's ground and edge, and how it fits its actions. */
99
+ export declare const NOTICE_PRIVATE: readonly ["--notice-"];
@@ -0,0 +1,27 @@
1
+ export const NOTICE_TOKENS = [
2
+ { name: "--vk-spacing", kind: "size", outright: "--spacing" },
3
+ { name: "--vk-radius-lg", kind: "size", outright: "--radius-lg" },
4
+ { name: "--vk-fg", kind: "colour", outright: "--text" },
5
+ { name: "--vk-font-size-sm", kind: "size", outright: "--text-sm" },
6
+ { name: "--vk-line-height-sm", kind: "size", outright: "--text-sm--line-height" },
7
+ { name: "--vk-duration-fast", kind: "motion", outright: "--duration-fast" },
8
+ { name: "--vk-ease-in", kind: "motion", outright: "--ease-in" },
9
+ { name: "--vk-info-subtler", kind: "colour", outright: "--background-information-subtler" },
10
+ { name: "--vk-info", kind: "colour", outright: "--text-information" },
11
+ { name: "--vk-success-subtler", kind: "colour", outright: "--background-success-subtler" },
12
+ { name: "--vk-success", kind: "colour", outright: "--text-success" },
13
+ { name: "--vk-warning-subtler", kind: "colour", outright: "--background-warning-subtler" },
14
+ { name: "--vk-warning", kind: "colour", outright: "--text-warning" },
15
+ { name: "--vk-danger-subtler", kind: "colour", outright: "--background-danger-subtler" },
16
+ { name: "--vk-danger", kind: "colour", outright: "--text-danger" },
17
+ { name: "--vk-sunken", kind: "colour", outright: "--surface-sunken" },
18
+ { name: "--vk-border-subtle", kind: "colour", outright: "--border-subtle" },
19
+ { name: "--vk-border-width", kind: "size", outright: "--border-width" },
20
+ { name: "--vk-fg-subtle", kind: "colour", outright: "--text-subtle" },
21
+ { name: "--vk-fg-subtlest", kind: "colour", outright: "--text-subtlest" },
22
+ { name: "--vk-font-weight-semibold", kind: "size", outright: "--font-weight-semibold" },
23
+ { name: "--vk-duration-base", kind: "motion", outright: "--duration-base" },
24
+ { name: "--vk-ease-out", kind: "motion", outright: "--ease-out" },
25
+ { name: "--vk-corner-smoothing", kind: "size", outright: "--corner-smoothing" },
26
+ ];
27
+ export const NOTICE_PRIVATE = ["--notice-"];
@@ -0,0 +1,100 @@
1
+ /* The Notice. Every value it draws with is a public name (controls/notice/tokens.ts); this file only says which name
2
+ each part and meaning takes. Its actions are any
3
+ Button, a label's the Button's text kind; its × the quiet Button.
4
+
5
+ The rules sit in the components layer, so a utility class on a notice still wins. */
6
+ @layer components {
7
+
8
+ /* ── The notice: its meaning's ground, one step stronger than the palest, so it reads as its colour; no
9
+ edge (neutral, below, has a hairline); the radius's corners, 10px by 12px; the words in the text colour, never the meaning's ─────── */
10
+ .o-notice {
11
+ display: flex; align-items: flex-start; gap: calc(var(--vk-spacing) * 2.5); box-sizing: border-box; min-width: 0;
12
+ padding: calc(var(--vk-spacing) * 2.5) calc(var(--vk-spacing) * 3); border-radius: var(--vk-radius-lg); background-color: var(--notice-ground);
13
+ color: var(--vk-fg); font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm));
14
+ transition: opacity var(--vk-duration-fast) var(--vk-ease-in), translate var(--vk-duration-fast) var(--vk-ease-in);
15
+ }
16
+ /* The icon carries the meaning: 16px, level with the first line, 10px before the words. */
17
+ .o-notice-icon { flex: none; width: calc(var(--vk-spacing) * 4); height: calc(var(--vk-spacing) * 4); margin-top: calc(var(--vk-spacing) * 0.5); }
18
+ .o-notice[data-meaning="information"] { --notice-ground: var(--vk-info-subtler); }
19
+ .o-notice[data-meaning="information"] > .o-notice-icon { color: var(--vk-info); }
20
+ .o-notice[data-meaning="success"] { --notice-ground: var(--vk-success-subtler); }
21
+ .o-notice[data-meaning="success"] > .o-notice-icon { color: var(--vk-success); }
22
+ .o-notice[data-meaning="warning"] { --notice-ground: var(--vk-warning-subtler); }
23
+ .o-notice[data-meaning="warning"] > .o-notice-icon { color: var(--vk-warning); }
24
+ .o-notice[data-meaning="danger"] { --notice-ground: var(--vk-danger-subtler); }
25
+ .o-notice[data-meaning="danger"] > .o-notice-icon { color: var(--vk-danger); }
26
+ .o-notice-body { flex: 1 1 calc(var(--vk-spacing) * 55); min-width: 0; display: grid; gap: calc(var(--vk-spacing) * 0.5); }
27
+ .o-notice-body > p { margin: 0; }
28
+
29
+ /* ── Neutral: a plain fact with no colour of its own, a quiet well: the page's
30
+ sunken ground, a hairline edge inside, its icon in the quieter text colour ──────────────────────────────── */
31
+ .o-notice[data-meaning="neutral"] { --notice-ground: var(--vk-sunken); --notice-edge: var(--vk-border-subtle); box-shadow: inset 0 0 0 var(--vk-border-width) var(--vk-border-subtle); }
32
+ .o-notice[data-meaning="neutral"] > .o-notice-icon { color: var(--vk-fg-subtle); }
33
+ /* Its own icon, any 16px icon, in its meaning's colour like the meaning's own. */
34
+ span.o-notice-icon { display: grid; place-items: center; }
35
+ span.o-notice-icon > svg { width: 100%; height: 100%; }
36
+ /* Paragraphs, 8px apart; a link in its sentence underlined in the words' colour, as shadcn's. */
37
+ .o-notice-text > p { margin: 0; }
38
+ .o-notice-text > p + p { margin-top: calc(var(--vk-spacing) * 2); }
39
+ .o-notice-text a {
40
+ color: inherit; text-decoration: underline; text-decoration-thickness: var(--vk-border-width);
41
+ text-underline-offset: calc(var(--vk-spacing) * 0.75); text-decoration-color: var(--vk-fg-subtlest);
42
+ }
43
+ @media (hover: hover) { .o-notice-text a:hover { text-decoration-color: currentColor; } }
44
+
45
+ /* ── With a title: the title in semibold, the sentence under it quieter, 12px by 14px; its actions under
46
+ the sentence ──────────────────────────────────────────────────────────────────────────────────── */
47
+ .o-notice.o-notice-titled { gap: calc(var(--vk-spacing) * 3); padding: calc(var(--vk-spacing) * 3) calc(var(--vk-spacing) * 3.5); }
48
+ .o-notice-title { font-weight: var(--vk-font-weight-semibold); }
49
+ .o-notice-titled .o-notice-text { color: var(--vk-fg-subtle); }
50
+ .o-notice-below { display: flex; gap: calc(var(--vk-spacing) * 1); margin: calc(var(--vk-spacing) * 1.5) 0 0 calc(var(--vk-spacing) * -2.5); }
51
+ /* A first action that isn't the text kind (an outline) stands with its edge at the sentence's first letter. */
52
+ .o-notice-below:has(> :first-child:not(.o-button-text)) { margin-left: 0; }
53
+
54
+ /* ── Its actions at the end of its line; × puts it away: the Button, quiet, icon only, extra small ──── */
55
+ .o-notice-acts { flex: none; display: flex; align-items: center; gap: calc(var(--vk-spacing) * 0.5); margin: calc(var(--vk-spacing) * -1) calc(var(--vk-spacing) * -1.5) calc(var(--vk-spacing) * -1) 0; }
56
+ .o-button.o-notice-x { flex: none; margin: calc(var(--vk-spacing) * -1) calc(var(--vk-spacing) * -1.5) calc(var(--vk-spacing) * -1) 0; }
57
+ .o-notice-acts + .o-button.o-notice-x { margin-left: calc(var(--vk-spacing) * -2); }
58
+
59
+ /* ── Arrived because of something just done, it fades in; put away or resolved, it fades out ────────── */
60
+ .o-notice.o-notice-arrived { animation: vk-notice-fade-in var(--vk-duration-base) var(--vk-ease-out); }
61
+ .o-notice.o-notice-going { opacity: 0; translate: 0 calc(var(--vk-spacing) * -0.5); }
62
+
63
+ /* ── On the phone the actions drop under the sentence, lined up with it; × stays at the end of the first
64
+ line ────────────────────────────────────────────────────────────────────────────────────────────── */
65
+ .o-notice:where([data-vk-phone], [data-vk-phone] *) { flex-wrap: wrap; }
66
+ .o-notice-body:where([data-vk-phone], [data-vk-phone] *) { flex: 1 1 0; }
67
+ .o-notice:where([data-vk-phone], [data-vk-phone] *) > .o-notice-acts { order: 3; flex-basis: 100%; box-sizing: border-box; margin: calc(var(--vk-spacing) * 0.5) 0 calc(var(--vk-spacing) * -1.5); padding-left: calc(var(--vk-spacing) * 4); }
68
+ .o-notice-acts:where([data-vk-phone], [data-vk-phone] *) + .o-button.o-notice-x { margin-left: 0; }
69
+ /* A first action that isn't the text kind stands with its edge at the sentence's first letter: the icon and its gap. */
70
+ .o-notice:where([data-vk-phone], [data-vk-phone] *):has(> .o-notice-icon) > .o-notice-acts:has(> :first-child:not(.o-button-text)) { padding-left: calc(var(--vk-spacing) * 6.5); }
71
+ /* With no icon the sentence starts at the padding: so do the actions, the text kind's words with it. */
72
+ .o-notice:where([data-vk-phone], [data-vk-phone] *):not(:has(> .o-notice-icon)) > .o-notice-acts { padding-left: 0; }
73
+ .o-notice:where([data-vk-phone], [data-vk-phone] *):not(:has(> .o-notice-icon)) > .o-notice-acts:has(> :first-child.o-button-text) { margin-left: calc(var(--vk-spacing) * -2.5); }
74
+
75
+ /* Under reduced motion it just goes. */
76
+ @media (prefers-reduced-motion: reduce) { .o-notice { transition: none; } .o-notice.o-notice-arrived { animation: none; } }
77
+ /* ── Its corners smooth: following corner-smoothing, drawn with the smooth outline
78
+ (ViewKit's smooth.css) in every browser that knows shape(); one that doesn't keeps the corners above. Its round part is fitted to its
79
+ one line, as a control's is. Its ×, 6px in, rings itself 2px out, so the notice is never clipped: its edge (::before, neutral's
80
+ hairline, or its ground where it has none) and its ground (::after, a line in, its corner a line smaller) are layers inside it,
81
+ as the Popover's are. ── */
82
+ @supports (clip-path: shape(evenodd from 0 0, curve by 1px 1px with 1px 0 / 1px 0, close, move to 0 0, hline to 1px, close)) and (width: calc(tan(atan2(1px, 1px)) * 1px)) {
83
+ .o-notice {
84
+ --smooth-amount: var(--vk-corner-smoothing); --notice-side: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm) + var(--vk-spacing) * 5);
85
+ --notice-fit: min(var(--vk-radius-lg), var(--notice-side) / (2 + 2 * var(--smooth-amount, 0.7)));
86
+ --smooth-t: var(--notice-fit); --smooth-side: var(--notice-side);
87
+ position: relative; isolation: isolate; border-radius: var(--notice-fit); background-color: transparent; box-shadow: none;
88
+ }
89
+ .o-notice[data-meaning="neutral"] { box-shadow: none; }
90
+ .o-notice::before, .o-notice::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit; }
91
+ .o-notice::before { background-color: var(--notice-edge, var(--notice-ground)); clip-path: shape(var(--smooth-outline)); }
92
+ .o-notice::after {
93
+ --smooth-t: max(0px, var(--notice-fit) - var(--vk-border-width));
94
+ inset: var(--vk-border-width); border-radius: calc(var(--notice-fit) - var(--vk-border-width)); background-color: var(--notice-ground); clip-path: shape(var(--smooth-outline));
95
+ }
96
+ }
97
+ }
98
+
99
+ /* What arrives shows from nothing. */
100
+ @keyframes vk-notice-fade-in { from { opacity: 0; } }
@@ -10,7 +10,7 @@ export const NUMBER_EDITOR_LOOKS = {
10
10
  options,
11
11
  looks: [
12
12
  { id: "attio", name: "Attio", picks: { arrows: "editing", units: "code", sheet: "line" } },
13
- { id: "mihai", name: "Mihai's", picks: { arrows: "none", units: "sign", sheet: "field" } },
13
+ { id: "mihai", name: "Outright", picks: { arrows: "none", units: "sign", sheet: "field" } },
14
14
  ],
15
15
  };
16
16
  export const numberEditorWornOf = (el) => lookWornOf(NUMBER_EDITOR_LOOKS, el, ["arrows", "units", "sheet"]);
@@ -92,7 +92,7 @@ export function useNumberEditor(props) {
92
92
  setChoosing(false);
93
93
  settled.current = false;
94
94
  } }, [wornAt, setDraft, setCode, setChoosing]);
95
- const items = list.map((c) => ({ value: c.code, label: c.name, ...(c.sign ? { as: { sign: c.sign } } : {}) }));
95
+ const items = list.map((c) => ({ value: c.code, label: c.name, also: [c.code], ...(c.sign ? { as: { sign: c.sign } } : {}) }));
96
96
  const back = () => { setChoosing(false); requestAnimationFrame(() => input.current?.focus({ preventScroll: true })); };
97
97
  const picker = usePicker({ label: words.name, items, value: code ?? null, onValueChange: (c) => { if (typeof c === "string")
98
98
  pick(c); }, onDone: back, search: phone ? words.search : words.find, form: phone ? "phone" : "computer", fromHeld: true, ...(w.picker ? { words: w.picker } : {}) });
@@ -2,17 +2,19 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
2
2
  import { useRender } from "@base-ui/react/use-render";
3
3
  import * as React from "react";
4
4
  import { cx } from "../../internal/cx.js";
5
+ import { phoneMark, usePhoneForm } from "../internal/phone.js";
5
6
  import { TagCut, TagRemove } from "../tag/tag.js";
6
7
  import { optionColours } from "./looks.js";
7
8
  export const Option = React.forwardRef(function Option({ children, colour, count, onRemove, size, icon, iconEnd, render, className, ...props }, ref) {
8
9
  const word = typeof children === "string" ? children : undefined;
9
10
  const shown = onRemove ? undefined : render;
10
11
  const link = React.isValidElement(shown) && shown.props.href != null;
12
+ const phone = usePhoneForm(undefined, link && count == null);
11
13
  const element = useRender({
12
14
  defaultTagName: "span", render: shown, ref, enabled: count == null,
13
15
  props: {
14
16
  className: cx("o-tag o-option", size === "lg" && "o-option-lg", className), title: word, "data-kit": "option",
15
- "data-colour": colour && optionColours.includes(colour) ? colour : undefined, ...(link ? { "data-link": "" } : {}), ...props,
17
+ "data-colour": colour && optionColours.includes(colour) ? colour : undefined, ...(link ? { "data-link": "" } : {}), ...phoneMark(phone), ...props,
16
18
  children: _jsxs(_Fragment, { children: [_jsx(TagCut, {}), icon != null && _jsx("span", { className: "o-option-icon", "data-side": "start", "aria-hidden": "true", children: icon }), _jsx("span", { className: "o-tag-word", children: children }), iconEnd != null && !onRemove && _jsx("span", { className: "o-option-icon", "data-side": "end", "aria-hidden": "true", children: iconEnd }), onRemove && _jsx(TagRemove, { word: word, onRemove: onRemove })] }),
17
19
  },
18
20
  });
@@ -74,7 +74,7 @@
74
74
  /* ── A link (after Attio's record chips): at rest the chip as it is, its words the Option's and never
75
75
  underlined; under the pointer the hover fill (under Grey fill a step darker; a coloured pill or flat fill its colour's fill, a
76
76
  pill's edge its hue), pressed the pressed fill (Grey fill and a coloured fill keep their hover's) at 98%; from the keys the focus
77
- ring. The states weigh (0,4,0) and more, over the colour looks' grounds. On the phone it takes taps from 44 (the pressing area the app gives it). ── */
77
+ ring. The states weigh (0,4,0) and more, over the colour looks' grounds. On the phone it takes taps from 44 (press.css's pressing area). ── */
78
78
  .o-option[data-link] {
79
79
  --o-option-hover: var(--vk-hovered); --o-option-pressed: var(--vk-pressed);
80
80
  cursor: pointer; text-decoration: none; outline: none; -webkit-tap-highlight-color: transparent;
@@ -0,0 +1,4 @@
1
+ import type { PieceLooks } from "../../looks/looks.js";
2
+ export type PaneOptionId = "place" | "corners" | "smoothing" | "shadow" | "edge" | "gap" | "padding";
3
+ /** The Pane's options. */
4
+ export declare const PANE_LOOKS: PieceLooks<PaneOptionId>;
@@ -0,0 +1,11 @@
1
+ const steps = (ids) => ids.map((id) => ({ id, name: id }));
2
+ const options = [
3
+ { id: "place", name: "Where it stands", device: "desktop", def: "list", values: [{ id: "list", name: "As tall as the list" }, { id: "fit", name: "Fitting what it holds" }] },
4
+ { id: "corners", name: "Corners", device: "desktop", def: "xl", kind: "steps", values: steps(["lg", "xl", "2xl"]) },
5
+ { id: "smoothing", name: "Corner smoothing", device: "desktop", def: "smooth", values: [{ id: "round", name: "Round" }, { id: "smooth", name: "Smooth" }] },
6
+ { id: "shadow", name: "Shadow", device: "desktop", def: "menu", kind: "steps", values: [{ id: "none", name: "None" }, { id: "menu", name: "Menu" }, { id: "lg", name: "Large" }, { id: "xl", name: "Extra large" }] },
7
+ { id: "edge", name: "Edge", device: "desktop", def: "outline", values: [{ id: "outline", name: "Outline" }, { id: "subtle", name: "Subtle" }, { id: "none", name: "None" }] },
8
+ { id: "gap", name: "Gap", device: "desktop", def: "8", kind: "steps", values: steps(["0", "4", "8", "12", "16"]) },
9
+ { id: "padding", name: "Padding", device: "desktop", def: "8", kind: "steps", values: steps(["0", "4", "8", "12", "16"]) },
10
+ ];
11
+ export const PANE_LOOKS = { id: "pane", name: "Pane", options, looks: [] };
@@ -0,0 +1,67 @@
1
+ import * as React from "react";
2
+ export { paneAfter, type PaneState, type PanePress } from "./state.js";
3
+ /** Why it closed, by the controls' one list of close reasons: Escape, its ✕; any other is `none`. What opened it,
4
+ * pressed again, closes it through usePane, never through onOpenChange. */
5
+ export type PaneCloseReason = "escape-key" | "close-press" | "none";
6
+ export interface PaneChangeDetails {
7
+ reason: PaneCloseReason;
8
+ /** What did it: the press, the key. */
9
+ event?: Event;
10
+ }
11
+ export interface PaneProps {
12
+ open: boolean;
13
+ /** It closes, and why: its holder sets `open` from it. */
14
+ onOpenChange: (open: boolean, details: PaneChangeDetails) => void;
15
+ /** The list's box it stands in: positioned, holding the list (which scrolls inside it) and never scrolling itself. Its portal
16
+ * takes no room there (display: contents). Until it is on the page (null), nothing is drawn. */
17
+ container: HTMLElement | null;
18
+ /** What opened it: the focus goes back to it as it closes. */
19
+ opener?: HTMLElement | null;
20
+ /** Whether the focus lands on it as it opens (the default); false where it stands open on a page that shows it, so the page
21
+ * takes no focus as it loads. */
22
+ initialFocus?: boolean;
23
+ /** What names it to a screen reader, when what stands in it has no PaneTitle. */
24
+ "aria-label"?: string;
25
+ className?: string;
26
+ /** What stands in it: a PaneHead, a PaneBody and a PaneFoot, each as it needs. */
27
+ children: React.ReactNode;
28
+ }
29
+ /** A list's panel at its right edge, the list in use beside it. */
30
+ export declare function Pane({ open, onOpenChange, container, opener, initialFocus, "aria-label": label, className, children }: PaneProps): import("react/jsx-runtime").JSX.Element | null;
31
+ /** Whether what draws stands inside a Pane: its title and close are the Pane's Dialog's, which a body outside one (the toolbar's
32
+ * popover) draws plain instead (Customize, VK-840). A Popover opened from inside a Pane sets it back to false round what it holds.
33
+ * The package's own; no entry point exports it. */
34
+ export declare const InPane: React.Context<boolean>;
35
+ type Slot = {
36
+ children: React.ReactNode;
37
+ className?: string;
38
+ };
39
+ /** Its head, which what stands in it fills: its title, its ✕. It stays at its top. */
40
+ export declare function PaneHead({ children, className }: Slot): import("react/jsx-runtime").JSX.Element;
41
+ /** What it holds, scrolling between its head and its foot. */
42
+ export declare function PaneBody({ children, className }: Slot): import("react/jsx-runtime").JSX.Element;
43
+ /** Its foot, under a line across the whole Pane, always at its foot. */
44
+ export declare function PaneFoot({ children, className }: Slot): import("react/jsx-runtime").JSX.Element;
45
+ /** Its title, which names it to a screen reader too. */
46
+ export declare function PaneTitle({ children, className }: Slot): import("react/jsx-runtime").JSX.Element;
47
+ /** What closes it from inside (a Button: `render`), with the reason close-press: what stands in it draws its own ✕. */
48
+ export declare function PaneClose({ render, children }: {
49
+ render: React.ReactElement;
50
+ children?: React.ReactNode;
51
+ }): import("react/jsx-runtime").JSX.Element;
52
+ /** A Pane's holder: what stands in it, one thing at a time, and what opened it. `opens(key)` is spread on each opener: its
53
+ * press puts its thing in the Pane, takes the place of another's, or closes its own. `pane` is spread on the Pane. `start`:
54
+ * what stands in it at first, open from the start (a page that shows it). */
55
+ export declare function usePane(start?: string | null): {
56
+ shown: string | null;
57
+ pane: {
58
+ open: boolean;
59
+ opener: HTMLElement | null;
60
+ onOpenChange: (next: boolean) => void;
61
+ };
62
+ opens: (key: string) => {
63
+ onClick: (e: React.MouseEvent<HTMLElement>) => void;
64
+ "aria-expanded": boolean;
65
+ };
66
+ close: () => void;
67
+ };