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,39 @@
1
+ /* The SwitchRow and SwitchRows, as the Outright kit draws them (switch-row/switch-row.tsx): a setting in a settings list, its
2
+ words (choice.css) on the left and the Switch (switch.css) on the right, which reads a row under the pointer as its own
3
+ hover; the rows in a bordered box.
4
+
5
+ The rules sit in the components layer, so a utility class on a row still wins. */
6
+ @layer components {
7
+
8
+ /* ── Settings rows: the words on the left, the switch on the right, in a bordered box ──────────────── */
9
+ .o-switch-rows { display: grid; border: var(--vk-border-width) solid var(--vk-border); border-radius: var(--vk-radius-lg); overflow: hidden; }
10
+ .o-switch-row {
11
+ display: flex; align-items: center; justify-content: space-between; gap: calc(var(--vk-spacing) * 4);
12
+ padding: calc(var(--vk-spacing) * 3.5) calc(var(--vk-spacing) * 4); border-top: var(--vk-border-width) solid var(--vk-border-subtle);
13
+ cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color var(--vk-duration-fast) var(--vk-ease-out);
14
+ }
15
+ .o-switch-row:first-child { border-top: 0; }
16
+ @media (hover: hover) { .o-switch-row:hover { background-color: var(--vk-hovered); } }
17
+ .o-switch-row .o-choice-label { font-weight: var(--vk-font-weight-medium); }
18
+ .o-switch-row:has(.o-switch[data-disabled]) { cursor: not-allowed; background-color: transparent; }
19
+
20
+ @media (prefers-reduced-motion: reduce) { .o-switch-row { transition: none; } }
21
+ /* ── The rows' card smooth: following the token corner-smoothing, drawn with the smooth outline (smooth.css) in every browser
22
+ that knows shape(); one that doesn't keeps the corners above. Its round part is fitted to one row, as a control's is.
23
+ Nothing stands outside it (its rows were hidden past its edge), so it is clipped itself, its rows with it, hiding nothing
24
+ more; its edge is a ring along the curve over its rows (::after), as the Kbd's is. The Switch itself, a pill, stays as it
25
+ draws. ── */
26
+ @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)) {
27
+ .o-switch-rows {
28
+ --smooth-amount: var(--vk-corner-smoothing); --rows-card-side: calc(var(--vk-spacing) * 7 + var(--vk-font-size-sm) * var(--vk-line-height-sm));
29
+ --rows-card-fit: min(var(--vk-radius-lg), var(--rows-card-side) / (2 + 2 * var(--smooth-amount, 0.7)));
30
+ --smooth-t: var(--rows-card-fit); --smooth-side: var(--rows-card-side);
31
+ position: relative; overflow: visible; border-color: transparent; border-radius: var(--rows-card-fit); clip-path: shape(var(--smooth-outline));
32
+ }
33
+ .o-switch-rows::after {
34
+ --smooth-t: max(0px, var(--rows-card-fit) - var(--vk-border-width)); --smooth-in: var(--vk-border-width);
35
+ content: ""; position: absolute; inset: calc(var(--vk-border-width) * -1); z-index: 1; pointer-events: none;
36
+ background-color: var(--vk-border); clip-path: shape(var(--smooth-ring));
37
+ }
38
+ }
39
+ }
@@ -7,7 +7,7 @@
7
7
  (data-switch-shape), its shape on a phone (data-switch-phone), what it holds (data-switch-mark) and how it moves
8
8
  (data-switch-motion). A shape sets its sizes and its resting paint as variables; the states after them (the pointer, on,
9
9
  error, disabled) choose among those, a later one winning. The track is painted by ::before, since ::after is its pressing
10
- area (the pressing area the app gives it) and a thin track is narrower than the switch itself.
10
+ area (press.css's pressing area) and a thin track is narrower than the switch itself.
11
11
 
12
12
  The rules sit in the components layer, so a utility class on a switch still wins. */
13
13
  @layer components {
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Button as BaseButton } from "@base-ui/react/button";
3
3
  import { cx } from "../../internal/cx.js";
4
+ import { phoneMark, usePhoneForm } from "../internal/phone.js";
4
5
  const TAG = ["M7.5 7.5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", "M3 6v5.172a2 2 0 0 0 .586 1.414l7.71 7.71a2.41 2.41 0 0 0 3.408 0l5.592 -5.592a2.41 2.41 0 0 0 0 -3.408l-7.71 -7.71a2 2 0 0 0 -1.414 -.586h-5.172a3 3 0 0 0 -3 3z"];
5
6
  const X = ["M18 6l-12 12", "M6 6l12 12"];
6
7
  const glyph = (paths, className, strokeWidth) => (_jsx("svg", { className: className, viewBox: "0 0 24 24", strokeWidth: strokeWidth, "aria-hidden": "true", children: paths.map((d) => _jsx("path", { d: d }, d)) }));
@@ -15,5 +16,6 @@ export function TagCut() {
15
16
  return _jsx("span", { className: "o-tag-cut o-smooth o-smooth-ease", "aria-hidden": "true" });
16
17
  }
17
18
  export function TagRemove({ word, onRemove, force }) {
18
- return _jsx(BaseButton, { type: "button", className: "o-tag-remove", "aria-label": word ? `Remove ${word}` : "Remove", "data-force": force, onClick: onRemove, children: glyph(X, "", 2.5) });
19
+ const phone = usePhoneForm();
20
+ return _jsx(BaseButton, { type: "button", className: "o-tag-remove", "aria-label": word ? `Remove ${word}` : "Remove", "data-force": force, onClick: onRemove, ...phoneMark(phone), children: glyph(X, "", 2.5) });
19
21
  }
@@ -0,0 +1,20 @@
1
+ import * as React from "react";
2
+ import { type FieldError } from "../field/field.js";
3
+ export interface TagFieldProps {
4
+ /** What the field holds, above it. */
5
+ label: React.ReactNode;
6
+ /** Under the field: what the tags are for, or why it is off. */
7
+ note?: React.ReactNode;
8
+ /** Under the field in place of the note: the fix; several, as a list, each once. */
9
+ error?: FieldError;
10
+ /** Off: nothing typed in, and its tags have no remove button. */
11
+ disabled?: boolean;
12
+ defaultValue?: string[];
13
+ onValueChange?: (tags: string[]) => void;
14
+ placeholder?: string;
15
+ className?: string;
16
+ /** Draws a state for a sheet ("hover", "focus"). */
17
+ "data-force"?: string;
18
+ }
19
+ /** Tags inside the Input's field, before the caret, in a Field with its label, note and error. */
20
+ export declare function TagField({ label, note, error, disabled, defaultValue, onValueChange, placeholder, className, "data-force": force }: TagFieldProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { Field } from "../field/field.js";
4
+ import { Input, InputGroup } from "../input/input.js";
5
+ import { Tag } from "../tag/tag.js";
6
+ export function TagField({ label, note, error, disabled, defaultValue = [], onValueChange, placeholder = "Add a tag", className, "data-force": force }) {
7
+ const [tags, setTags] = React.useState(defaultValue), [draft, setDraft] = React.useState("");
8
+ const set = (next) => { setTags(next); onValueChange?.(next); };
9
+ const add = () => { const w = draft.trim(); if (w && !tags.includes(w))
10
+ set([...tags, w]); setDraft(""); };
11
+ return (_jsx(Field, { label: label, note: note, error: error, disabled: disabled, className: className, children: _jsxs(InputGroup, { className: "o-tag-field", "data-force": force, children: [tags.map((t) => _jsx(Tag, { onRemove: disabled ? undefined : () => set(tags.filter((x) => x !== t)), children: t }, t)), _jsx(Input, { className: "o-tag-field-input", value: draft, placeholder: placeholder, autoComplete: "off", onChange: (e) => setDraft(e.currentTarget.value), onBlur: add, onKeyDown: (e) => {
12
+ if (e.key === "Enter" || e.key === ",") {
13
+ e.preventDefault();
14
+ add();
15
+ }
16
+ else if (e.key === "Backspace" && !draft && tags.length)
17
+ set(tags.slice(0, -1));
18
+ } })] }) }));
19
+ }
@@ -0,0 +1,7 @@
1
+ export declare const TAG_FIELD_TOKENS: readonly [{
2
+ readonly name: "--vk-spacing";
3
+ readonly kind: "size";
4
+ readonly outright: "--spacing";
5
+ }];
6
+ /** The TagField has no machinery of its own. */
7
+ export declare const TAG_FIELD_PRIVATE: readonly [];
@@ -0,0 +1,4 @@
1
+ export const TAG_FIELD_TOKENS = [
2
+ { name: "--vk-spacing", kind: "size", outright: "--spacing" },
3
+ ];
4
+ export const TAG_FIELD_PRIVATE = [];
@@ -0,0 +1,13 @@
1
+ /* The TagField, as the Outright kit draws it: the Tag in a field (tag-field/tag-field.tsx). The field is the Input's own (an
2
+ InputGroup, so input.css draws its edge, every state and option); the chip is the Tag's (tag.css).
3
+
4
+ The rules sit in the components layer, so a utility class on the field still wins. */
5
+ @layer components {
6
+
7
+ /* ── In a field: the tags before the caret, wrapping onto more lines as they grow; its words the Input's size, the box as tall
8
+ as its words, on the tags' line. Its rules outweigh the Input's (input.css may come after this file). On a phone (the
9
+ group's own mark, `data-vk-phone`) the field takes the phone's 44. ── */
10
+ .o-input.o-input-group.o-tag-field { flex-wrap: wrap; height: auto; min-height: calc(var(--vk-spacing) * 9); padding-block: calc(var(--vk-spacing) * 1.5); }
11
+ .o-input.o-input-group.o-tag-field:where([data-vk-phone], [data-vk-phone] *) { min-height: calc(var(--vk-spacing) * 11); padding-block: calc(var(--vk-spacing) * 2.5); }
12
+ .o-input-control.o-tag-field-input { align-self: center; min-width: calc(var(--vk-spacing) * 20); }
13
+ }
@@ -10,7 +10,7 @@ export const TEXT_EDITOR_LOOKS = {
10
10
  options,
11
11
  looks: [
12
12
  { id: "attio", name: "Attio", picks: { box: "over", long: "enter", phone: "country" } },
13
- { id: "mihais", name: "Mihai's", picks: { box: "cell", long: "mod", phone: "line" } },
13
+ { id: "mihais", name: "Outright", picks: { box: "cell", long: "mod", phone: "line" } },
14
14
  ],
15
15
  };
16
16
  export const textEditorWornOf = (el) => lookWornOf(TEXT_EDITOR_LOOKS, el, ["box", "long", "phone"]);
@@ -14,6 +14,7 @@ import { countryName, dialOf, firstCountry, keepLast, patternOf, phoneHanded, ph
14
14
  import { TEXT_EDITOR_ATTRS, textEditorWornOf } from "./looks.js";
15
15
  import { Countries } from "./countries.js";
16
16
  import { textWords } from "./words.js";
17
+ import { keepTypedRun } from "../internal/typed-run.js";
17
18
  const COUNTRY = { edge: "none", corner: "round", radius: "sm", words: "inherit", colour: "text", pad: "6-4", gap: "3", icon: "14", iconColour: "subtle", hover: "neutral", open: "neutral" };
18
19
  const glyph = (paths) => (_jsx("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: paths.map((d) => _jsx("path", { d: d }, d)) }));
19
20
  const X = ["M18 6l-12 12", "M6 6l12 12"], TICK = ["M5 12l5 5l10 -10"], DOWN = ["M6 9l6 6l6 -6"];
@@ -21,11 +22,6 @@ const toEnd = (el) => { try {
21
22
  el.setSelectionRange(el.value.length, el.value.length);
22
23
  }
23
24
  catch { } };
24
- const DEFAULT_VALUE = typeof HTMLTextAreaElement === "undefined" ? undefined : Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "defaultValue");
25
- const keepTypedRun = (el) => {
26
- if (DEFAULT_VALUE && !Object.prototype.hasOwnProperty.call(el, "defaultValue"))
27
- Object.defineProperty(el, "defaultValue", { configurable: true, get: () => DEFAULT_VALUE.get.call(el), set: () => { } });
28
- };
29
25
  const ONE_LINE = new Set(["email", "link", "domain", "phone"]);
30
26
  const ROWS = 8;
31
27
  const startOf = (value, country) => phoneParts(value, firstCountry(country));
@@ -0,0 +1,79 @@
1
+ import * as React from "react";
2
+ import { Toast as BaseToast } from "@base-ui/react/toast";
3
+ import { type NoticeMeaning } from "../notice/notice.js";
4
+ export interface ToastOptions {
5
+ /** What just happened, in the past tense, naming the thing ("3 deals moved to Won"); no full stop, no
6
+ * "Successfully". Working, it ends in "…" ("Moving 3 deals to Won…"). */
7
+ words: string;
8
+ /** A name over the words, in the medium weight, when they need one ("Import finished"). */
9
+ title?: string;
10
+ /** The action can be taken back: "Undo" at the end puts it back, and ⌘Z does the same while it shows. */
11
+ undo?: () => void;
12
+ /** Any other one word that does something about it: "Open" for something just made, "Try again". */
13
+ action?: string;
14
+ onAction?: () => void;
15
+ /** Working: a spinner in front, no time limit, until it is turned into its result. */
16
+ working?: boolean;
17
+ /** Failed: a circled ! in the danger colour in front; the words say what didn't happen. */
18
+ failed?: boolean;
19
+ /** What it means, as a Notice's: its icon in front, in the meaning's colour (danger is failed). */
20
+ meaning?: NoticeMeaning;
21
+ /** A × at its end that closes it at once. */
22
+ closable?: boolean;
23
+ /** How long it stays, in ms; four seconds unless said (toast-duration), and a working one until it is
24
+ * turned into its result. */
25
+ duration?: number;
26
+ }
27
+ /** The words a toast draws of its own: Undo, its ×'s name, and the name of the region its toasts stand in (Base UI names it
28
+ * "Notifications" unless told). */
29
+ export type ToastWords = {
30
+ undo: string;
31
+ close: string;
32
+ region?: string;
33
+ };
34
+ /** Its words in English. */
35
+ export declare const TOAST_WORDS: ToastWords;
36
+ type Base = ReturnType<typeof BaseToast.createToastManager>;
37
+ /** Toasts called from anywhere (an event, a fetch, code outside React): a Toast given it with `manager`
38
+ * shows what it sends. */
39
+ export interface ToastManager {
40
+ /** Shows a toast; its id, to change or close it later. */
41
+ show(o: ToastOptions): string;
42
+ /** Changes a toast where it stands: its words, its title, a working one into its result. */
43
+ update(id: string, o: ToastOptions): void;
44
+ /** Closes it at once; with no id, every one. */
45
+ close(id?: string): void;
46
+ /** A working toast while the promise runs, turned into its result where it stands once it settles. */
47
+ promise<T>(p: Promise<T>, o: {
48
+ working: string;
49
+ done: string | ((value: T) => string);
50
+ failed: string | ((error: unknown) => string);
51
+ title?: string;
52
+ }): Promise<T>;
53
+ /** Base UI's own manager, for the Toast that shows them. */
54
+ readonly base: Base;
55
+ }
56
+ /** A manager of toasts to call from anywhere; give it to the Toast that shows them. */
57
+ export declare function createToastManager(words?: Partial<ToastWords>): ToastManager;
58
+ /** Whether a Toast stands round it, so useToast can be reached. */
59
+ export declare const useInToast: () => boolean;
60
+ /** Where toasts are made and where they rise: everything inside can show one (useToast), and they rise
61
+ * centred at the bottom of the screen, 16px up, at most 460px wide. `inside`: at the bottom of the
62
+ * element around it instead (a sample on a page that shows how it looks). `manager`: show the toasts a
63
+ * ToastManager sends from anywhere. One at a time unless `stack`: then several, the newest in front, the
64
+ * two before it peeking above, spread out under the pointer. Put it round the app once. */
65
+ export declare function Toast({ inside, manager, stack, words, children }: {
66
+ inside?: boolean;
67
+ manager?: ToastManager;
68
+ stack?: boolean;
69
+ words?: Partial<ToastWords>;
70
+ children: React.ReactNode;
71
+ }): import("react/jsx-runtime").JSX.Element;
72
+ /** Shows a toast: one at a time (unless the Toast stacks them), a working one turned into its result in place. */
73
+ export declare function useToast(): (o: ToastOptions) => string;
74
+ /** A toast standing still in the page, for a page that shows how it looks: it never times out or moves. */
75
+ export declare function ToastShown({ words, title, undo, action, working, failed, meaning, closable, said: own }: Omit<ToastOptions, "undo" | "onAction" | "duration"> & {
76
+ undo?: boolean;
77
+ said?: Partial<ToastWords>;
78
+ }): import("react/jsx-runtime").JSX.Element;
79
+ export {};
@@ -0,0 +1,101 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { Toast as BaseToast } from "@base-ui/react/toast";
4
+ import { cx } from "../../internal/cx.js";
5
+ import { Button } from "../button/button.js";
6
+ import { msOf } from "../internal/read-token.js";
7
+ import { NOTICE_ICONS } from "../notice/notice.js";
8
+ import { Spinner } from "../spinner/spinner.js";
9
+ const glyph = (paths, className) => _jsx("svg", { className: className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: paths.map((d) => _jsx("path", { d: d }, d)) });
10
+ const wrong = glyph(NOTICE_ICONS.danger, "o-toast-mark");
11
+ const X = ["M18 6l-12 12", "M6 6l12 12"];
12
+ export const TOAST_WORDS = { undo: "Undo", close: "Close", region: "Notifications" };
13
+ function toastWait() {
14
+ if (typeof document === "undefined")
15
+ return 4000;
16
+ return msOf(document.querySelector(".o-toast-viewport"), "--toast-wait") || msOf(document.documentElement, "--vk-toast-duration") || 4000;
17
+ }
18
+ function toBase(o, id, store, words) {
19
+ const act = o.undo ? { label: words.undo, run: o.undo } : o.action ? { label: o.action, run: o.onAction } : null;
20
+ const meaning = o.failed ? "danger" : o.meaning;
21
+ return {
22
+ id, title: o.title, description: o.words, type: o.working ? "working" : meaning === "danger" ? "failed" : meaning,
23
+ timeout: o.working ? 0 : o.duration ?? toastWait(), data: { undo: !!o.undo, closable: !!o.closable },
24
+ actionProps: act ? { children: act.label, onClick: () => { store.close(id); act.run?.(); } } : undefined,
25
+ };
26
+ }
27
+ let made = 0;
28
+ export function createToastManager(words) {
29
+ const base = BaseToast.createToastManager(), shown = new Set(), said = { ...TOAST_WORDS, ...words };
30
+ const show = (o) => { const id = `toast-${++made}`; shown.add(id); base.add(toBase(o, id, base, said)); return id; };
31
+ const update = (id, o) => base.update(id, toBase(o, id, base, said));
32
+ return {
33
+ base, show, update,
34
+ close: (id) => { for (const one of id ? [id] : [...shown]) {
35
+ base.close(one);
36
+ shown.delete(one);
37
+ } },
38
+ promise: (p, o) => {
39
+ const id = show({ words: o.working, title: o.title, working: true });
40
+ p.then((v) => update(id, { words: typeof o.done === "function" ? o.done(v) : o.done, title: o.title, meaning: "success" }), (e) => update(id, { words: typeof o.failed === "function" ? o.failed(e) : o.failed, title: o.title, failed: true }));
41
+ return p;
42
+ },
43
+ };
44
+ }
45
+ const Stacked = React.createContext(false);
46
+ const InToast = React.createContext(false);
47
+ export const useInToast = () => React.useContext(InToast);
48
+ const Said = React.createContext(TOAST_WORDS);
49
+ export function Toast({ inside = false, manager, stack = false, words, children }) {
50
+ const said = React.useMemo(() => ({ ...TOAST_WORDS, ...words }), [words]);
51
+ return _jsx(InToast.Provider, { value: true, children: _jsx(Said.Provider, { value: said, children: _jsx(Stacked.Provider, { value: stack, children: _jsxs(BaseToast.Provider, { toastManager: manager?.base, children: [children, _jsx(Viewport, { inside: inside, stack: stack })] }) }) }) });
52
+ }
53
+ export function useToast() {
54
+ const m = BaseToast.useToastManager(), live = React.useRef(m.toasts), stack = React.useContext(Stacked), said = React.useContext(Said);
55
+ live.current = m.toasts;
56
+ return React.useCallback((o) => {
57
+ const now = live.current.find((t) => t.transitionStatus !== "ending");
58
+ if (now && now.type !== "working" && !stack)
59
+ m.close(now.id);
60
+ const id = now?.type === "working" ? now.id : `toast-${++made}`;
61
+ const made2 = m.add(toBase(o, id, m, said));
62
+ return made2;
63
+ }, [m, stack, said]);
64
+ }
65
+ function Viewport({ inside, stack }) {
66
+ const { toasts, close } = BaseToast.useToastManager(), said = React.useContext(Said);
67
+ React.useEffect(() => {
68
+ if (stack)
69
+ return;
70
+ toasts.filter((t) => t.transitionStatus !== "ending").slice(1).forEach((t) => close(t.id));
71
+ }, [toasts, close, stack]);
72
+ React.useEffect(() => {
73
+ const now = toasts.find((t) => t.transitionStatus !== "ending");
74
+ if (!now)
75
+ return;
76
+ const key = (e) => {
77
+ if (e.key === "Escape")
78
+ close(now.id);
79
+ else if ((e.metaKey || e.ctrlKey) && !e.shiftKey && e.key.toLowerCase() === "z" && now.data?.undo && !e.target.closest?.("input, textarea, [contenteditable]")) {
80
+ e.preventDefault();
81
+ now.actionProps?.onClick?.(e);
82
+ }
83
+ };
84
+ document.addEventListener("keydown", key);
85
+ return () => document.removeEventListener("keydown", key);
86
+ }, [toasts, close]);
87
+ return (_jsx(BaseToast.Viewport, { className: cx("o-toast-viewport", inside && "o-toast-viewport-inside"), "aria-label": said.region ?? TOAST_WORDS.region, ...(stack ? { "data-stack": "" } : {}), children: toasts.map((t) => (_jsxs(BaseToast.Root, { toast: t, className: "o-toast o-smooth o-smooth-ease", swipeDirection: "down", "data-kit": "toast", children: [_jsx(Mark, { type: t.type }), t.title ? _jsxs("span", { className: "o-toast-text", children: [_jsx(BaseToast.Title, { className: "o-toast-title" }), _jsx(BaseToast.Description, { className: "o-toast-words" })] }) : _jsx(BaseToast.Description, { className: "o-toast-words" }), _jsx(BaseToast.Action, { render: _jsx(Button, { kind: "text", size: "xs", className: "o-toast-act" }) }), t.data?.closable && _jsx(BaseToast.Close, { render: _jsx(Button, { kind: "quiet", size: "xs", shape: "icon", className: "o-toast-act o-toast-close", "aria-label": said.close, icon: glyph(X, "") }) })] }, t.id))) }));
88
+ }
89
+ function Mark({ type }) {
90
+ if (type === "working")
91
+ return _jsx(Spinner, { size: 14, label: "" });
92
+ if (type === "failed")
93
+ return wrong;
94
+ if (type && type in NOTICE_ICONS)
95
+ return glyph(NOTICE_ICONS[type], "o-toast-mark");
96
+ return null;
97
+ }
98
+ export function ToastShown({ words, title, undo, action, working, failed, meaning, closable, said: own }) {
99
+ const said = { ...TOAST_WORDS, ...own }, label = undo ? said.undo : action, type = working ? "working" : failed || meaning === "danger" ? "failed" : meaning;
100
+ return (_jsxs("div", { className: "o-toast o-toast-shown o-smooth o-smooth-ease", role: "status", "data-type": type, "data-kit": "toast", children: [_jsx(Mark, { type: type }), title ? _jsxs("span", { className: "o-toast-text", children: [_jsx("span", { className: "o-toast-title", children: title }), _jsx("span", { className: "o-toast-words", children: words })] }) : _jsx("span", { className: "o-toast-words", children: words }), label && _jsx(Button, { kind: "text", size: "xs", className: "o-toast-act", tabIndex: -1, children: label }), closable && _jsx(Button, { kind: "quiet", size: "xs", shape: "icon", className: "o-toast-act o-toast-close", tabIndex: -1, "aria-label": said.close, icon: glyph(X, "") })] }));
101
+ }
@@ -0,0 +1,100 @@
1
+ export declare const TOAST_TOKENS: readonly [{
2
+ readonly name: "--vk-layer-popup";
3
+ readonly kind: "size";
4
+ readonly outright: "--layer-popup";
5
+ }, {
6
+ readonly name: "--vk-spacing";
7
+ readonly kind: "size";
8
+ readonly outright: "--spacing";
9
+ }, {
10
+ readonly name: "--vk-radius-lg";
11
+ readonly kind: "size";
12
+ readonly outright: "--radius-lg";
13
+ }, {
14
+ readonly name: "--vk-fg";
15
+ readonly kind: "colour";
16
+ readonly outright: "--text";
17
+ }, {
18
+ readonly name: "--vk-ground";
19
+ readonly kind: "colour";
20
+ readonly outright: "--surface";
21
+ }, {
22
+ readonly name: "--vk-shadow-lg";
23
+ readonly kind: "shadow";
24
+ readonly outright: "--shadow-lg";
25
+ }, {
26
+ readonly name: "--vk-font-size-sm";
27
+ readonly kind: "size";
28
+ readonly outright: "--text-sm";
29
+ }, {
30
+ readonly name: "--vk-line-height-sm";
31
+ readonly kind: "size";
32
+ readonly outright: "--text-sm--line-height";
33
+ }, {
34
+ readonly name: "--vk-duration-base";
35
+ readonly kind: "motion";
36
+ readonly outright: "--duration-base";
37
+ }, {
38
+ readonly name: "--vk-ease-out";
39
+ readonly kind: "motion";
40
+ readonly outright: "--ease-out";
41
+ }, {
42
+ readonly name: "--vk-focus-width";
43
+ readonly kind: "size";
44
+ readonly outright: "--focus-width";
45
+ }, {
46
+ readonly name: "--vk-border-brand";
47
+ readonly kind: "colour";
48
+ readonly outright: "--border-focused";
49
+ }, {
50
+ readonly name: "--vk-focus-offset";
51
+ readonly kind: "size";
52
+ readonly outright: "--focus-offset";
53
+ }, {
54
+ readonly name: "--vk-duration-fast";
55
+ readonly kind: "motion";
56
+ readonly outright: "--duration-fast";
57
+ }, {
58
+ readonly name: "--vk-ease-in";
59
+ readonly kind: "motion";
60
+ readonly outright: "--ease-in";
61
+ }, {
62
+ readonly name: "--vk-font-weight-semibold";
63
+ readonly kind: "size";
64
+ readonly outright: "--font-weight-semibold";
65
+ }, {
66
+ readonly name: "--vk-danger";
67
+ readonly kind: "colour";
68
+ readonly outright: "--text-danger";
69
+ }, {
70
+ readonly name: "--vk-font-weight-medium";
71
+ readonly kind: "size";
72
+ readonly outright: "--font-weight-medium";
73
+ }, {
74
+ readonly name: "--vk-info";
75
+ readonly kind: "colour";
76
+ readonly outright: "--text-information";
77
+ }, {
78
+ readonly name: "--vk-success";
79
+ readonly kind: "colour";
80
+ readonly outright: "--text-success";
81
+ }, {
82
+ readonly name: "--vk-warning";
83
+ readonly kind: "colour";
84
+ readonly outright: "--text-warning";
85
+ }, {
86
+ readonly name: "--vk-press-scale";
87
+ readonly kind: "motion";
88
+ readonly outright: "--press-scale";
89
+ }, {
90
+ readonly name: "--vk-corner-smoothing";
91
+ readonly kind: "size";
92
+ readonly outright: "--corner-smoothing";
93
+ }, {
94
+ readonly name: "--vk-toast-duration";
95
+ readonly kind: "motion";
96
+ readonly outright: "--toast-duration";
97
+ }];
98
+ /** The Toast's own machinery: Base UI's stack (`--toast-index`, `--toast-offset-y`, `--toast-height`, `--toast-frontmost-height`),
99
+ * how it fits its action, and how long it stays (`--toast-wait`, which its script reads off its viewport). */
100
+ export declare const TOAST_PRIVATE: readonly ["--toast-"];
@@ -0,0 +1,27 @@
1
+ export const TOAST_TOKENS = [
2
+ { name: "--vk-layer-popup", kind: "size", outright: "--layer-popup" },
3
+ { name: "--vk-spacing", kind: "size", outright: "--spacing" },
4
+ { name: "--vk-radius-lg", kind: "size", outright: "--radius-lg" },
5
+ { name: "--vk-fg", kind: "colour", outright: "--text" },
6
+ { name: "--vk-ground", kind: "colour", outright: "--surface" },
7
+ { name: "--vk-shadow-lg", kind: "shadow", outright: "--shadow-lg" },
8
+ { name: "--vk-font-size-sm", kind: "size", outright: "--text-sm" },
9
+ { name: "--vk-line-height-sm", kind: "size", outright: "--text-sm--line-height" },
10
+ { name: "--vk-duration-base", kind: "motion", outright: "--duration-base" },
11
+ { name: "--vk-ease-out", kind: "motion", outright: "--ease-out" },
12
+ { name: "--vk-focus-width", kind: "size", outright: "--focus-width" },
13
+ { name: "--vk-border-brand", kind: "colour", outright: "--border-focused" },
14
+ { name: "--vk-focus-offset", kind: "size", outright: "--focus-offset" },
15
+ { name: "--vk-duration-fast", kind: "motion", outright: "--duration-fast" },
16
+ { name: "--vk-ease-in", kind: "motion", outright: "--ease-in" },
17
+ { name: "--vk-font-weight-semibold", kind: "size", outright: "--font-weight-semibold" },
18
+ { name: "--vk-danger", kind: "colour", outright: "--text-danger" },
19
+ { name: "--vk-font-weight-medium", kind: "size", outright: "--font-weight-medium" },
20
+ { name: "--vk-info", kind: "colour", outright: "--text-information" },
21
+ { name: "--vk-success", kind: "colour", outright: "--text-success" },
22
+ { name: "--vk-warning", kind: "colour", outright: "--text-warning" },
23
+ { name: "--vk-press-scale", kind: "motion", outright: "--press-scale" },
24
+ { name: "--vk-corner-smoothing", kind: "size", outright: "--corner-smoothing" },
25
+ { name: "--vk-toast-duration", kind: "motion", outright: "--toast-duration" },
26
+ ];
27
+ export const TOAST_PRIVATE = ["--toast-"];
@@ -0,0 +1,93 @@
1
+ /* The Toast. Every value it draws with is a public name (controls/toast/tokens.ts); this file only says which name
2
+ each part takes. Base UI marks a toast
3
+ data-starting-style and data-ending-style as it comes and goes, data-type working, failed or a meaning,
4
+ and, stacked, gives each its --toast-index, --toast-offset-y and heights, and data-expanded. Its
5
+ action is the Button's text kind and its × the quiet Button, both in its colours turned round.
6
+
7
+ The rules sit in the components layer, so a utility class on a toast still wins. */
8
+ @layer components {
9
+
10
+ /* How long a toast stays, read by its script off the viewport (toastWait). */
11
+ .o-toast-viewport { --toast-wait: var(--vk-toast-duration); }
12
+
13
+ /* ── Where it rises: centred at the bottom, 16px up; a toast that leaves and the one taking its place sit
14
+ in the same spot ────────────────────────────────────────────────────────────────────────────────── */
15
+ .o-toast-viewport {
16
+ position: fixed; z-index: var(--vk-layer-popup); left: 0; right: 0; bottom: calc(var(--vk-spacing) * 4);
17
+ display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; align-items: end; padding: 0 calc(var(--vk-spacing) * 4); pointer-events: none; outline: none;
18
+ }
19
+ .o-toast-viewport.o-toast-viewport-inside { position: absolute; }
20
+ .o-toast-viewport > .o-toast { grid-area: 1 / 1; }
21
+
22
+ /* ── The toast: the page's colours turned round, like the Tooltip, so it reads at once in both themes;
23
+ the radius's corners, 40px tall, 16px in on the left; it floats, so it casts the large shadow ─────── */
24
+ .o-toast {
25
+ display: inline-flex; align-items: center; gap: calc(var(--vk-spacing) * 3); box-sizing: border-box;
26
+ width: max-content; max-width: min(calc(var(--vk-spacing) * 115), 100%); min-height: calc(var(--vk-spacing) * 10);
27
+ padding: calc(var(--vk-spacing) * 1.5) calc(var(--vk-spacing) * 1.5) calc(var(--vk-spacing) * 1.5) calc(var(--vk-spacing) * 4);
28
+ border-radius: var(--vk-radius-lg); background-color: var(--vk-fg); color: var(--vk-ground); box-shadow: var(--vk-shadow-lg);
29
+ font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); pointer-events: auto; outline: none;
30
+ transition: opacity var(--vk-duration-base) var(--vk-ease-out), translate var(--vk-duration-base) var(--vk-ease-out);
31
+ }
32
+ .o-toast:not(:has(.o-toast-act)) { padding-right: calc(var(--vk-spacing) * 4); }
33
+ .o-toast:focus-visible { outline: var(--vk-focus-width) solid var(--vk-border-brand); outline-offset: var(--vk-focus-offset); }
34
+ /* It rises 16px and fades in; it fades out, quicker. */
35
+ .o-toast[data-starting-style] { opacity: 0; translate: 0 calc(var(--vk-spacing) * 4); }
36
+ .o-toast[data-ending-style] { opacity: 0; transition: opacity var(--vk-duration-fast) var(--vk-ease-in); }
37
+
38
+ /* ── Its words, then what to do about it: one word in the toast's words colour, semibold ─────────────── */
39
+ .o-toast-words { min-width: 0; margin: 0; }
40
+ .o-button.o-toast-act { color: var(--vk-ground); font-weight: var(--vk-font-weight-semibold); }
41
+ /* Its focus ring hugs it, as the text kind's does. */
42
+ .o-button.o-toast-act:is(:focus-visible, [data-force="focus"]) { outline-offset: 0; }
43
+
44
+ /* ── Working: the 14px spinner in front; failed: a circled ! in the danger colour ────────────────────── */
45
+ .o-toast > .o-spinner { margin-right: calc(var(--vk-spacing) * -0.75); }
46
+ .o-toast-mark { flex: none; width: calc(var(--vk-spacing) * 4); height: calc(var(--vk-spacing) * 4); margin-right: calc(var(--vk-spacing) * -1); color: var(--vk-danger); }
47
+
48
+ /* ── A title over its words, in the medium weight ─────────────────────────────────────────────────── */
49
+ .o-toast-text { display: grid; gap: calc(var(--vk-spacing) * 0.5); min-width: 0; padding: calc(var(--vk-spacing) * 1) 0; }
50
+ .o-toast-title { font-size: inherit; line-height: inherit; font-weight: var(--vk-font-weight-medium); }
51
+
52
+ /* ── Its meaning, as a Notice's: the meaning's icon in front, in its colour (failed is the danger one) ─ */
53
+ .o-toast[data-type="information"] > .o-toast-mark { color: var(--vk-info); }
54
+ .o-toast[data-type="success"] > .o-toast-mark { color: var(--vk-success); }
55
+ .o-toast[data-type="warning"] > .o-toast-mark { color: var(--vk-warning); }
56
+
57
+ /* ── A × at its end: the quiet Button, its 16px icon in the toast's colours; the pointer gives it no fill,
58
+ whatever the Button's look ─────────────────────────────────────────── */
59
+ /* A hover only on a screen with a pointer (iOS keeps :hover on what was last tapped); a press and the forced state stay out. */
60
+ .o-toast .o-button.o-button-quiet.o-toast-close:is([data-force="hover"], :active, [data-force="press"]) { --button-ground: transparent; --button-light: none; --button-depth: none; translate: none; color: var(--vk-ground); }
61
+ @media (hover: hover) { .o-toast .o-button.o-button-quiet.o-toast-close:hover { --button-ground: transparent; --button-light: none; --button-depth: none; translate: none; color: var(--vk-ground); } }
62
+
63
+ /* ── Several at once: each 460px or the width it has; the newest in front, the two before it the front
64
+ one's height, peeking 8px above it each, each a little narrower (twice the press's step, from its top
65
+ edge) so their edges show; the pointer or focus on them spreads them out, 8px apart, each its own
66
+ height and width ───────────────────────────────────────────────────────────────────────────────────── */
67
+ .o-toast-viewport[data-stack] > .o-toast {
68
+ width: min(calc(var(--vk-spacing) * 115), 100%); z-index: calc(var(--toast-index) * -1); overflow: hidden;
69
+ transition: opacity var(--vk-duration-base) var(--vk-ease-out), translate var(--vk-duration-base) var(--vk-ease-out), scale var(--vk-duration-base) var(--vk-ease-out), height var(--vk-duration-base) var(--vk-ease-out);
70
+ }
71
+ .o-toast-viewport[data-stack] > .o-toast:not([data-expanded]) { height: var(--toast-frontmost-height, auto); translate: 0 calc(var(--toast-index) * var(--vk-spacing) * -2); scale: calc(1 - (1 - var(--vk-press-scale)) * var(--toast-index) * 2); transform-origin: top center; }
72
+ .o-toast-viewport[data-stack] > .o-toast[data-expanded] { height: var(--toast-height, auto); translate: 0 calc((var(--toast-offset-y) + var(--toast-index) * var(--vk-spacing) * 2) * -1); }
73
+ .o-toast-viewport[data-stack] > .o-toast[data-limited] { opacity: 0; pointer-events: none; }
74
+ .o-toast-viewport[data-stack] > .o-toast[data-starting-style] { translate: 0 calc(var(--vk-spacing) * 4); }
75
+
76
+ /* Under reduced motion it appears and goes without moving. */
77
+ @media (prefers-reduced-motion: reduce) { .o-toast, .o-toast-viewport[data-stack] > .o-toast { transition: none; } .o-toast[data-starting-style] { translate: none; } }
78
+ /* ── Its corners smooth: following corner-smoothing, drawn with the smooth outline
79
+ (smooth.css) in every browser that knows shape(); one that doesn't keeps the corners above. Its round part is fitted to its
80
+ 40px, as a control's is. It casts a shadow and its focus ring stands outside it, so it is never clipped: its ground is a layer
81
+ inside it (::before), clipped, as the Popover's is, the shadow and the ring on itself. ── */
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-toast {
84
+ --smooth-amount: var(--vk-corner-smoothing); --smooth-side: calc(var(--vk-spacing) * 10);
85
+ --toast-fit: min(var(--vk-radius-lg), var(--vk-spacing) * 10 / (2 + 2 * var(--smooth-amount, 0.7))); --smooth-t: var(--toast-fit);
86
+ position: relative; isolation: isolate; border-radius: var(--toast-fit); background-color: transparent;
87
+ }
88
+ .o-toast::before {
89
+ content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit;
90
+ background-color: var(--vk-fg); clip-path: shape(var(--smooth-outline));
91
+ }
92
+ }
93
+ }