@k2b/ui 0.66.0 → 0.67.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 (908) hide show
  1. package/dist/base.css +6 -1
  2. package/dist/browser/actions/Dropdown.js +2 -1
  3. package/dist/browser/actions/Dropdown.js.map +1 -1
  4. package/dist/browser/actions/FilterChip.js +3 -2
  5. package/dist/browser/actions/FilterChip.js.map +1 -1
  6. package/dist/browser/actions/SegmentedControl.js +20 -14
  7. package/dist/browser/actions/SegmentedControl.js.map +1 -1
  8. package/dist/browser/charts/core/line-details.js +52 -12
  9. package/dist/browser/charts/core/line-details.js.map +1 -1
  10. package/dist/browser/charts/core/line-extras.js +122 -0
  11. package/dist/browser/charts/core/line-extras.js.map +1 -0
  12. package/dist/browser/charts/core/line-options.js +1 -1
  13. package/dist/browser/charts/core/line-options.js.map +1 -1
  14. package/dist/browser/charts/core/snapshot.js +3 -2
  15. package/dist/browser/charts/core/snapshot.js.map +1 -1
  16. package/dist/browser/charts/core/svg-barGauge.js +2 -2
  17. package/dist/browser/charts/core/svg-barGauge.js.map +1 -1
  18. package/dist/browser/charts/core/svg-common.js +22 -1
  19. package/dist/browser/charts/core/svg-common.js.map +1 -1
  20. package/dist/browser/charts/core/svg-renderers.js +2 -2
  21. package/dist/browser/charts/core/svg-renderers.js.map +1 -1
  22. package/dist/browser/chat/ChatDecision.js +5 -4
  23. package/dist/browser/chat/ChatDecision.js.map +1 -1
  24. package/dist/browser/chat/ChatPrimitives.js +7 -5
  25. package/dist/browser/chat/ChatPrimitives.js.map +1 -1
  26. package/dist/browser/content/Calendar.js +1103 -922
  27. package/dist/browser/content/Calendar.js.map +1 -1
  28. package/dist/browser/content/CalendarDayView.js +336 -259
  29. package/dist/browser/content/CalendarDayView.js.map +1 -1
  30. package/dist/browser/content/CalendarWeekView.js +332 -236
  31. package/dist/browser/content/CalendarWeekView.js.map +1 -1
  32. package/dist/browser/content/ChartRoot.js +233 -100
  33. package/dist/browser/content/ChartRoot.js.map +1 -1
  34. package/dist/browser/content/MarkdownView.js +3 -1
  35. package/dist/browser/content/MarkdownView.js.map +1 -1
  36. package/dist/browser/content/ReferenceChip.js +2 -1
  37. package/dist/browser/content/ReferenceChip.js.map +1 -1
  38. package/dist/browser/content/calendar-days.js +114 -26
  39. package/dist/browser/content/calendar-days.js.map +1 -1
  40. package/dist/browser/content/calendar-event-detail.js +133 -98
  41. package/dist/browser/content/calendar-event-detail.js.map +1 -1
  42. package/dist/browser/content/calendar-events.js +107 -0
  43. package/dist/browser/content/calendar-events.js.map +1 -0
  44. package/dist/browser/content/calendar-messages.js +28 -2
  45. package/dist/browser/content/calendar-messages.js.map +1 -1
  46. package/dist/browser/content/calendar-month-layout.js +89 -5
  47. package/dist/browser/content/calendar-month-layout.js.map +1 -1
  48. package/dist/browser/content/calendar-month-scroll.js +2 -1
  49. package/dist/browser/content/calendar-month-scroll.js.map +1 -1
  50. package/dist/browser/content/calendar-overflow.browser-suite.js +534 -0
  51. package/dist/browser/content/calendar-overflow.browser-suite.js.map +1 -0
  52. package/dist/browser/content/calendar-overflow.js +366 -0
  53. package/dist/browser/content/calendar-overflow.js.map +1 -0
  54. package/dist/browser/content/calendar-shared.js +119 -104
  55. package/dist/browser/content/calendar-shared.js.map +1 -1
  56. package/dist/browser/content/calendar-snapshot.js +71 -0
  57. package/dist/browser/content/calendar-snapshot.js.map +1 -0
  58. package/dist/browser/content/calendar-time-view.js +519 -305
  59. package/dist/browser/content/calendar-time-view.js.map +1 -1
  60. package/dist/browser/content/chart-bar.js +3 -3
  61. package/dist/browser/content/chart-bar.js.map +1 -1
  62. package/dist/browser/content/chart-calendar.js +2 -1
  63. package/dist/browser/content/chart-calendar.js.map +1 -1
  64. package/dist/browser/content/chart-inspection-mount.js +1 -1
  65. package/dist/browser/content/chart-inspection-mount.js.map +1 -1
  66. package/dist/browser/content/chart-line-gaps.js +1 -1
  67. package/dist/browser/content/chart-line-gaps.js.map +1 -1
  68. package/dist/browser/content/chart-message-catalog.js +6 -0
  69. package/dist/browser/content/chart-message-catalog.js.map +1 -1
  70. package/dist/browser/content/chart-state-timeline.js +45 -12
  71. package/dist/browser/content/chart-state-timeline.js.map +1 -1
  72. package/dist/browser/content/chart-svg.js +5 -1
  73. package/dist/browser/content/chart-svg.js.map +1 -1
  74. package/dist/browser/content/chart-tick-room.js +23 -0
  75. package/dist/browser/content/chart-tick-room.js.map +1 -1
  76. package/dist/browser/content/index.js +3 -0
  77. package/dist/browser/content/index.js.map +1 -1
  78. package/dist/browser/content/markdown-info-blocks.js +1 -1
  79. package/dist/browser/content/markdown-info-blocks.js.map +1 -1
  80. package/dist/browser/content/markdown-links.js +36 -2
  81. package/dist/browser/content/markdown-links.js.map +1 -1
  82. package/dist/browser/feedback/prompt-form-loader.js +3 -2
  83. package/dist/browser/feedback/prompt-form-loader.js.map +1 -1
  84. package/dist/browser/feedback/toast.js +21 -1
  85. package/dist/browser/feedback/toast.js.map +1 -1
  86. package/dist/browser/inputs/AutocompleteSelect.js +2 -1
  87. package/dist/browser/inputs/AutocompleteSelect.js.map +1 -1
  88. package/dist/browser/inputs/ChoiceInputs.js +3 -2
  89. package/dist/browser/inputs/ChoiceInputs.js.map +1 -1
  90. package/dist/browser/inputs/ColorChoices.js +2 -1
  91. package/dist/browser/inputs/ColorChoices.js.map +1 -1
  92. package/dist/browser/inputs/RichSelect.js +2 -1
  93. package/dist/browser/inputs/RichSelect.js.map +1 -1
  94. package/dist/browser/inputs/Select.js +3 -2
  95. package/dist/browser/inputs/Select.js.map +1 -1
  96. package/dist/browser/inputs/date-picker.js +9 -0
  97. package/dist/browser/inputs/date-picker.js.map +1 -1
  98. package/dist/browser/inputs/markdown/Toolbar.js +18 -14
  99. package/dist/browser/inputs/markdown/Toolbar.js.map +1 -1
  100. package/dist/browser/internal/color.js +25 -0
  101. package/dist/browser/internal/color.js.map +1 -1
  102. package/dist/browser/internal/pending-loads.js +17 -0
  103. package/dist/browser/internal/pending-loads.js.map +1 -0
  104. package/dist/browser/intl/messages.js +16 -0
  105. package/dist/browser/intl/messages.js.map +1 -1
  106. package/dist/browser/layout/AppWorkspace.js +6 -0
  107. package/dist/browser/layout/AppWorkspace.js.map +1 -1
  108. package/dist/browser/layout/DetailSections.js +110 -98
  109. package/dist/browser/layout/DetailSections.js.map +1 -1
  110. package/dist/browser/layout/FloatingWindow.js +2 -1
  111. package/dist/browser/layout/FloatingWindow.js.map +1 -1
  112. package/dist/browser/layout/Navigation.js +172 -123
  113. package/dist/browser/layout/Navigation.js.map +1 -1
  114. package/dist/browser/layout/Panes.js +188 -237
  115. package/dist/browser/layout/Panes.js.map +1 -1
  116. package/dist/browser/layout/SidebarSwitcher.js +7 -3
  117. package/dist/browser/layout/SidebarSwitcher.js.map +1 -1
  118. package/dist/browser/layout/navigation-model.js.map +1 -1
  119. package/dist/browser/layout/panes-messages.js +0 -4
  120. package/dist/browser/layout/panes-messages.js.map +1 -1
  121. package/dist/browser/surfaces/Avatar.js +5 -2
  122. package/dist/browser/surfaces/Avatar.js.map +1 -1
  123. package/dist/browser/surfaces/NoticeCard.js +78 -36
  124. package/dist/browser/surfaces/NoticeCard.js.map +1 -1
  125. package/dist/browser/surfaces/NoticeRow.js +10 -3
  126. package/dist/browser/surfaces/NoticeRow.js.map +1 -1
  127. package/dist/browser/surfaces/index.js +1 -1
  128. package/dist/browser/surfaces/index.js.map +1 -1
  129. package/dist/browser/surfaces/notice-card-classes.js +16 -0
  130. package/dist/browser/surfaces/notice-card-classes.js.map +1 -0
  131. package/dist/browser/surfaces/person-color.js +34 -4
  132. package/dist/browser/surfaces/person-color.js.map +1 -1
  133. package/dist/browser/v2/accent.js +114 -0
  134. package/dist/browser/v2/accent.js.map +1 -0
  135. package/dist/browser/v2/action-bar.js +125 -0
  136. package/dist/browser/v2/action-bar.js.map +1 -0
  137. package/dist/browser/v2/addresses.js +135 -0
  138. package/dist/browser/v2/addresses.js.map +1 -0
  139. package/dist/browser/v2/announce.js +94 -0
  140. package/dist/browser/v2/announce.js.map +1 -0
  141. package/dist/browser/v2/attach-live.js +280 -0
  142. package/dist/browser/v2/attach-live.js.map +1 -0
  143. package/dist/browser/v2/attach.js +432 -0
  144. package/dist/browser/v2/attach.js.map +1 -0
  145. package/dist/browser/v2/bar-fold.js +405 -0
  146. package/dist/browser/v2/bar-fold.js.map +1 -0
  147. package/dist/browser/v2/behavior/adapter.js +378 -0
  148. package/dist/browser/v2/behavior/adapter.js.map +1 -0
  149. package/dist/browser/v2/behavior/bind.js +43 -0
  150. package/dist/browser/v2/behavior/bind.js.map +1 -0
  151. package/dist/browser/v2/behavior/board.js +184 -0
  152. package/dist/browser/v2/behavior/board.js.map +1 -0
  153. package/dist/browser/v2/behavior/calendar.js +39 -0
  154. package/dist/browser/v2/behavior/calendar.js.map +1 -0
  155. package/dist/browser/v2/behavior/code.js +25 -0
  156. package/dist/browser/v2/behavior/code.js.map +1 -0
  157. package/dist/browser/v2/behavior/controls.js +58 -0
  158. package/dist/browser/v2/behavior/controls.js.map +1 -0
  159. package/dist/browser/v2/behavior/dates.js +8 -0
  160. package/dist/browser/v2/behavior/dates.js.map +1 -0
  161. package/dist/browser/v2/behavior/dnd.js +545 -0
  162. package/dist/browser/v2/behavior/dnd.js.map +1 -0
  163. package/dist/browser/v2/behavior/files.js +43 -0
  164. package/dist/browser/v2/behavior/files.js.map +1 -0
  165. package/dist/browser/v2/behavior/layer.js +3 -0
  166. package/dist/browser/v2/behavior/layer.js.map +1 -0
  167. package/dist/browser/v2/behavior/lists.js +102 -0
  168. package/dist/browser/v2/behavior/lists.js.map +1 -0
  169. package/dist/browser/v2/behavior/menu.js +97 -0
  170. package/dist/browser/v2/behavior/menu.js.map +1 -0
  171. package/dist/browser/v2/behavior/messages.js +200 -0
  172. package/dist/browser/v2/behavior/messages.js.map +1 -0
  173. package/dist/browser/v2/behavior/overlays.js +304 -0
  174. package/dist/browser/v2/behavior/overlays.js.map +1 -0
  175. package/dist/browser/v2/behavior/pickers.js +86 -0
  176. package/dist/browser/v2/behavior/pickers.js.map +1 -0
  177. package/dist/browser/v2/behavior/resize.js +147 -0
  178. package/dist/browser/v2/behavior/resize.js.map +1 -0
  179. package/dist/browser/v2/behavior/segmented.js +17 -0
  180. package/dist/browser/v2/behavior/segmented.js.map +1 -0
  181. package/dist/browser/v2/behavior/select.js +134 -0
  182. package/dist/browser/v2/behavior/select.js.map +1 -0
  183. package/dist/browser/v2/behavior/time-input.js +95 -0
  184. package/dist/browser/v2/behavior/time-input.js.map +1 -0
  185. package/dist/browser/v2/behavior/time-text.js +83 -0
  186. package/dist/browser/v2/behavior/time-text.js.map +1 -0
  187. package/dist/browser/v2/behavior/tip.js +31 -0
  188. package/dist/browser/v2/behavior/tip.js.map +1 -0
  189. package/dist/browser/v2/behavior/toast.js +152 -0
  190. package/dist/browser/v2/behavior/toast.js.map +1 -0
  191. package/dist/browser/v2/behavior/treegrid.js +75 -0
  192. package/dist/browser/v2/behavior/treegrid.js.map +1 -0
  193. package/dist/browser/v2/board-messages.js +70 -0
  194. package/dist/browser/v2/board-messages.js.map +1 -0
  195. package/dist/browser/v2/board.js +471 -0
  196. package/dist/browser/v2/board.js.map +1 -0
  197. package/dist/browser/v2/button-failure.js +90 -0
  198. package/dist/browser/v2/button-failure.js.map +1 -0
  199. package/dist/browser/v2/button.js +174 -45
  200. package/dist/browser/v2/button.js.map +1 -1
  201. package/dist/browser/v2/colors.js +135 -0
  202. package/dist/browser/v2/colors.js.map +1 -0
  203. package/dist/browser/v2/columns-context.js +48 -0
  204. package/dist/browser/v2/columns-context.js.map +1 -0
  205. package/dist/browser/v2/components.js +1761 -428
  206. package/dist/browser/v2/components.js.map +1 -1
  207. package/dist/browser/v2/content.js +1650 -562
  208. package/dist/browser/v2/content.js.map +1 -1
  209. package/dist/browser/v2/control-messages.js +115 -0
  210. package/dist/browser/v2/control-messages.js.map +1 -0
  211. package/dist/browser/v2/controls.js +2391 -336
  212. package/dist/browser/v2/controls.js.map +1 -1
  213. package/dist/browser/v2/danger-zone.js +47 -0
  214. package/dist/browser/v2/danger-zone.js.map +1 -0
  215. package/dist/browser/v2/date-messages.js +61 -0
  216. package/dist/browser/v2/date-messages.js.map +1 -0
  217. package/dist/browser/v2/date-picker.js +405 -0
  218. package/dist/browser/v2/date-picker.js.map +1 -0
  219. package/dist/browser/v2/date-week-window.js +264 -0
  220. package/dist/browser/v2/date-week-window.js.map +1 -0
  221. package/dist/browser/v2/date-weeks.js +30 -0
  222. package/dist/browser/v2/date-weeks.js.map +1 -0
  223. package/dist/browser/v2/day-bar.js +87 -0
  224. package/dist/browser/v2/day-bar.js.map +1 -0
  225. package/dist/browser/v2/describe.js +244 -59
  226. package/dist/browser/v2/describe.js.map +1 -1
  227. package/dist/browser/v2/draft.js +55 -0
  228. package/dist/browser/v2/draft.js.map +1 -0
  229. package/dist/browser/v2/emoji-picker.js +240 -0
  230. package/dist/browser/v2/emoji-picker.js.map +1 -0
  231. package/dist/browser/v2/ends.js +37 -0
  232. package/dist/browser/v2/ends.js.map +1 -0
  233. package/dist/browser/v2/error-screen.js +118 -0
  234. package/dist/browser/v2/error-screen.js.map +1 -0
  235. package/dist/browser/v2/failed.js +90 -0
  236. package/dist/browser/v2/failed.js.map +1 -0
  237. package/dist/browser/v2/figures.js +179 -0
  238. package/dist/browser/v2/figures.js.map +1 -0
  239. package/dist/browser/v2/filter-bar.js +3009 -0
  240. package/dist/browser/v2/filter-bar.js.map +1 -0
  241. package/dist/browser/v2/filter-messages.js +244 -0
  242. package/dist/browser/v2/filter-messages.js.map +1 -0
  243. package/dist/browser/v2/head-search.js +159 -0
  244. package/dist/browser/v2/head-search.js.map +1 -0
  245. package/dist/browser/v2/heat-days.js +91 -0
  246. package/dist/browser/v2/heat-days.js.map +1 -0
  247. package/dist/browser/v2/heat.js +260 -0
  248. package/dist/browser/v2/heat.js.map +1 -0
  249. package/dist/browser/v2/icon.js +48 -0
  250. package/dist/browser/v2/icon.js.map +1 -0
  251. package/dist/browser/v2/index.js +66 -7
  252. package/dist/browser/v2/index.js.map +1 -1
  253. package/dist/browser/v2/layout.js +1815 -275
  254. package/dist/browser/v2/layout.js.map +1 -1
  255. package/dist/browser/v2/list-group.js +57 -0
  256. package/dist/browser/v2/list-group.js.map +1 -0
  257. package/dist/browser/v2/list-query.js +736 -0
  258. package/dist/browser/v2/list-query.js.map +1 -0
  259. package/dist/browser/v2/lookup.js +431 -0
  260. package/dist/browser/v2/lookup.js.map +1 -0
  261. package/dist/browser/v2/marks.js +607 -85
  262. package/dist/browser/v2/marks.js.map +1 -1
  263. package/dist/browser/v2/menu-panel.js +241 -0
  264. package/dist/browser/v2/menu-panel.js.map +1 -0
  265. package/dist/browser/v2/menu.js +797 -0
  266. package/dist/browser/v2/menu.js.map +1 -0
  267. package/dist/browser/v2/nav-drop.js +25 -0
  268. package/dist/browser/v2/nav-drop.js.map +1 -0
  269. package/dist/browser/v2/nav-face.js +16 -0
  270. package/dist/browser/v2/nav-face.js.map +1 -0
  271. package/dist/browser/v2/nav-tree.js +498 -0
  272. package/dist/browser/v2/nav-tree.js.map +1 -0
  273. package/dist/browser/v2/now-line.js +61 -0
  274. package/dist/browser/v2/now-line.js.map +1 -0
  275. package/dist/browser/v2/overlay-messages.js +41 -0
  276. package/dist/browser/v2/overlay-messages.js.map +1 -0
  277. package/dist/browser/v2/overlays.js +431 -0
  278. package/dist/browser/v2/overlays.js.map +1 -0
  279. package/dist/browser/v2/page-layer.js +42 -0
  280. package/dist/browser/v2/page-layer.js.map +1 -0
  281. package/dist/browser/v2/pane-name.js +55 -0
  282. package/dist/browser/v2/pane-name.js.map +1 -0
  283. package/dist/browser/v2/pane-print.js +32 -0
  284. package/dist/browser/v2/pane-print.js.map +1 -0
  285. package/dist/browser/v2/pane-sheet.js +147 -0
  286. package/dist/browser/v2/pane-sheet.js.map +1 -0
  287. package/dist/browser/v2/popover.js +152 -0
  288. package/dist/browser/v2/popover.js.map +1 -0
  289. package/dist/browser/v2/reaction-messages.js +31 -0
  290. package/dist/browser/v2/reaction-messages.js.map +1 -0
  291. package/dist/browser/v2/reactions.js +239 -0
  292. package/dist/browser/v2/reactions.js.map +1 -0
  293. package/dist/browser/v2/row-drag.js +19 -0
  294. package/dist/browser/v2/row-drag.js.map +1 -0
  295. package/dist/browser/v2/section-level.js +9 -0
  296. package/dist/browser/v2/section-level.js.map +1 -0
  297. package/dist/browser/v2/segmented.js +146 -0
  298. package/dist/browser/v2/segmented.js.map +1 -0
  299. package/dist/browser/v2/select-live.js +162 -0
  300. package/dist/browser/v2/select-live.js.map +1 -0
  301. package/dist/browser/v2/setting-messages.js +25 -0
  302. package/dist/browser/v2/setting-messages.js.map +1 -0
  303. package/dist/browser/v2/split-button.js +82 -0
  304. package/dist/browser/v2/split-button.js.map +1 -0
  305. package/dist/browser/v2/states.js +132 -104
  306. package/dist/browser/v2/states.js.map +1 -1
  307. package/dist/browser/v2/status-toolbar.js +23 -0
  308. package/dist/browser/v2/status-toolbar.js.map +1 -0
  309. package/dist/browser/v2/structure.js +331 -156
  310. package/dist/browser/v2/structure.js.map +1 -1
  311. package/dist/browser/v2/testing/index.js +3 -0
  312. package/dist/browser/v2/testing/index.js.map +1 -1
  313. package/dist/browser/v2/testing/measure-v2-layout.js +367 -105
  314. package/dist/browser/v2/testing/measure-v2-layout.js.map +1 -1
  315. package/dist/browser/v2/testing/settled.js +8 -2
  316. package/dist/browser/v2/testing/settled.js.map +1 -1
  317. package/dist/browser/v2/testing/visible.js +14 -0
  318. package/dist/browser/v2/testing/visible.js.map +1 -0
  319. package/dist/browser/v2/toast-host.js +18 -0
  320. package/dist/browser/v2/toast-host.js.map +1 -0
  321. package/dist/browser/v2/toast.js +241 -0
  322. package/dist/browser/v2/toast.js.map +1 -0
  323. package/dist/browser/v2/tokens.js +14 -0
  324. package/dist/browser/v2/tokens.js.map +1 -1
  325. package/dist/browser/v2/tree-messages.js +32 -0
  326. package/dist/browser/v2/tree-messages.js.map +1 -0
  327. package/dist/browser/v2/types.js +51 -4
  328. package/dist/browser/v2/types.js.map +1 -1
  329. package/dist/browser/v2/unsaved-bar.js +225 -0
  330. package/dist/browser/v2/unsaved-bar.js.map +1 -0
  331. package/dist/browser/v2/unsaved-messages.js +65 -0
  332. package/dist/browser/v2/unsaved-messages.js.map +1 -0
  333. package/dist/browser/v2/width-cookie.js +45 -0
  334. package/dist/browser/v2/width-cookie.js.map +1 -0
  335. package/dist/browser/v2/workspace-messages.js +31 -0
  336. package/dist/browser/v2/workspace-messages.js.map +1 -0
  337. package/dist/browser/widgets/Dashboard.js +3 -2
  338. package/dist/browser/widgets/Dashboard.js.map +1 -1
  339. package/dist/ssr/actions/Dropdown.js +2 -1
  340. package/dist/ssr/actions/Dropdown.js.map +1 -1
  341. package/dist/ssr/actions/FilterChip.js +3 -2
  342. package/dist/ssr/actions/FilterChip.js.map +1 -1
  343. package/dist/ssr/actions/SegmentedControl.js +2 -2
  344. package/dist/ssr/actions/SegmentedControl.js.map +1 -1
  345. package/dist/ssr/charts/core/line-details.js +52 -12
  346. package/dist/ssr/charts/core/line-details.js.map +1 -1
  347. package/dist/ssr/charts/core/line-extras.js +122 -0
  348. package/dist/ssr/charts/core/line-extras.js.map +1 -0
  349. package/dist/ssr/charts/core/line-options.js +1 -1
  350. package/dist/ssr/charts/core/line-options.js.map +1 -1
  351. package/dist/ssr/charts/core/snapshot.js +3 -2
  352. package/dist/ssr/charts/core/snapshot.js.map +1 -1
  353. package/dist/ssr/charts/core/svg-barGauge.js +2 -2
  354. package/dist/ssr/charts/core/svg-barGauge.js.map +1 -1
  355. package/dist/ssr/charts/core/svg-common.js +22 -1
  356. package/dist/ssr/charts/core/svg-common.js.map +1 -1
  357. package/dist/ssr/charts/core/svg-renderers.js +2 -2
  358. package/dist/ssr/charts/core/svg-renderers.js.map +1 -1
  359. package/dist/ssr/chat/ChatDecision.js +5 -4
  360. package/dist/ssr/chat/ChatDecision.js.map +1 -1
  361. package/dist/ssr/chat/ChatPrimitives.js +7 -5
  362. package/dist/ssr/chat/ChatPrimitives.js.map +1 -1
  363. package/dist/ssr/content/Calendar.js +410 -323
  364. package/dist/ssr/content/Calendar.js.map +1 -1
  365. package/dist/ssr/content/CalendarDayView.js +122 -49
  366. package/dist/ssr/content/CalendarDayView.js.map +1 -1
  367. package/dist/ssr/content/CalendarWeekView.js +152 -49
  368. package/dist/ssr/content/CalendarWeekView.js.map +1 -1
  369. package/dist/ssr/content/ChartRoot.js +82 -16
  370. package/dist/ssr/content/ChartRoot.js.map +1 -1
  371. package/dist/ssr/content/MarkdownView.js +3 -1
  372. package/dist/ssr/content/MarkdownView.js.map +1 -1
  373. package/dist/ssr/content/ReferenceChip.js +2 -1
  374. package/dist/ssr/content/ReferenceChip.js.map +1 -1
  375. package/dist/ssr/content/calendar-days.js +114 -26
  376. package/dist/ssr/content/calendar-days.js.map +1 -1
  377. package/dist/ssr/content/calendar-event-detail.js +46 -10
  378. package/dist/ssr/content/calendar-event-detail.js.map +1 -1
  379. package/dist/ssr/content/calendar-events.js +107 -0
  380. package/dist/ssr/content/calendar-events.js.map +1 -0
  381. package/dist/ssr/content/calendar-messages.js +28 -2
  382. package/dist/ssr/content/calendar-messages.js.map +1 -1
  383. package/dist/ssr/content/calendar-month-layout.js +89 -5
  384. package/dist/ssr/content/calendar-month-layout.js.map +1 -1
  385. package/dist/ssr/content/calendar-month-scroll.js +2 -1
  386. package/dist/ssr/content/calendar-month-scroll.js.map +1 -1
  387. package/dist/ssr/content/calendar-overflow.browser-suite.js +534 -0
  388. package/dist/ssr/content/calendar-overflow.browser-suite.js.map +1 -0
  389. package/dist/ssr/content/calendar-overflow.js +272 -0
  390. package/dist/ssr/content/calendar-overflow.js.map +1 -0
  391. package/dist/ssr/content/calendar-shared.js +47 -42
  392. package/dist/ssr/content/calendar-shared.js.map +1 -1
  393. package/dist/ssr/content/calendar-snapshot.js +71 -0
  394. package/dist/ssr/content/calendar-snapshot.js.map +1 -0
  395. package/dist/ssr/content/calendar-time-view.js +319 -136
  396. package/dist/ssr/content/calendar-time-view.js.map +1 -1
  397. package/dist/ssr/content/chart-bar.js +3 -3
  398. package/dist/ssr/content/chart-bar.js.map +1 -1
  399. package/dist/ssr/content/chart-calendar.js +2 -1
  400. package/dist/ssr/content/chart-calendar.js.map +1 -1
  401. package/dist/ssr/content/chart-inspection-mount.js +1 -1
  402. package/dist/ssr/content/chart-inspection-mount.js.map +1 -1
  403. package/dist/ssr/content/chart-line-gaps.js +1 -1
  404. package/dist/ssr/content/chart-line-gaps.js.map +1 -1
  405. package/dist/ssr/content/chart-message-catalog.js +6 -0
  406. package/dist/ssr/content/chart-message-catalog.js.map +1 -1
  407. package/dist/ssr/content/chart-state-timeline.js +45 -12
  408. package/dist/ssr/content/chart-state-timeline.js.map +1 -1
  409. package/dist/ssr/content/chart-svg.js +5 -1
  410. package/dist/ssr/content/chart-svg.js.map +1 -1
  411. package/dist/ssr/content/chart-tick-room.js +23 -0
  412. package/dist/ssr/content/chart-tick-room.js.map +1 -1
  413. package/dist/ssr/content/index.js +3 -0
  414. package/dist/ssr/content/index.js.map +1 -1
  415. package/dist/ssr/content/markdown-info-blocks.js +1 -1
  416. package/dist/ssr/content/markdown-info-blocks.js.map +1 -1
  417. package/dist/ssr/content/markdown-links.js +36 -2
  418. package/dist/ssr/content/markdown-links.js.map +1 -1
  419. package/dist/ssr/feedback/prompt-form-loader.js +3 -2
  420. package/dist/ssr/feedback/prompt-form-loader.js.map +1 -1
  421. package/dist/ssr/feedback/toast.js +21 -1
  422. package/dist/ssr/feedback/toast.js.map +1 -1
  423. package/dist/ssr/inputs/AutocompleteSelect.js +2 -1
  424. package/dist/ssr/inputs/AutocompleteSelect.js.map +1 -1
  425. package/dist/ssr/inputs/ChoiceInputs.js +3 -2
  426. package/dist/ssr/inputs/ChoiceInputs.js.map +1 -1
  427. package/dist/ssr/inputs/ColorChoices.js +2 -1
  428. package/dist/ssr/inputs/ColorChoices.js.map +1 -1
  429. package/dist/ssr/inputs/RichSelect.js +2 -1
  430. package/dist/ssr/inputs/RichSelect.js.map +1 -1
  431. package/dist/ssr/inputs/Select.js +3 -2
  432. package/dist/ssr/inputs/Select.js.map +1 -1
  433. package/dist/ssr/inputs/date-picker.js +9 -0
  434. package/dist/ssr/inputs/date-picker.js.map +1 -1
  435. package/dist/ssr/inputs/markdown/Toolbar.js +6 -1
  436. package/dist/ssr/inputs/markdown/Toolbar.js.map +1 -1
  437. package/dist/ssr/internal/color.js +25 -0
  438. package/dist/ssr/internal/color.js.map +1 -1
  439. package/dist/ssr/internal/pending-loads.js +17 -0
  440. package/dist/ssr/internal/pending-loads.js.map +1 -0
  441. package/dist/ssr/intl/messages.js +16 -0
  442. package/dist/ssr/intl/messages.js.map +1 -1
  443. package/dist/ssr/layout/AppWorkspace.js +6 -0
  444. package/dist/ssr/layout/AppWorkspace.js.map +1 -1
  445. package/dist/ssr/layout/DetailSections.js +19 -10
  446. package/dist/ssr/layout/DetailSections.js.map +1 -1
  447. package/dist/ssr/layout/FloatingWindow.js +2 -1
  448. package/dist/ssr/layout/FloatingWindow.js.map +1 -1
  449. package/dist/ssr/layout/Navigation.js +54 -26
  450. package/dist/ssr/layout/Navigation.js.map +1 -1
  451. package/dist/ssr/layout/Panes.js +32 -67
  452. package/dist/ssr/layout/Panes.js.map +1 -1
  453. package/dist/ssr/layout/SidebarSwitcher.js +7 -3
  454. package/dist/ssr/layout/SidebarSwitcher.js.map +1 -1
  455. package/dist/ssr/layout/navigation-model.js.map +1 -1
  456. package/dist/ssr/layout/panes-messages.js +0 -4
  457. package/dist/ssr/layout/panes-messages.js.map +1 -1
  458. package/dist/ssr/surfaces/Avatar.js +5 -2
  459. package/dist/ssr/surfaces/Avatar.js.map +1 -1
  460. package/dist/ssr/surfaces/NoticeCard.js +27 -20
  461. package/dist/ssr/surfaces/NoticeCard.js.map +1 -1
  462. package/dist/ssr/surfaces/NoticeRow.js +10 -3
  463. package/dist/ssr/surfaces/NoticeRow.js.map +1 -1
  464. package/dist/ssr/surfaces/index.js +1 -1
  465. package/dist/ssr/surfaces/index.js.map +1 -1
  466. package/dist/ssr/surfaces/notice-card-classes.js +16 -0
  467. package/dist/ssr/surfaces/notice-card-classes.js.map +1 -0
  468. package/dist/ssr/surfaces/person-color.js +34 -4
  469. package/dist/ssr/surfaces/person-color.js.map +1 -1
  470. package/dist/ssr/v2/accent.js +114 -0
  471. package/dist/ssr/v2/accent.js.map +1 -0
  472. package/dist/ssr/v2/action-bar.js +88 -0
  473. package/dist/ssr/v2/action-bar.js.map +1 -0
  474. package/dist/ssr/v2/addresses.js +135 -0
  475. package/dist/ssr/v2/addresses.js.map +1 -0
  476. package/dist/ssr/v2/announce.js +93 -0
  477. package/dist/ssr/v2/announce.js.map +1 -0
  478. package/dist/ssr/v2/attach-live.js +279 -0
  479. package/dist/ssr/v2/attach-live.js.map +1 -0
  480. package/dist/ssr/v2/attach.js +432 -0
  481. package/dist/ssr/v2/attach.js.map +1 -0
  482. package/dist/ssr/v2/bar-fold.js +405 -0
  483. package/dist/ssr/v2/bar-fold.js.map +1 -0
  484. package/dist/ssr/v2/behavior/adapter.js +378 -0
  485. package/dist/ssr/v2/behavior/adapter.js.map +1 -0
  486. package/dist/ssr/v2/behavior/bind.js +43 -0
  487. package/dist/ssr/v2/behavior/bind.js.map +1 -0
  488. package/dist/ssr/v2/behavior/board.js +184 -0
  489. package/dist/ssr/v2/behavior/board.js.map +1 -0
  490. package/dist/ssr/v2/behavior/calendar.js +39 -0
  491. package/dist/ssr/v2/behavior/calendar.js.map +1 -0
  492. package/dist/ssr/v2/behavior/code.js +25 -0
  493. package/dist/ssr/v2/behavior/code.js.map +1 -0
  494. package/dist/ssr/v2/behavior/controls.js +58 -0
  495. package/dist/ssr/v2/behavior/controls.js.map +1 -0
  496. package/dist/ssr/v2/behavior/dates.js +8 -0
  497. package/dist/ssr/v2/behavior/dates.js.map +1 -0
  498. package/dist/ssr/v2/behavior/dnd.js +545 -0
  499. package/dist/ssr/v2/behavior/dnd.js.map +1 -0
  500. package/dist/ssr/v2/behavior/files.js +43 -0
  501. package/dist/ssr/v2/behavior/files.js.map +1 -0
  502. package/dist/ssr/v2/behavior/layer.js +3 -0
  503. package/dist/ssr/v2/behavior/layer.js.map +1 -0
  504. package/dist/ssr/v2/behavior/lists.js +102 -0
  505. package/dist/ssr/v2/behavior/lists.js.map +1 -0
  506. package/dist/ssr/v2/behavior/menu.js +91 -0
  507. package/dist/ssr/v2/behavior/menu.js.map +1 -0
  508. package/dist/ssr/v2/behavior/messages.js +200 -0
  509. package/dist/ssr/v2/behavior/messages.js.map +1 -0
  510. package/dist/ssr/v2/behavior/overlays.js +293 -0
  511. package/dist/ssr/v2/behavior/overlays.js.map +1 -0
  512. package/dist/ssr/v2/behavior/pickers.js +86 -0
  513. package/dist/ssr/v2/behavior/pickers.js.map +1 -0
  514. package/dist/ssr/v2/behavior/resize.js +147 -0
  515. package/dist/ssr/v2/behavior/resize.js.map +1 -0
  516. package/dist/ssr/v2/behavior/segmented.js +17 -0
  517. package/dist/ssr/v2/behavior/segmented.js.map +1 -0
  518. package/dist/ssr/v2/behavior/select.js +133 -0
  519. package/dist/ssr/v2/behavior/select.js.map +1 -0
  520. package/dist/ssr/v2/behavior/time-input.js +95 -0
  521. package/dist/ssr/v2/behavior/time-input.js.map +1 -0
  522. package/dist/ssr/v2/behavior/time-text.js +83 -0
  523. package/dist/ssr/v2/behavior/time-text.js.map +1 -0
  524. package/dist/ssr/v2/behavior/tip.js +31 -0
  525. package/dist/ssr/v2/behavior/tip.js.map +1 -0
  526. package/dist/ssr/v2/behavior/toast.js +152 -0
  527. package/dist/ssr/v2/behavior/toast.js.map +1 -0
  528. package/dist/ssr/v2/behavior/treegrid.js +75 -0
  529. package/dist/ssr/v2/behavior/treegrid.js.map +1 -0
  530. package/dist/ssr/v2/board-messages.js +70 -0
  531. package/dist/ssr/v2/board-messages.js.map +1 -0
  532. package/dist/ssr/v2/board.js +388 -0
  533. package/dist/ssr/v2/board.js.map +1 -0
  534. package/dist/ssr/v2/button-failure.js +90 -0
  535. package/dist/ssr/v2/button-failure.js.map +1 -0
  536. package/dist/ssr/v2/button.js +172 -45
  537. package/dist/ssr/v2/button.js.map +1 -1
  538. package/dist/ssr/v2/colors.js +135 -0
  539. package/dist/ssr/v2/colors.js.map +1 -0
  540. package/dist/ssr/v2/columns-context.js +48 -0
  541. package/dist/ssr/v2/columns-context.js.map +1 -0
  542. package/dist/ssr/v2/components.js +1184 -218
  543. package/dist/ssr/v2/components.js.map +1 -1
  544. package/dist/ssr/v2/content.js +1026 -256
  545. package/dist/ssr/v2/content.js.map +1 -1
  546. package/dist/ssr/v2/control-messages.js +115 -0
  547. package/dist/ssr/v2/control-messages.js.map +1 -0
  548. package/dist/ssr/v2/controls.js +1715 -95
  549. package/dist/ssr/v2/controls.js.map +1 -1
  550. package/dist/ssr/v2/danger-zone.js +28 -0
  551. package/dist/ssr/v2/danger-zone.js.map +1 -0
  552. package/dist/ssr/v2/date-messages.js +61 -0
  553. package/dist/ssr/v2/date-messages.js.map +1 -0
  554. package/dist/ssr/v2/date-picker.js +351 -0
  555. package/dist/ssr/v2/date-picker.js.map +1 -0
  556. package/dist/ssr/v2/date-week-window.js +149 -0
  557. package/dist/ssr/v2/date-week-window.js.map +1 -0
  558. package/dist/ssr/v2/date-weeks.js +30 -0
  559. package/dist/ssr/v2/date-weeks.js.map +1 -0
  560. package/dist/ssr/v2/day-bar.js +52 -0
  561. package/dist/ssr/v2/day-bar.js.map +1 -0
  562. package/dist/ssr/v2/describe.js +244 -59
  563. package/dist/ssr/v2/describe.js.map +1 -1
  564. package/dist/ssr/v2/draft.js +55 -0
  565. package/dist/ssr/v2/draft.js.map +1 -0
  566. package/dist/ssr/v2/emoji-picker.js +182 -0
  567. package/dist/ssr/v2/emoji-picker.js.map +1 -0
  568. package/dist/ssr/v2/ends.js +27 -0
  569. package/dist/ssr/v2/ends.js.map +1 -0
  570. package/dist/ssr/v2/error-screen.js +73 -0
  571. package/dist/ssr/v2/error-screen.js.map +1 -0
  572. package/dist/ssr/v2/failed.js +63 -0
  573. package/dist/ssr/v2/failed.js.map +1 -0
  574. package/dist/ssr/v2/figures.js +101 -0
  575. package/dist/ssr/v2/figures.js.map +1 -0
  576. package/dist/ssr/v2/filter-bar.js +2495 -0
  577. package/dist/ssr/v2/filter-bar.js.map +1 -0
  578. package/dist/ssr/v2/filter-messages.js +244 -0
  579. package/dist/ssr/v2/filter-messages.js.map +1 -0
  580. package/dist/ssr/v2/head-search.js +159 -0
  581. package/dist/ssr/v2/head-search.js.map +1 -0
  582. package/dist/ssr/v2/heat-days.js +91 -0
  583. package/dist/ssr/v2/heat-days.js.map +1 -0
  584. package/dist/ssr/v2/heat.js +145 -0
  585. package/dist/ssr/v2/heat.js.map +1 -0
  586. package/dist/ssr/v2/icon.js +18 -0
  587. package/dist/ssr/v2/icon.js.map +1 -0
  588. package/dist/ssr/v2/index.js +66 -7
  589. package/dist/ssr/v2/index.js.map +1 -1
  590. package/dist/ssr/v2/layout.js +1214 -108
  591. package/dist/ssr/v2/layout.js.map +1 -1
  592. package/dist/ssr/v2/list-group.js +37 -0
  593. package/dist/ssr/v2/list-group.js.map +1 -0
  594. package/dist/ssr/v2/list-query.js +736 -0
  595. package/dist/ssr/v2/list-query.js.map +1 -0
  596. package/dist/ssr/v2/lookup.js +333 -0
  597. package/dist/ssr/v2/lookup.js.map +1 -0
  598. package/dist/ssr/v2/marks.js +331 -24
  599. package/dist/ssr/v2/marks.js.map +1 -1
  600. package/dist/ssr/v2/menu-panel.js +217 -0
  601. package/dist/ssr/v2/menu-panel.js.map +1 -0
  602. package/dist/ssr/v2/menu.js +733 -0
  603. package/dist/ssr/v2/menu.js.map +1 -0
  604. package/dist/ssr/v2/nav-drop.js +25 -0
  605. package/dist/ssr/v2/nav-drop.js.map +1 -0
  606. package/dist/ssr/v2/nav-face.js +16 -0
  607. package/dist/ssr/v2/nav-face.js.map +1 -0
  608. package/dist/ssr/v2/nav-tree.js +436 -0
  609. package/dist/ssr/v2/nav-tree.js.map +1 -0
  610. package/dist/ssr/v2/now-line.js +44 -0
  611. package/dist/ssr/v2/now-line.js.map +1 -0
  612. package/dist/ssr/v2/overlay-messages.js +41 -0
  613. package/dist/ssr/v2/overlay-messages.js.map +1 -0
  614. package/dist/ssr/v2/overlays.js +365 -0
  615. package/dist/ssr/v2/overlays.js.map +1 -0
  616. package/dist/ssr/v2/page-layer.js +41 -0
  617. package/dist/ssr/v2/page-layer.js.map +1 -0
  618. package/dist/ssr/v2/pane-name.js +33 -0
  619. package/dist/ssr/v2/pane-name.js.map +1 -0
  620. package/dist/ssr/v2/pane-print.js +32 -0
  621. package/dist/ssr/v2/pane-print.js.map +1 -0
  622. package/dist/ssr/v2/pane-sheet.js +147 -0
  623. package/dist/ssr/v2/pane-sheet.js.map +1 -0
  624. package/dist/ssr/v2/popover.js +144 -0
  625. package/dist/ssr/v2/popover.js.map +1 -0
  626. package/dist/ssr/v2/reaction-messages.js +31 -0
  627. package/dist/ssr/v2/reaction-messages.js.map +1 -0
  628. package/dist/ssr/v2/reactions.js +200 -0
  629. package/dist/ssr/v2/reactions.js.map +1 -0
  630. package/dist/ssr/v2/row-drag.js +19 -0
  631. package/dist/ssr/v2/row-drag.js.map +1 -0
  632. package/dist/ssr/v2/section-level.js +9 -0
  633. package/dist/ssr/v2/section-level.js.map +1 -0
  634. package/dist/ssr/v2/segmented.js +104 -0
  635. package/dist/ssr/v2/segmented.js.map +1 -0
  636. package/dist/ssr/v2/select-live.js +142 -0
  637. package/dist/ssr/v2/select-live.js.map +1 -0
  638. package/dist/ssr/v2/setting-messages.js +25 -0
  639. package/dist/ssr/v2/setting-messages.js.map +1 -0
  640. package/dist/ssr/v2/split-button.js +66 -0
  641. package/dist/ssr/v2/split-button.js.map +1 -0
  642. package/dist/ssr/v2/states.js +89 -77
  643. package/dist/ssr/v2/states.js.map +1 -1
  644. package/dist/ssr/v2/status-toolbar.js +23 -0
  645. package/dist/ssr/v2/status-toolbar.js.map +1 -0
  646. package/dist/ssr/v2/structure.js +224 -71
  647. package/dist/ssr/v2/structure.js.map +1 -1
  648. package/dist/ssr/v2/testing/index.js +3 -0
  649. package/dist/ssr/v2/testing/index.js.map +1 -1
  650. package/dist/ssr/v2/testing/measure-v2-layout.js +367 -105
  651. package/dist/ssr/v2/testing/measure-v2-layout.js.map +1 -1
  652. package/dist/ssr/v2/testing/settled.js +8 -2
  653. package/dist/ssr/v2/testing/settled.js.map +1 -1
  654. package/dist/ssr/v2/testing/visible.js +14 -0
  655. package/dist/ssr/v2/testing/visible.js.map +1 -0
  656. package/dist/ssr/v2/toast-host.js +18 -0
  657. package/dist/ssr/v2/toast-host.js.map +1 -0
  658. package/dist/ssr/v2/toast.js +222 -0
  659. package/dist/ssr/v2/toast.js.map +1 -0
  660. package/dist/ssr/v2/tokens.js +14 -0
  661. package/dist/ssr/v2/tokens.js.map +1 -1
  662. package/dist/ssr/v2/tree-messages.js +32 -0
  663. package/dist/ssr/v2/tree-messages.js.map +1 -0
  664. package/dist/ssr/v2/types.js +51 -4
  665. package/dist/ssr/v2/types.js.map +1 -1
  666. package/dist/ssr/v2/unsaved-bar.js +183 -0
  667. package/dist/ssr/v2/unsaved-bar.js.map +1 -0
  668. package/dist/ssr/v2/unsaved-messages.js +65 -0
  669. package/dist/ssr/v2/unsaved-messages.js.map +1 -0
  670. package/dist/ssr/v2/width-cookie.js +45 -0
  671. package/dist/ssr/v2/width-cookie.js.map +1 -0
  672. package/dist/ssr/v2/workspace-messages.js +31 -0
  673. package/dist/ssr/v2/workspace-messages.js.map +1 -0
  674. package/dist/ssr/widgets/Dashboard.js +3 -2
  675. package/dist/ssr/widgets/Dashboard.js.map +1 -1
  676. package/dist/styles.css +1 -1
  677. package/dist/tabler.css +1 -1
  678. package/dist/types/actions/SegmentedControl.d.ts +4 -0
  679. package/dist/types/charts/core/line-extras.d.ts +33 -0
  680. package/dist/types/charts/core/line-options.d.ts +3 -0
  681. package/dist/types/charts/core/svg-common.d.ts +49 -2
  682. package/dist/types/content/Calendar.d.ts +14 -2
  683. package/dist/types/content/MarkdownView.d.ts +2 -0
  684. package/dist/types/content/calendar-days.d.ts +52 -2
  685. package/dist/types/content/calendar-events.d.ts +35 -0
  686. package/dist/types/content/calendar-messages.d.ts +13 -0
  687. package/dist/types/content/calendar-month-layout.d.ts +44 -4
  688. package/dist/types/content/calendar-month-scroll.d.ts +2 -1
  689. package/dist/types/content/calendar-overflow.browser-suite.d.ts +37 -0
  690. package/dist/types/content/calendar-overflow.d.ts +30 -0
  691. package/dist/types/content/calendar-shared.d.ts +9 -11
  692. package/dist/types/content/calendar-snapshot.d.ts +28 -0
  693. package/dist/types/content/calendar-time-view.d.ts +37 -12
  694. package/dist/types/content/chart-bar.d.ts +1 -1
  695. package/dist/types/content/chart-inspection-mount.d.ts +1 -1
  696. package/dist/types/content/chart-line-gaps.d.ts +1 -1
  697. package/dist/types/content/chart-message-catalog.d.ts +6 -0
  698. package/dist/types/content/chart-state-timeline.d.ts +20 -0
  699. package/dist/types/content/chart-tick-room.d.ts +8 -0
  700. package/dist/types/content/index.d.ts +3 -0
  701. package/dist/types/content/markdown-links.d.ts +2 -1
  702. package/dist/types/inputs/date-picker.d.ts +2 -0
  703. package/dist/types/internal/color.d.ts +8 -0
  704. package/dist/types/internal/pending-loads.d.ts +8 -0
  705. package/dist/types/intl/messages.d.ts +8 -0
  706. package/dist/types/layout/AppWorkspace.d.ts +5 -0
  707. package/dist/types/layout/DetailSections.d.ts +11 -1
  708. package/dist/types/layout/Panes.d.ts +2 -2
  709. package/dist/types/layout/navigation-model.d.ts +5 -0
  710. package/dist/types/layout/panes-messages.d.ts +0 -2
  711. package/dist/types/surfaces/NoticeCard.d.ts +9 -13
  712. package/dist/types/surfaces/NoticeRow.d.ts +6 -1
  713. package/dist/types/surfaces/index.d.ts +1 -1
  714. package/dist/types/surfaces/notice-card-classes.d.ts +14 -0
  715. package/dist/types/surfaces/person-color.d.ts +27 -4
  716. package/dist/types/v2/accent.d.ts +24 -0
  717. package/dist/types/v2/action-bar.d.ts +37 -0
  718. package/dist/types/v2/addresses.d.ts +26 -0
  719. package/dist/types/v2/announce.d.ts +17 -0
  720. package/dist/types/v2/attach-live.d.ts +21 -0
  721. package/dist/types/v2/attach.d.ts +37 -0
  722. package/dist/types/v2/bar-fold.d.ts +40 -0
  723. package/dist/types/v2/behavior/adapter.d.ts +69 -0
  724. package/dist/types/v2/behavior/bind.d.ts +14 -0
  725. package/dist/types/v2/behavior/board.d.ts +45 -0
  726. package/dist/types/v2/behavior/calendar.d.ts +35 -0
  727. package/dist/types/v2/behavior/code.d.ts +27 -0
  728. package/dist/types/v2/behavior/controls.d.ts +51 -0
  729. package/dist/types/v2/behavior/dates.d.ts +7 -0
  730. package/dist/types/v2/behavior/dnd.d.ts +61 -0
  731. package/dist/types/v2/behavior/files.d.ts +44 -0
  732. package/dist/types/v2/behavior/layer.d.ts +1 -0
  733. package/dist/types/v2/behavior/lists.d.ts +91 -0
  734. package/dist/types/v2/behavior/menu.d.ts +56 -0
  735. package/dist/types/v2/behavior/messages.d.ts +72 -0
  736. package/dist/types/v2/behavior/overlays.d.ts +126 -0
  737. package/dist/types/v2/behavior/pickers.d.ts +62 -0
  738. package/dist/types/v2/behavior/resize.d.ts +57 -0
  739. package/dist/types/v2/behavior/segmented.d.ts +18 -0
  740. package/dist/types/v2/behavior/select.d.ts +73 -0
  741. package/dist/types/v2/behavior/time-input.d.ts +36 -0
  742. package/dist/types/v2/behavior/time-text.d.ts +14 -0
  743. package/dist/types/v2/behavior/tip.d.ts +17 -0
  744. package/dist/types/v2/behavior/toast.d.ts +90 -0
  745. package/dist/types/v2/behavior/treegrid.d.ts +40 -0
  746. package/dist/types/v2/board-messages.d.ts +22 -0
  747. package/dist/types/v2/board.d.ts +79 -0
  748. package/dist/types/v2/button-failure.d.ts +18 -0
  749. package/dist/types/v2/button.d.ts +77 -5
  750. package/dist/types/v2/colors.d.ts +42 -0
  751. package/dist/types/v2/columns-context.d.ts +50 -0
  752. package/dist/types/v2/components.d.ts +375 -29
  753. package/dist/types/v2/content.d.ts +265 -20
  754. package/dist/types/v2/control-messages.d.ts +55 -0
  755. package/dist/types/v2/controls.d.ts +459 -26
  756. package/dist/types/v2/danger-zone.d.ts +23 -0
  757. package/dist/types/v2/date-messages.d.ts +28 -0
  758. package/dist/types/v2/date-picker.d.ts +47 -0
  759. package/dist/types/v2/date-week-window.d.ts +22 -0
  760. package/dist/types/v2/date-weeks.d.ts +11 -0
  761. package/dist/types/v2/day-bar.d.ts +28 -0
  762. package/dist/types/v2/draft.d.ts +36 -0
  763. package/dist/types/v2/emoji-picker.d.ts +10 -0
  764. package/dist/types/v2/ends.d.ts +8 -0
  765. package/dist/types/v2/error-screen.d.ts +59 -0
  766. package/dist/types/v2/failed.d.ts +15 -0
  767. package/dist/types/v2/figures.d.ts +66 -0
  768. package/dist/types/v2/filter-bar.d.ts +111 -0
  769. package/dist/types/v2/filter-messages.d.ts +121 -0
  770. package/dist/types/v2/head-search.d.ts +13 -0
  771. package/dist/types/v2/heat-days.d.ts +44 -0
  772. package/dist/types/v2/heat.d.ts +40 -0
  773. package/dist/types/v2/icon.d.ts +16 -0
  774. package/dist/types/v2/index.d.ts +45 -9
  775. package/dist/types/v2/layout.d.ts +363 -14
  776. package/dist/types/v2/list-group.d.ts +17 -0
  777. package/dist/types/v2/list-query.d.ts +432 -0
  778. package/dist/types/v2/lookup.d.ts +45 -0
  779. package/dist/types/v2/marks.d.ts +247 -16
  780. package/dist/types/v2/menu-panel.d.ts +7 -0
  781. package/dist/types/v2/menu.d.ts +192 -0
  782. package/dist/types/v2/nav-drop.d.ts +16 -0
  783. package/dist/types/v2/nav-face.d.ts +12 -0
  784. package/dist/types/v2/nav-tree.d.ts +66 -0
  785. package/dist/types/v2/now-line.d.ts +19 -0
  786. package/dist/types/v2/overlay-messages.d.ts +18 -0
  787. package/dist/types/v2/overlays.d.ts +105 -0
  788. package/dist/types/v2/page-layer.d.ts +12 -0
  789. package/dist/types/v2/pane-name.d.ts +14 -0
  790. package/dist/types/v2/pane-print.d.ts +8 -0
  791. package/dist/types/v2/pane-sheet.d.ts +9 -0
  792. package/dist/types/v2/popover.d.ts +21 -0
  793. package/dist/types/v2/reaction-messages.d.ts +9 -0
  794. package/dist/types/v2/reactions.d.ts +41 -0
  795. package/dist/types/v2/row-drag.d.ts +6 -0
  796. package/dist/types/v2/section-level.d.ts +6 -0
  797. package/dist/types/v2/segmented.d.ts +36 -0
  798. package/dist/types/v2/select-live.d.ts +7 -0
  799. package/dist/types/v2/setting-messages.d.ts +10 -0
  800. package/dist/types/v2/split-button.d.ts +24 -0
  801. package/dist/types/v2/states.d.ts +31 -18
  802. package/dist/types/v2/status-toolbar.d.ts +13 -0
  803. package/dist/types/v2/structure.d.ts +58 -4
  804. package/dist/types/v2/testing/index.d.ts +3 -0
  805. package/dist/types/v2/testing/measure-v2-layout.d.ts +30 -9
  806. package/dist/types/v2/testing/settled.d.ts +2 -0
  807. package/dist/types/v2/testing/visible.d.ts +9 -0
  808. package/dist/types/v2/toast-host.d.ts +8 -0
  809. package/dist/types/v2/toast.d.ts +47 -0
  810. package/dist/types/v2/tokens.d.ts +13 -1
  811. package/dist/types/v2/tree-messages.d.ts +15 -0
  812. package/dist/types/v2/types.d.ts +38 -3
  813. package/dist/types/v2/unsaved-bar.d.ts +47 -0
  814. package/dist/types/v2/unsaved-messages.d.ts +31 -0
  815. package/dist/types/v2/width-cookie.d.ts +19 -0
  816. package/dist/types/v2/workspace-messages.d.ts +15 -0
  817. package/dist/v2.css +12208 -2043
  818. package/package.json +15 -6
  819. package/skills/k2b-ui/HANDOFF.md +77 -0
  820. package/skills/k2b-ui/SKILL.md +181 -123
  821. package/skills/k2b-ui/gold/code-policy-1440.png +0 -0
  822. package/skills/k2b-ui/gold/code-policy-390.png +0 -0
  823. package/skills/k2b-ui/gold/mail-mailbox-1440.png +0 -0
  824. package/skills/k2b-ui/gold/mail-mailbox-390.png +0 -0
  825. package/skills/k2b-ui/gold/notebooks-note-1440.png +0 -0
  826. package/skills/k2b-ui/gold/notebooks-note-390.png +0 -0
  827. package/skills/k2b-ui/gold/rhythm-after.png +0 -0
  828. package/skills/k2b-ui/gold/rhythm-before.png +0 -0
  829. package/skills/k2b-ui/gold/steps.png +0 -0
  830. package/skills/k2b-ui/images/actions-1440.png +0 -0
  831. package/skills/k2b-ui/images/actions-390.png +0 -0
  832. package/skills/k2b-ui/images/content-1440.png +0 -0
  833. package/skills/k2b-ui/images/content-390.png +0 -0
  834. package/skills/k2b-ui/images/conversations-1440.png +0 -0
  835. package/skills/k2b-ui/images/conversations-390.png +0 -0
  836. package/skills/k2b-ui/images/detail-sheet-1440.png +0 -0
  837. package/skills/k2b-ui/images/detail-sheet-390.png +0 -0
  838. package/skills/k2b-ui/images/dialogs-1440.png +0 -0
  839. package/skills/k2b-ui/images/dialogs-390.png +0 -0
  840. package/skills/k2b-ui/images/files-1440.png +0 -0
  841. package/skills/k2b-ui/images/files-390.png +0 -0
  842. package/skills/k2b-ui/images/filtered-table-1440.png +0 -0
  843. package/skills/k2b-ui/images/filtered-table-390.png +0 -0
  844. package/skills/k2b-ui/images/form-1440.png +0 -0
  845. package/skills/k2b-ui/images/form-detail-1440.png +0 -0
  846. package/skills/k2b-ui/images/form-detail-390.png +0 -0
  847. package/skills/k2b-ui/images/frame-1440.png +0 -0
  848. package/skills/k2b-ui/images/frame-390.png +0 -0
  849. package/skills/k2b-ui/images/home-1440.png +0 -0
  850. package/skills/k2b-ui/images/home-390.png +0 -0
  851. package/skills/k2b-ui/images/list-detail-1440.png +0 -0
  852. package/skills/k2b-ui/images/list-detail-390.png +0 -0
  853. package/skills/k2b-ui/images/mail-1440.png +0 -0
  854. package/skills/k2b-ui/images/mail-390.png +0 -0
  855. package/skills/k2b-ui/images/overview-1440.png +0 -0
  856. package/skills/k2b-ui/images/overview-390.png +0 -0
  857. package/skills/k2b-ui/images/public-page-1440.png +0 -0
  858. package/skills/k2b-ui/images/public-page-390.png +0 -0
  859. package/skills/k2b-ui/images/record-1440.png +0 -0
  860. package/skills/k2b-ui/images/record-390.png +0 -0
  861. package/skills/k2b-ui/images/record-groups-1440.png +0 -0
  862. package/skills/k2b-ui/images/record-groups-390.png +0 -0
  863. package/skills/k2b-ui/images/settings-1440.png +0 -0
  864. package/skills/k2b-ui/images/settings-390.png +0 -0
  865. package/skills/k2b-ui/images/settings-page-1440.png +0 -0
  866. package/skills/k2b-ui/images/settings-page-390.png +0 -0
  867. package/skills/k2b-ui/images/start-1440.png +0 -0
  868. package/skills/k2b-ui/images/start-390.png +0 -0
  869. package/skills/k2b-ui/images/states-1440.png +0 -0
  870. package/skills/k2b-ui/images/states-390.png +0 -0
  871. package/skills/k2b-ui/images/table-1440.png +0 -0
  872. package/skills/k2b-ui/images/table-390.png +0 -0
  873. package/skills/k2b-ui/images/tree-1440.png +0 -0
  874. package/skills/k2b-ui/images/tree-390.png +0 -0
  875. package/skills/k2b-ui/mockup/shoot.mjs +470 -0
  876. package/skills/k2b-ui/mockup/starter.html +607 -0
  877. package/skills/k2b-ui/port/check.mjs +48 -0
  878. package/skills/k2b-ui/recipes/actions.tsx +226 -0
  879. package/skills/k2b-ui/recipes/content.tsx +96 -0
  880. package/skills/k2b-ui/recipes/conversations.tsx +231 -0
  881. package/skills/k2b-ui/recipes/detail-sheet.tsx +87 -0
  882. package/skills/k2b-ui/recipes/dialogs.tsx +146 -0
  883. package/skills/k2b-ui/recipes/files.tsx +468 -0
  884. package/skills/k2b-ui/recipes/filtered-table.tsx +154 -0
  885. package/skills/k2b-ui/recipes/form-detail.tsx +143 -0
  886. package/skills/k2b-ui/recipes/form.tsx +55 -14
  887. package/skills/k2b-ui/recipes/frame.tsx +206 -0
  888. package/skills/k2b-ui/recipes/home.tsx +186 -0
  889. package/skills/k2b-ui/recipes/list-detail.tsx +85 -50
  890. package/skills/k2b-ui/recipes/mail.tsx +96 -59
  891. package/skills/k2b-ui/recipes/overview.tsx +303 -0
  892. package/skills/k2b-ui/recipes/public-page.tsx +315 -0
  893. package/skills/k2b-ui/recipes/record-groups.tsx +129 -66
  894. package/skills/k2b-ui/recipes/record.tsx +91 -47
  895. package/skills/k2b-ui/recipes/settings-page.tsx +269 -0
  896. package/skills/k2b-ui/recipes/settings.tsx +127 -0
  897. package/skills/k2b-ui/recipes/start.tsx +165 -0
  898. package/skills/k2b-ui/recipes/states.tsx +137 -0
  899. package/skills/k2b-ui/recipes/table.tsx +86 -43
  900. package/skills/k2b-ui/recipes/tree.tsx +109 -0
  901. package/skills/k2b-ui/references/gold.md +195 -0
  902. package/skills/k2b-ui/references/list-queries.md +74 -0
  903. package/skills/k2b-ui/references/look.md +468 -0
  904. package/skills/k2b-ui/references/mistakes.md +59 -3
  905. package/skills/k2b-ui/references/mockups.md +260 -0
  906. package/skills/k2b-ui/references/primitives.md +1227 -99
  907. package/skills/k2b-ui/references/recipes.md +425 -11
  908. package/skills/k2b-ui/references/seeing.md +10 -26
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["v2/overlays.tsx"],"sourcesContent":["import { createEffect, createSignal, type JSX, onCleanup, onMount, Show } from \"solid-js\";\nimport { isServer, render } from \"solid-js/web\";\nimport { useUiMessages } from \"../intl/messages\";\nimport { createQuestion, type Question, quietFocus, useDialog } from \"./behavior/overlays\";\nimport { OverPage } from \"./columns-context\";\nimport { Icon, Mark, type MarkProps } from \"./marks\";\nimport { SectionLevel } from \"./section-level\";\n\n// The overlays of v2: the behaviour (focus, Escape, placement, keys, the sheet on the phone) comes from the behaviour\n// layer on the ui-sdk core (`./behavior/overlays`); these components give it the one shape of v2 (`v2.css`, section\n// \"Overlays\"). No ui-sdk type crosses this module's exports.\n\n// ── Dialog ───────────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport type DialogProps = {\n /** The heading in the head of the dialog, which also names it for assistive technology. */\n title: string;\n /**\n * The sign of the thing the dialog is about, such as the base being exported: a 32 px `Mark` before the title. Leave it\n * out for a dialog about nothing in particular.\n */\n mark?: Pick<MarkProps, \"icon\" | \"color\">;\n /** One quiet line of facts under the title, such as \"werkstatt.sqlite · 24 MB\". */\n meta?: string;\n /** Whether the dialog shows; the screen keeps this state, such as a signal set by the button that opens it. */\n open: boolean;\n /** Called with `false` when Escape, the close button, a press outside or a swipe closes the dialog. */\n onOpenChange: (open: boolean) => void;\n /** The buttons at the foot, the main one last. */\n foot: JSX.Element;\n /** Fields, a notice, text: the content scrolls when it is higher than the dialog. */\n children: JSX.Element;\n /**\n * `false`: a press outside, a swipe on the phone's sheet and Android's back gesture do not close it, so nothing in\n * it is lost by a stray touch (a secret shown once); Escape, the close button and the buttons of the foot still do.\n * `true` by default.\n */\n dismissible?: boolean;\n /**\n * A dialog that holds a list, a table or settings in sections, such as all chats of a project: 720 px wide instead\n * of 480, within the window. On the phone it is the same sheet.\n */\n wide?: boolean;\n};\n\n/** What takes the focus first in a dialog: a field, a link or a button in its content, else an action of its foot. */\nconst focusable =\n 'input:not([type=\"hidden\"]):not([disabled]), textarea:not([disabled]), select:not([disabled]), button:not([disabled]), a[href], [tabindex]:not([tabindex=\"-1\"])';\n\n/** The phone of v2: every width below 768 px, the one query of v2.css for the phone layout. */\nconst phoneQuery = \"not all and (min-width: 768px)\";\n\n/**\n * Whether the window is the v2 phone; false on the server, where a dialog or panel is closed anyway. In the browser it\n * is known from the start, so a dialog or a popover's panel on the phone is a sheet from its first render on (and core\n * prepares the sheet early). Internal: `Dialog` and `Popover`.\n */\nexport const usePhone = () => {\n const [phone, setPhone] = createSignal(!isServer && matchMedia(phoneQuery).matches);\n onMount(() => {\n const media = matchMedia(phoneQuery);\n const update = () => setPhone(media.matches);\n update();\n media.addEventListener(\"change\", update);\n onCleanup(() => media.removeEventListener(\"change\", update));\n });\n return phone;\n};\n\n/**\n * The one dialog: 480 px in the middle of the window (720 px `wide`); on the phone (below 768 px, where v2 lays out the phone) a sheet\n * from the bottom, which a swipe down closes. Head, content and foot are parts of one thing, so only spacing separates\n * them (rule 9). While the content scrolls, a hairline shows at the edge behind which more content lies. Focus stays\n * inside, Escape and the close button close it, focus returns to what opened it.\n */\nconst DialogRoot = (props: DialogProps) => {\n const t = useUiMessages();\n const phone = usePhone();\n const dialog = useDialog(() => ({\n open: props.open,\n onOpenChange: props.onOpenChange,\n presentation: phone() ? \"sheet\" : \"dialog\",\n // core's `dismissible: false` refuses Escape too; Escape still closes, everything else that is refused stays\n dismissible: props.dismissible !== false,\n onDismissAttempt: (reason) => {\n if (props.dismissible === false && reason === \"escape-key\") props.onOpenChange(false);\n },\n }));\n let body: HTMLElement | undefined;\n let foot: HTMLDivElement | undefined;\n // On the phone's sheet a text field would bring up the keyboard over the sheet at once: there the first control that\n // is no text field takes the focus, else the first action of the foot.\n const typed = (element: HTMLElement) =>\n element.matches(\n \"textarea, input:not([type]), input:is([type='text'], [type='search'], [type='email'], [type='url'], [type='tel'], [type='password'], [type='number'])\",\n );\n const first = (part: HTMLElement | undefined) =>\n [...(part?.querySelectorAll<HTMLElement>(focusable) ?? [])].find((element) => !phone() || !typed(element));\n const firstFocus = () => {\n const target = first(body) ?? first(foot) ?? null;\n // the first focus shows no ring unless a key opened the dialog; a text field keeps its own (the caret's place)\n if (target && !typed(target)) quietFocus(target);\n return target;\n };\n const [more, setMore] = createSignal<\"above\" | \"below\" | \"both\">();\n const measure = (body: HTMLElement) => {\n const above = body.scrollTop > 0;\n const below = body.scrollTop + body.clientHeight < body.scrollHeight - 1;\n setMore(above && below ? \"both\" : above ? \"above\" : below ? \"below\" : undefined);\n };\n // The content's box keeps its height while its parts grow inside it (it scrolls), so the parts are watched too, and\n // parts that come later as well. Nothing is watched while the dialog is closed.\n let watching: { sizes: ResizeObserver; parts: MutationObserver } | undefined;\n const stop = () => {\n watching?.sizes.disconnect();\n watching?.parts.disconnect();\n watching = undefined;\n };\n onCleanup(stop);\n createEffect(() => {\n if (!props.open) stop();\n });\n const watch = (element: HTMLElement) => {\n body = element;\n stop();\n const sizes = new ResizeObserver(() => measure(element));\n const observeAll = () => {\n sizes.disconnect();\n sizes.observe(element);\n for (const part of element.children) sizes.observe(part);\n };\n const parts = new MutationObserver(() => {\n observeAll();\n measure(element);\n });\n observeAll();\n parts.observe(element, { childList: true });\n watching = { sizes, parts };\n queueMicrotask(() => measure(element));\n };\n return (\n <dialog.Popup\n class=\"k2-dialog\"\n data-k2-part=\"Dialog\"\n data-wide={props.wide ? \"\" : undefined}\n data-more={more()}\n backdrop={{ class: \"k2-backdrop\" }}\n // the first field takes the focus, not the close button; without one the first action of the foot\n initialFocus={firstFocus}\n >\n {/* on the phone's sheet: the grip that says it can be swiped down (the swipe itself is core's) */}\n <div class=\"k2-dialog-grip\" aria-hidden=\"true\" />\n <div class=\"k2-slot\" data-slot=\"head\">\n <div class=\"k2-bar\">\n <div class=\"k2-bar-start\" data-sign={props.mark || props.meta ? \"\" : undefined}>\n <Show when={props.mark}>{(mark) => <Mark icon={mark().icon} color={mark().color} />}</Show>\n <Show when={props.meta} fallback={<dialog.Title class=\"k2-dialog-title\">{props.title}</dialog.Title>}>\n <div class=\"k2-dialog-name\">\n <dialog.Title class=\"k2-dialog-title\">{props.title}</dialog.Title>\n <p class=\"k2-dialog-meta\">{props.meta}</p>\n </div>\n </Show>\n </div>\n <div class=\"k2-bar-end\">\n {/* it stays on the phone, where other buttons of a head give way: the sheet's one visible way out */}\n <dialog.Close class=\"k2-btn\" data-variant=\"ghost\" data-icon-only=\"\" data-keep=\"\" aria-label={t().close} title={t().close}>\n <Icon name=\"x\" />\n </dialog.Close>\n </div>\n </div>\n </div>\n <div class=\"k2-dialog-body\" ref={watch} onScroll={(event) => measure(event.currentTarget)}>\n {/* over the page: a pane or a split in it asks the workspace behind it for no room */}\n <OverPage>\n {/* the dialog's title is the h2, so its sections head themselves one level below */}\n <SectionLevel.Provider value={3}>{props.children}</SectionLevel.Provider>\n </OverPage>\n </div>\n <div class=\"k2-slot\" data-slot=\"foot\" ref={foot}>\n <div class=\"k2-bar\">\n <div class=\"k2-bar-end\">{props.foot}</div>\n </div>\n </div>\n </dialog.Popup>\n );\n};\n\n// ── SearchDialog ─────────────────────────────────────────────────────────────────────────────────────────────────\n\nexport type SearchDialogProps = {\n /** The name of the dialog for assistive technology, such as \"Suche\"; the dialog has no head of its own. */\n label: string;\n /** Whether the dialog shows; the screen keeps this state. */\n open: boolean;\n /** Called with `false` when Escape or a press outside closes the dialog. */\n onOpenChange: (open: boolean) => void;\n /**\n * What the search is made of: its input, its results and their preview. The content lays itself out and takes the\n * whole frame; it keeps its own Escape (`event.preventDefault()`) for a step back before the dialog closes.\n */\n children: JSX.Element;\n};\n\n/**\n * The frame of a search over everything, such as the global search of an application: 1160 px wide and 740 px high\n * near the top of the window (less in a smaller window), with no head, foot or close button of its own; on the phone\n * (below 768 px) it fills the screen. Focus moves to its first text field and stays inside, Escape and a press outside\n * close it, focus returns to what was focused before. An Escape that the content takes (`preventDefault`) leaves it\n * open, so a step inside it, such as a preview on the phone, can go back first.\n */\nexport const SearchDialog = (props: SearchDialogProps) => {\n const dialog = useDialog(() => ({ open: props.open, onOpenChange: props.onOpenChange, presentation: \"dialog\" }));\n let frame: HTMLElement | undefined;\n const firstField = () => frame?.querySelector<HTMLElement>(\"input:not([type='hidden']):not([disabled]), textarea\") ?? null;\n return (\n <dialog.Popup\n ref={(element: HTMLElement) => {\n frame = element;\n }}\n class=\"k2-search-dialog\"\n data-k2-part=\"SearchDialog\"\n aria-label={props.label}\n backdrop={{ class: \"k2-backdrop\" }}\n initialFocus={firstField}\n >\n <OverPage>{props.children}</OverPage>\n </dialog.Popup>\n );\n};\n\n// ── Dialog.confirm ───────────────────────────────────────────────────────────────────────────────────────────────\n\nexport type ConfirmOptions = {\n /** The question, such as \"Auftrag verwerfen?\". */\n title: string;\n /** What agreeing does, if the question alone does not say it. */\n description?: string;\n /** The words of the agreeing button, such as \"Verwerfen\". */\n confirm: string;\n /** The words of the other button; \"Abbrechen\" by default. */\n cancel?: string;\n};\n\n/**\n * Where an overlay with its own host mounts: inside the focused element's nearest open auto or hint popover, within\n * the current native modal when there is one; otherwise inside that modal, or at the end of the page. DOM nesting keeps a native\n * auto popover's draft open when the person presses the new overlay's buttons; the modal boundary keeps it interactive.\n * Temporary manual popovers (menus) are not parents: the menu closes as its action starts. Overlays render in place\n * and enter the top layer above their parent.\n */\nexport const overlayParent = (): Element => {\n const modal = [...document.querySelectorAll(\"dialog[open]\")]\n .filter((dialog) => {\n try {\n return dialog.matches(\":modal\");\n } catch {\n // an engine without `:modal` has no inert outside either\n return false;\n }\n })\n .at(-1);\n const popover =\n typeof HTMLElement.prototype.showPopover === \"function\"\n ? document.activeElement?.closest('[popover]:popover-open:not([popover=\"manual\" i])')\n : undefined;\n return popover && (!modal || modal.contains(popover)) ? popover : (modal ?? document.body);\n};\n\n/**\n * Asks before something happens that cannot be taken back, and resolves `true` when the person agrees:\n * `if (await Dialog.confirm({ title: \"Auftrag verwerfen?\", confirm: \"Verwerfen\" })) discard()`. An alert dialog in\n * the shape of `Dialog`, without a close button: Escape and the other button answer no, focus starts on the other\n * button, a press outside does nothing, and it is never a sheet. The first `Workspace` on the page answers, also for\n * code in another island; without one, the question brings its own dialog to the end of the page until it is\n * answered. A question whose dialog leaves the page while it asks is answered no.\n */\nexport const confirm = (options: ConfirmOptions): Promise<boolean> => {\n const parent = overlayParent();\n // A Workspace outside the invoking popover or native modal cannot preserve its nesting; ask inside that parent.\n const page = parent === document.body ? pageAnswer() : undefined;\n if (page) return page(options);\n // no Workspace answers: a dialog of its own, in a v2 scope of its own, for as long as the question is open\n const question = createQuestion<ConfirmOptions>();\n const host = document.createElement(\"div\");\n host.className = \"k2-ui\";\n host.style.display = \"contents\";\n parent.append(host);\n const stop = render(() => <ConfirmSurface question={question} />, host);\n return question.ask(options).finally(() => {\n stop();\n host.remove();\n });\n};\n\ntype Ask = (options: ConfirmOptions) => Promise<boolean>;\n\n/**\n * The Workspace that answers is found through the page, not through a module: every island bundles its own copy of\n * `@k2b/ui`, so a list in this module would not see a Workspace another island renders. Each mounted Workspace puts\n * its `ask` on its element under this key; its element and attributes stay what the server sent.\n */\nconst hostKey = Symbol.for(\"k2b.ui.v2.confirm\");\n\nconst pageAnswer = (): Ask | undefined => {\n for (const host of document.querySelectorAll(\"[data-k2-workspace]\")) {\n const ask: unknown = Reflect.get(host, hostKey);\n if (typeof ask === \"function\") return (options) => Promise.resolve(Reflect.apply(ask, undefined, [options])).then(Boolean);\n }\n return undefined;\n};\n\n/**\n * The alert dialog that answers `confirm` (internal; every `Workspace` renders it with its element as the host). Only\n * the first Workspace on the page is asked, so one question opens one dialog. It shows nothing until it asks, on the\n * server too, so it never changes what the server sent.\n */\nexport const ConfirmDialog = (props: { host: () => HTMLElement | undefined }) => {\n const question = createQuestion<ConfirmOptions>();\n onMount(() => {\n const host = props.host();\n if (!host) return;\n Reflect.set(host, hostKey, question.ask);\n onCleanup(() => {\n Reflect.deleteProperty(host, hostKey);\n });\n });\n return <ConfirmSurface question={question} />;\n};\n\nconst ConfirmSurface = (props: { question: Question<ConfirmOptions> }) => {\n const t = useUiMessages();\n const parts = props.question.useDialog();\n return (\n <parts.Popup class=\"k2-dialog\" data-k2-part=\"Dialog\" data-alert=\"\" backdrop={{ class: \"k2-backdrop\" }}>\n <div class=\"k2-slot\" data-slot=\"head\">\n <div class=\"k2-bar\">\n <div class=\"k2-bar-start\">\n <parts.Title class=\"k2-dialog-title\">{parts.payload()?.title}</parts.Title>\n </div>\n </div>\n </div>\n <Show when={parts.payload()?.description}>\n {(description) => (\n <div class=\"k2-dialog-body\">\n <parts.Description class=\"k2-text\">{description()}</parts.Description>\n </div>\n )}\n </Show>\n <div class=\"k2-slot\" data-slot=\"foot\">\n <div class=\"k2-bar\">\n <div class=\"k2-bar-end\">\n <parts.Close class=\"k2-btn\" data-k2-part=\"Button\">\n <span class=\"k2-btn-label\">{parts.payload()?.cancel ?? t().cancel}</span>\n </parts.Close>\n <parts.Close class=\"k2-btn\" data-k2-part=\"Button\" data-variant=\"primary\" value=\"confirm\">\n <span class=\"k2-btn-label\">{parts.payload()?.confirm}</span>\n </parts.Close>\n </div>\n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,CAAC,EAAE,KAAK;UAAA;QAAA;QAAA;MAAA,wBAIjE,IAAI;QAAA,IAAC,IAAI;UAAA,OAAE,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,WAAW;QAAA;QAAA,UACpC,WAAW;UAAA;UAAA,mCAER,KAAK,CAAC,WAAW;YAAA;YAAA;cAAA,OAAkB,WAAW,CAAC,CAAC;YAAA;UAAA;UAAA;QAAA;MAEpD;QAAA;UAAA;UAAA;UAAA;UAAA;UAAA;UAAA;QAAA,mCAKI,KAAK,CAAC,KAAK;UAAA;UAAA;UAAA;YAAA;YAAA,uBACkB,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM;YAAA;UAAA;QAAA;QAAA,mCAElE,KAAK,CAAC,KAAK;UAAA;UAAA;UAAA;UAA6D,KAAK;UAAA;YAAA;YAAA,uBAChD,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO;YAAA;UAAA;QAAA;QAAA;MAAA;IAAA;EAAA;AAOlE,CAAC;AAED,OAAO,MAAM,MAAM,GAAG,eAAgB,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE;EAAE;AAAQ,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,42 @@
1
+ import { createComponent as _$createComponent } from "solid-js/web";
2
+ import { createSignal, onMount, Show } from "solid-js";
3
+ import { Portal } from "solid-js/web";
4
+
5
+ /**
6
+ * Popups that belong to a thing rather than to a place: the context menu of a row, the tip of a button. Rendered
7
+ * beside the thing they would stand inside its structure, a role="menu" in a list and a sibling that turns the thing
8
+ * into "not the last child", which moves edges. Here they stand at the end of the page in a v2 scope of their own,
9
+ * with the theme and the app colour of the thing's scope; the scope has no box (`display: contents`), the popups sit in
10
+ * the top layer. Only once the page is live, so the server and the first render in the browser show the same.
11
+ */
12
+ export const PageLayer = props => {
13
+ const [live, setLive] = createSignal(false);
14
+ onMount(() => setLive(true));
15
+ const scope = layer => {
16
+ layer.className = "k2-ui";
17
+ layer.style.display = "contents";
18
+ const source = props.from()?.closest(".k2-ui");
19
+ if (!source) return;
20
+ const theme = source.getAttribute("data-theme");
21
+ if (theme) layer.setAttribute("data-theme", theme);
22
+ const app = getComputedStyle(source).getPropertyValue("--k2-app").trim();
23
+ if (app) layer.style.setProperty("--k2-app", app);
24
+ };
25
+ return _$createComponent(Show, {
26
+ get when() {
27
+ return live();
28
+ },
29
+ get children() {
30
+ return _$createComponent(Portal, {
31
+ get mount() {
32
+ return document.body;
33
+ },
34
+ ref: scope,
35
+ get children() {
36
+ return props.children;
37
+ }
38
+ });
39
+ }
40
+ });
41
+ };
42
+ //# sourceMappingURL=page-layer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["v2/page-layer.tsx"],"sourcesContent":["import { createSignal, type JSX, onMount, Show } from \"solid-js\";\nimport { Portal } from \"solid-js/web\";\n\n/**\n * Popups that belong to a thing rather than to a place: the context menu of a row, the tip of a button. Rendered\n * beside the thing they would stand inside its structure, a role=\"menu\" in a list and a sibling that turns the thing\n * into \"not the last child\", which moves edges. Here they stand at the end of the page in a v2 scope of their own,\n * with the theme and the app colour of the thing's scope; the scope has no box (`display: contents`), the popups sit in\n * the top layer. Only once the page is live, so the server and the first render in the browser show the same.\n */\nexport const PageLayer = (props: { from: () => Element | undefined; children: JSX.Element }) => {\n const [live, setLive] = createSignal(false);\n onMount(() => setLive(true));\n const scope = (layer: HTMLDivElement) => {\n layer.className = \"k2-ui\";\n layer.style.display = \"contents\";\n const source = props.from()?.closest(\".k2-ui\");\n if (!source) return;\n const theme = source.getAttribute(\"data-theme\");\n if (theme) layer.setAttribute(\"data-theme\", theme);\n const app = getComputedStyle(source).getPropertyValue(\"--k2-app\").trim();\n if (app) layer.style.setProperty(\"--k2-app\", app);\n };\n return (\n <Show when={live()}>\n <Portal mount={document.body} ref={scope}>\n {props.children}\n </Portal>\n </Show>\n );\n};\n"],"mappings":";AAAA,SAAS,YAAY,EAAY,OAAO,EAAE,IAAI,QAAQ,UAAU;AAChE,SAAS,MAAM,QAAQ,cAAc;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM,SAAS,GAAI,KAAiE,IAAK;EAC9F,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC;EAC3C,OAAO,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;EAC5B,MAAM,KAAK,GAAI,KAAqB,IAAK;IACvC,KAAK,CAAC,SAAS,GAAG,OAAO;IACzB,KAAK,CAAC,KAAK,CAAC,OAAO,GAAG,UAAU;IAChC,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC;IAC9C,IAAI,CAAC,MAAM,EAAE;IACb,MAAM,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC,YAAY,CAAC;IAC/C,IAAI,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,YAAY,EAAE,KAAK,CAAC;IAClD,MAAM,GAAG,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC;IACxE,IAAI,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,UAAU,EAAE,GAAG,CAAC;EACnD,CAAC;EACD,yBACG,IAAI;IAAA,IAAC,IAAI;MAAA,OAAE,IAAI,CAAC,CAAC;IAAA;IAAA;MAAA,yBACf,MAAM;QAAA,IAAC,KAAK;UAAA,OAAE,QAAQ,CAAC,IAAI;QAAA;QAAA,KAAO,KAAK;QAAA;UAAA,OACrC,KAAK,CAAC,QAAQ;QAAA;MAAA;IAAA;EAAA;AAIvB,CAAC","ignoreList":[]}
@@ -0,0 +1,55 @@
1
+ import { template as _$template } from "solid-js/web";
2
+ import { setAttribute as _$setAttribute } from "solid-js/web";
3
+ import { effect as _$effect } from "solid-js/web";
4
+ import { getNextElement as _$getNextElement } from "solid-js/web";
5
+ import { insert as _$insert } from "solid-js/web";
6
+ import { use as _$use } from "solid-js/web";
7
+ var _tmpl$ = /*#__PURE__*/_$template(`<span class=k2-pane-name data-k2-part=PaneName><span class=k2-pane-name-rest></span><span class=k2-pane-name-text>`);
8
+ import { createSignal, onCleanup, onMount } from "solid-js";
9
+ /**
10
+ * The name of an open object in its pane's head (in the head `Bar`'s `start`): while the object's own head, the first
11
+ * part of the pane's content, is in sight, the place shows `children`; once it scrolled away, the name, cut with "…".
12
+ * Both share one place, so the head never moves and keeps its line (the pane's head is pinned already). The name is
13
+ * there for assistive technology only while it shows; the object's head names it before.
14
+ */
15
+ export const PaneName = props => {
16
+ const [away, setAway] = createSignal(false);
17
+ let place;
18
+ onMount(() => {
19
+ const scroller = place?.closest(".k2-pane")?.querySelector(":scope > .k2-scroll");
20
+ // the first part with a box of its own: an island's wrapper (`display: contents`) is looked through
21
+ let first = scroller?.firstElementChild ?? null;
22
+ while (first && getComputedStyle(first).display === "contents") first = first.firstElementChild;
23
+ if (!scroller || !first || typeof IntersectionObserver === "undefined") return;
24
+ // away once the first part is wholly above the top of the column
25
+ const sight = new IntersectionObserver(([entry]) => {
26
+ if (!entry) return;
27
+ setAway(!entry.isIntersecting && entry.boundingClientRect.bottom <= (entry.rootBounds?.top ?? 0) + 1);
28
+ }, {
29
+ root: scroller
30
+ });
31
+ sight.observe(first);
32
+ onCleanup(() => sight.disconnect());
33
+ });
34
+ return (() => {
35
+ var _el$ = _$getNextElement(_tmpl$),
36
+ _el$2 = _el$.firstChild,
37
+ _el$3 = _el$2.nextSibling;
38
+ var _ref$ = place;
39
+ typeof _ref$ === "function" ? _$use(_ref$, _el$) : place = _el$;
40
+ _$insert(_el$2, () => props.children);
41
+ _$insert(_el$3, () => props.name);
42
+ _$effect(_p$ => {
43
+ var _v$ = away() ? "" : undefined,
44
+ _v$2 = props.name;
45
+ _v$ !== _p$.e && _$setAttribute(_el$, "data-away", _p$.e = _v$);
46
+ _v$2 !== _p$.t && _$setAttribute(_el$3, "title", _p$.t = _v$2);
47
+ return _p$;
48
+ }, {
49
+ e: undefined,
50
+ t: undefined
51
+ });
52
+ return _el$;
53
+ })();
54
+ };
55
+ //# sourceMappingURL=pane-name.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["v2/pane-name.tsx"],"sourcesContent":["import { createSignal, type JSX, onCleanup, onMount } from \"solid-js\";\n\nexport type PaneNameProps = {\n /** The name of the open object, such as the title of a task: it shows once the object's head scrolled away. */\n name: string;\n /** What the place shows while the object's head is in sight, such as \"4 von 12\"; nothing by default. */\n children?: JSX.Element;\n};\n\n/**\n * The name of an open object in its pane's head (in the head `Bar`'s `start`): while the object's own head, the first\n * part of the pane's content, is in sight, the place shows `children`; once it scrolled away, the name, cut with \"…\".\n * Both share one place, so the head never moves and keeps its line (the pane's head is pinned already). The name is\n * there for assistive technology only while it shows; the object's head names it before.\n */\nexport const PaneName = (props: PaneNameProps) => {\n const [away, setAway] = createSignal(false);\n let place: HTMLSpanElement | undefined;\n onMount(() => {\n const scroller = place?.closest(\".k2-pane\")?.querySelector<HTMLElement>(\":scope > .k2-scroll\");\n // the first part with a box of its own: an island's wrapper (`display: contents`) is looked through\n let first = scroller?.firstElementChild ?? null;\n while (first && getComputedStyle(first).display === \"contents\") first = first.firstElementChild;\n if (!scroller || !first || typeof IntersectionObserver === \"undefined\") return;\n // away once the first part is wholly above the top of the column\n const sight = new IntersectionObserver(\n ([entry]) => {\n if (!entry) return;\n setAway(!entry.isIntersecting && entry.boundingClientRect.bottom <= (entry.rootBounds?.top ?? 0) + 1);\n },\n { root: scroller },\n );\n sight.observe(first);\n onCleanup(() => sight.disconnect());\n });\n return (\n <span ref={place} class=\"k2-pane-name\" data-k2-part=\"PaneName\" data-away={away() ? \"\" : undefined}>\n <span class=\"k2-pane-name-rest\">{props.children}</span>\n <span class=\"k2-pane-name-text\" title={props.name}>\n {props.name}\n </span>\n </span>\n );\n};\n"],"mappings":";;;;;;;AAAA,SAAS,YA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I;MAAA;MAAA;MAAA;IAAA;MAAA;MAAA;IAAA;IAAA;EAAA;AAKvD,CAAC","ignoreList":[]}
@@ -0,0 +1,32 @@
1
+ /**
2
+ * The print of a `Pane print` (layout.tsx loads this only for such a pane). From the browser's `beforeprint` to its
3
+ * `afterprint`, which also comes when the print is cancelled, the pane marks the page (`data-k2-print` on the root)
4
+ * and its way up to it (`data-k2-print-path`). The print rule of v2.css asks only these marks, so it opens each box on
5
+ * the way and hides everything else without asking each element what it holds. Any print starts it: an app's "Print",
6
+ * Ctrl+P, the browser's menu. The returned function ends the watch and takes the marks away.
7
+ */
8
+ export const watchPanePrint = pane => {
9
+ const root = document.documentElement;
10
+ let way = [];
11
+ const unmark = () => {
12
+ for (const node of way) node.removeAttribute("data-k2-print-path");
13
+ way = [];
14
+ root.removeAttribute("data-k2-print");
15
+ };
16
+ const mark = () => {
17
+ unmark();
18
+ for (let node = pane.parentElement; node && node !== root; node = node.parentElement) {
19
+ node.setAttribute("data-k2-print-path", "");
20
+ way.push(node);
21
+ }
22
+ root.setAttribute("data-k2-print", "");
23
+ };
24
+ window.addEventListener("beforeprint", mark);
25
+ window.addEventListener("afterprint", unmark);
26
+ return () => {
27
+ window.removeEventListener("beforeprint", mark);
28
+ window.removeEventListener("afterprint", unmark);
29
+ unmark();
30
+ };
31
+ };
32
+ //# sourceMappingURL=pane-print.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["v2/pane-print.ts"],"sourcesContent":["/**\n * The print of a `Pane print` (layout.tsx loads this only for such a pane). From the browser's `beforeprint` to its\n * `afterprint`, which also comes when the print is cancelled, the pane marks the page (`data-k2-print` on the root)\n * and its way up to it (`data-k2-print-path`). The print rule of v2.css asks only these marks, so it opens each box on\n * the way and hides everything else without asking each element what it holds. Any print starts it: an app's \"Print\",\n * Ctrl+P, the browser's menu. The returned function ends the watch and takes the marks away.\n */\nexport const watchPanePrint = (pane: HTMLElement): (() => void) => {\n const root = document.documentElement;\n let way: Element[] = [];\n const unmark = () => {\n for (const node of way) node.removeAttribute(\"data-k2-print-path\");\n way = [];\n root.removeAttribute(\"data-k2-print\");\n };\n const mark = () => {\n unmark();\n for (let node = pane.parentElement; node && node !== root; node = node.parentElement) {\n node.setAttribute(\"data-k2-print-path\", \"\");\n way.push(node);\n }\n root.setAttribute(\"data-k2-print\", \"\");\n };\n window.addEventListener(\"beforeprint\", mark);\n window.addEventListener(\"afterprint\", unmark);\n return () => {\n window.removeEventListener(\"beforeprint\", mark);\n window.removeEventListener(\"afterprint\", unmark);\n unmark();\n };\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM,cAAc,GAAI,IAAiB,IAAmB;EACjE,MAAM,IAAI,GAAG,QAAQ,CAAC,eAAe;EACrC,IAAI,GAAc,GAAG,EAAE;EACvB,MAAM,MAAM,GAAG,MAAM;IACnB,KAAK,MAAM,IAAI,IAAI,GAAG,EAAE,IAAI,CAAC,eAAe,CAAC,oBAAoB,CAAC;IAClE,GAAG,GAAG,EAAE;IACR,IAAI,CAAC,eAAe,CAAC,eAAe,CAAC;EACvC,CAAC;EACD,MAAM,IAAI,GAAG,MAAM;IACjB,MAAM,CAAC,CAAC;IACR,KAAK,IAAI,IAAI,GAAG,IAAI,CAAC,aAAa,EAAE,IAAI,IAAI,IAAI,KAAK,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC,aAAa,EAAE;MACpF,IAAI,CAAC,YAAY,CAAC,oBAAoB,EAAE,EAAE,CAAC;MAC3C,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;IAChB;IACA,IAAI,CAAC,YAAY,CAAC,eAAe,EAAE,EAAE,CAAC;EACxC,CAAC;EACD,MAAM,CAAC,gBAAgB,CAAC,aAAa,EAAE,IAAI,CAAC;EAC5C,MAAM,CAAC,gBAAgB,CAAC,YAAY,EAAE,MAAM,CAAC;EAC7C,OAAO,MAAM;IACX,MAAM,CAAC,mBAAmB,CAAC,aAAa,EAAE,IAAI,CAAC;IAC/C,MAAM,CAAC,mBAAmB,CAAC,YAAY,EAAE,MAAM,CAAC;IAChD,MAAM,CAAC,CAAC;EACV,CAAC;AACH,CAAC","ignoreList":[]}
@@ -0,0 +1,147 @@
1
+ /**
2
+ * The phone's sheet of a detail (`Pane detail phone="sheet"`): while the window is a phone (below 768 px, the one query
3
+ * of v2.css for the phone layout), the detail stands over what it belongs to as a sheet (v2.css draws it: the dimmed
4
+ * content, the sheet 14 px below the top, its grip). This module gives it what a sheet does: it is a modal dialog for
5
+ * assistive technology, the focus goes into it and stays there, and Escape, a tap on the dimmed content or a swipe
6
+ * down on its grip or head close it. Closing presses the pane's way back, so its address, `onNavigate` and the focus
7
+ * that goes back to what opened it stay as the way back has them. On a wider window it does nothing.
8
+ */
9
+
10
+ const phoneQuery = "not all and (min-width: 768px)";
11
+ const focusable = 'a[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
12
+ /** What a finger on the head may still press or type into: no swipe starts there. */
13
+ const control = "a, button, input, select, textarea, label, [contenteditable], [role='button'], [role='menuitem'], [tabindex]:not([tabindex='-1'])";
14
+ /** A swipe closes where it went down a quarter of the sheet's height, or quicker than this (px per ms) beyond 32 px. */
15
+ const flick = 0.5;
16
+ /** Movement before a finger is a swipe and not a tap. */
17
+ const slop = 6;
18
+ export const watchPaneSheet = pane => {
19
+ const media = matchMedia(phoneQuery);
20
+ let stopActive;
21
+ const close = () => pane.querySelector(":scope > .k2-pane-back > :is(a, button)")?.click();
22
+ const top = () => Number.parseFloat(getComputedStyle(pane).getPropertyValue("--k2-sheet-top")) || 0;
23
+ const start = () => {
24
+ const role = pane.getAttribute("role");
25
+ const tabIndex = pane.getAttribute("tabindex");
26
+ pane.setAttribute("role", "dialog");
27
+ pane.setAttribute("aria-modal", "true");
28
+ // the focus goes into the sheet, so a keyboard and a screen reader are where the eye is
29
+ if (!pane.contains(document.activeElement)) {
30
+ pane.tabIndex = -1;
31
+ pane.focus({
32
+ preventScroll: true
33
+ });
34
+ }
35
+ const keydown = event => {
36
+ if (event.defaultPrevented) return;
37
+ if (event.key === "Escape") {
38
+ event.preventDefault();
39
+ close();
40
+ return;
41
+ }
42
+ if (event.key !== "Tab") return;
43
+ // the focus goes round inside the sheet
44
+ const inside = [...pane.querySelectorAll(focusable)].filter(element => element.getClientRects().length > 0);
45
+ if (inside.length === 0) {
46
+ event.preventDefault();
47
+ return;
48
+ }
49
+ const first = inside[0];
50
+ const last = inside.at(-1);
51
+ const at = document.activeElement;
52
+ if (event.shiftKey && (at === first || at === pane)) {
53
+ event.preventDefault();
54
+ last.focus();
55
+ } else if (!event.shiftKey && at === last) {
56
+ event.preventDefault();
57
+ first.focus();
58
+ }
59
+ };
60
+
61
+ // a tap on the dimmed content above the sheet closes it
62
+ const click = event => {
63
+ if (event.target === pane && event.clientY < top()) close();
64
+ };
65
+
66
+ // a swipe down on the grip or the head moves the sheet with the finger and closes it past a quarter of its height
67
+ let drag;
68
+ const set = dy => pane.style.setProperty("--k2-sheet-drag", `${dy}px`);
69
+ const down = event => {
70
+ if (event.button !== 0 || drag) return;
71
+ const target = event.target instanceof Element ? event.target : null;
72
+ if (!target) return;
73
+ const onGrip = target === pane && event.clientY >= top() && event.clientY < top() + 24;
74
+ const onHead = pane.querySelector(':scope > [data-slot="head"]')?.contains(target) ?? false;
75
+ if (!onGrip && !(onHead && !target.closest(control))) return;
76
+ drag = {
77
+ id: event.pointerId,
78
+ y: event.clientY,
79
+ at: event.timeStamp,
80
+ moved: false
81
+ };
82
+ };
83
+ const move = event => {
84
+ if (!drag || event.pointerId !== drag.id) return;
85
+ const dy = Math.max(0, event.clientY - drag.y);
86
+ if (!drag.moved && dy < slop) return;
87
+ if (!drag.moved) {
88
+ drag.moved = true;
89
+ pane.setAttribute("data-dragging", "");
90
+ pane.setPointerCapture(event.pointerId);
91
+ }
92
+ set(dy);
93
+ };
94
+ const up = event => {
95
+ if (!drag || event.pointerId !== drag.id) return;
96
+ const {
97
+ y,
98
+ at,
99
+ moved
100
+ } = drag;
101
+ drag = undefined;
102
+ pane.removeAttribute("data-dragging");
103
+ if (!moved) return;
104
+ const dy = Math.max(0, event.clientY - y);
105
+ const speed = dy / Math.max(1, event.timeStamp - at);
106
+ if (dy > (pane.clientHeight - top()) / 4 || dy > 32 && speed > flick) close();
107
+ // a sheet that stays (no way back took it away) settles back
108
+ set(0);
109
+ };
110
+ const cancel = () => {
111
+ if (!drag) return;
112
+ drag = undefined;
113
+ pane.removeAttribute("data-dragging");
114
+ set(0);
115
+ };
116
+ pane.addEventListener("keydown", keydown);
117
+ pane.addEventListener("click", click);
118
+ pane.addEventListener("pointerdown", down);
119
+ pane.addEventListener("pointermove", move);
120
+ pane.addEventListener("pointerup", up);
121
+ pane.addEventListener("pointercancel", cancel);
122
+ stopActive = () => {
123
+ pane.removeEventListener("keydown", keydown);
124
+ pane.removeEventListener("click", click);
125
+ pane.removeEventListener("pointerdown", down);
126
+ pane.removeEventListener("pointermove", move);
127
+ pane.removeEventListener("pointerup", up);
128
+ pane.removeEventListener("pointercancel", cancel);
129
+ if (role === null) pane.removeAttribute("role");else pane.setAttribute("role", role);
130
+ pane.removeAttribute("aria-modal");
131
+ if (tabIndex === null) pane.removeAttribute("tabindex");else pane.setAttribute("tabindex", tabIndex);
132
+ pane.removeAttribute("data-dragging");
133
+ pane.style.removeProperty("--k2-sheet-drag");
134
+ stopActive = undefined;
135
+ };
136
+ };
137
+ const follow = () => {
138
+ if (media.matches && !stopActive) start();else if (!media.matches) stopActive?.();
139
+ };
140
+ follow();
141
+ media.addEventListener("change", follow);
142
+ return () => {
143
+ media.removeEventListener("change", follow);
144
+ stopActive?.();
145
+ };
146
+ };
147
+ //# sourceMappingURL=pane-sheet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["v2/pane-sheet.ts"],"sourcesContent":["/**\n * The phone's sheet of a detail (`Pane detail phone=\"sheet\"`): while the window is a phone (below 768 px, the one query\n * of v2.css for the phone layout), the detail stands over what it belongs to as a sheet (v2.css draws it: the dimmed\n * content, the sheet 14 px below the top, its grip). This module gives it what a sheet does: it is a modal dialog for\n * assistive technology, the focus goes into it and stays there, and Escape, a tap on the dimmed content or a swipe\n * down on its grip or head close it. Closing presses the pane's way back, so its address, `onNavigate` and the focus\n * that goes back to what opened it stay as the way back has them. On a wider window it does nothing.\n */\n\nconst phoneQuery = \"not all and (min-width: 768px)\";\nconst focusable =\n 'a[href], button:not([disabled]), input:not([disabled]):not([type=\"hidden\"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])';\n/** What a finger on the head may still press or type into: no swipe starts there. */\nconst control =\n \"a, button, input, select, textarea, label, [contenteditable], [role='button'], [role='menuitem'], [tabindex]:not([tabindex='-1'])\";\n/** A swipe closes where it went down a quarter of the sheet's height, or quicker than this (px per ms) beyond 32 px. */\nconst flick = 0.5;\n/** Movement before a finger is a swipe and not a tap. */\nconst slop = 6;\n\nexport const watchPaneSheet = (pane: HTMLElement): (() => void) => {\n const media = matchMedia(phoneQuery);\n let stopActive: (() => void) | undefined;\n\n const close = () => pane.querySelector<HTMLElement>(\":scope > .k2-pane-back > :is(a, button)\")?.click();\n const top = () => Number.parseFloat(getComputedStyle(pane).getPropertyValue(\"--k2-sheet-top\")) || 0;\n\n const start = () => {\n const role = pane.getAttribute(\"role\");\n const tabIndex = pane.getAttribute(\"tabindex\");\n pane.setAttribute(\"role\", \"dialog\");\n pane.setAttribute(\"aria-modal\", \"true\");\n // the focus goes into the sheet, so a keyboard and a screen reader are where the eye is\n if (!pane.contains(document.activeElement)) {\n pane.tabIndex = -1;\n pane.focus({ preventScroll: true });\n }\n\n const keydown = (event: KeyboardEvent) => {\n if (event.defaultPrevented) return;\n if (event.key === \"Escape\") {\n event.preventDefault();\n close();\n return;\n }\n if (event.key !== \"Tab\") return;\n // the focus goes round inside the sheet\n const inside = [...pane.querySelectorAll<HTMLElement>(focusable)].filter((element) => element.getClientRects().length > 0);\n if (inside.length === 0) {\n event.preventDefault();\n return;\n }\n const first = inside[0]!;\n const last = inside.at(-1)!;\n const at = document.activeElement;\n if (event.shiftKey && (at === first || at === pane)) {\n event.preventDefault();\n last.focus();\n } else if (!event.shiftKey && at === last) {\n event.preventDefault();\n first.focus();\n }\n };\n\n // a tap on the dimmed content above the sheet closes it\n const click = (event: MouseEvent) => {\n if (event.target === pane && event.clientY < top()) close();\n };\n\n // a swipe down on the grip or the head moves the sheet with the finger and closes it past a quarter of its height\n let drag: { id: number; y: number; at: number; moved: boolean } | undefined;\n const set = (dy: number) => pane.style.setProperty(\"--k2-sheet-drag\", `${dy}px`);\n const down = (event: PointerEvent) => {\n if (event.button !== 0 || drag) return;\n const target = event.target instanceof Element ? event.target : null;\n if (!target) return;\n const onGrip = target === pane && event.clientY >= top() && event.clientY < top() + 24;\n const onHead = pane.querySelector(':scope > [data-slot=\"head\"]')?.contains(target) ?? false;\n if (!onGrip && !(onHead && !target.closest(control))) return;\n drag = { id: event.pointerId, y: event.clientY, at: event.timeStamp, moved: false };\n };\n const move = (event: PointerEvent) => {\n if (!drag || event.pointerId !== drag.id) return;\n const dy = Math.max(0, event.clientY - drag.y);\n if (!drag.moved && dy < slop) return;\n if (!drag.moved) {\n drag.moved = true;\n pane.setAttribute(\"data-dragging\", \"\");\n pane.setPointerCapture(event.pointerId);\n }\n set(dy);\n };\n const up = (event: PointerEvent) => {\n if (!drag || event.pointerId !== drag.id) return;\n const { y, at, moved } = drag;\n drag = undefined;\n pane.removeAttribute(\"data-dragging\");\n if (!moved) return;\n const dy = Math.max(0, event.clientY - y);\n const speed = dy / Math.max(1, event.timeStamp - at);\n if (dy > (pane.clientHeight - top()) / 4 || (dy > 32 && speed > flick)) close();\n // a sheet that stays (no way back took it away) settles back\n set(0);\n };\n const cancel = () => {\n if (!drag) return;\n drag = undefined;\n pane.removeAttribute(\"data-dragging\");\n set(0);\n };\n\n pane.addEventListener(\"keydown\", keydown);\n pane.addEventListener(\"click\", click);\n pane.addEventListener(\"pointerdown\", down);\n pane.addEventListener(\"pointermove\", move);\n pane.addEventListener(\"pointerup\", up);\n pane.addEventListener(\"pointercancel\", cancel);\n stopActive = () => {\n pane.removeEventListener(\"keydown\", keydown);\n pane.removeEventListener(\"click\", click);\n pane.removeEventListener(\"pointerdown\", down);\n pane.removeEventListener(\"pointermove\", move);\n pane.removeEventListener(\"pointerup\", up);\n pane.removeEventListener(\"pointercancel\", cancel);\n if (role === null) pane.removeAttribute(\"role\");\n else pane.setAttribute(\"role\", role);\n pane.removeAttribute(\"aria-modal\");\n if (tabIndex === null) pane.removeAttribute(\"tabindex\");\n else pane.setAttribute(\"tabindex\", tabIndex);\n pane.removeAttribute(\"data-dragging\");\n pane.style.removeProperty(\"--k2-sheet-drag\");\n stopActive = undefined;\n };\n };\n\n const follow = () => {\n if (media.matches && !stopActive) start();\n else if (!media.matches) stopActive?.();\n };\n follow();\n media.addEventListener(\"change\", follow);\n return () => {\n media.removeEventListener(\"change\", follow);\n stopActive?.();\n };\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAM,UAAU,GAAG,gCAAgC;AACnD,MAAM,SAAS,GACb,gKAAgK;AAClK;AACA,MAAM,OAAO,GACX,mIAAmI;AACrI;AACA,MAAM,KAAK,GAAG,GAAG;AACjB;AACA,MAAM,IAAI,GAAG,CAAC;AAEd,OAAO,MAAM,cAAc,GAAI,IAAiB,IAAmB;EACjE,MAAM,KAAK,GAAG,UAAU,CAAC,UAAU,CAAC;EACpC,IAAI,UAAoC;EAExC,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,aAAa,CAAc,yCAAyC,CAAC,EAAE,KAAK,CAAC,CAAC;EACvG,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC;EAEnG,MAAM,KAAK,GAAG,MAAM;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IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC;MAC5C,UAAU,GAAG,SAAS;IACxB,CAAC;EACH,CAAC;EAED,MAAM,MAAM,GAAG,MAAM;IACnB,IAAI,KAAK,CAAC,OAAO,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC,KACrC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,UAAU,GAAG,CAAC;EACzC,CAAC;EACD,MAAM,CAAC,CAAC;EACR,KAAK,CAAC,gBAAgB,CAAC,QAAQ,EAAE,MAAM,CAAC;EACxC,OAAO,MAAM;IACX,KAAK,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC3C,UAAU,GAAG,CAAC;EAChB,CAAC;AACH,CAAC","ignoreList":[]}
@@ -0,0 +1,152 @@
1
+ import { template as _$template } from "solid-js/web";
2
+ import { getNextElement as _$getNextElement } from "solid-js/web";
3
+ import { insert as _$insert } from "solid-js/web";
4
+ import { createComponent as _$createComponent } from "solid-js/web";
5
+ import { memo as _$memo } from "solid-js/web";
6
+ var _tmpl$ = /*#__PURE__*/_$template(`<div class=k2-pop-body>`);
7
+ import { createEffect, createSignal, onCleanup, children as resolveChildren, Show } from "solid-js";
8
+ import { usePopover } from "./behavior/overlays";
9
+ import { useTip } from "./behavior/tip";
10
+ import { OverPage } from "./columns-context";
11
+ import { alignTo, TriggerFace } from "./menu";
12
+ import { useOverlayMessages } from "./overlay-messages";
13
+ import { usePhone } from "./overlays";
14
+ import { PageLayer } from "./page-layer";
15
+ /**
16
+ * A panel behind a button, 280 px on a floating surface of 8 px radius, that does not block the page: Escape and a
17
+ * press outside close it, focus moves in and back. The button looks like `Button`, like a menu's. On the phone (below
18
+ * 768 px) the panel is a sheet from the bottom, and a button without words stays in a head as a menu's "…" does.
19
+ */
20
+ const Panel = props => {
21
+ const t = useOverlayMessages();
22
+ const words = resolveChildren(() => props.children);
23
+ const iconOnly = () => words() === undefined;
24
+ const name = () => props.label ?? props.title ?? t().moreActions;
25
+ const phone = usePhone();
26
+ let trigger;
27
+ const [align, setAlign] = createSignal("start");
28
+ const popover = usePopover(() => ({
29
+ presentation: phone() ? "sheet" : "popover",
30
+ ...(props.open !== undefined ? {
31
+ open: props.open
32
+ } : {}),
33
+ onOpenChange: open => {
34
+ if (open) setAlign(alignTo(trigger));
35
+ props.onOpenChange?.(open);
36
+ }
37
+ }));
38
+ return [_$createComponent(popover.Trigger, {
39
+ ref: element => {
40
+ trigger = element;
41
+ },
42
+ get disabled() {
43
+ return props.disabled;
44
+ },
45
+ "class": "k2-btn",
46
+ "data-k2-part": "Button",
47
+ get ["data-variant"]() {
48
+ return _$memo(() => (props.variant ?? (iconOnly() ? "ghost" : "secondary")) === "secondary")() ? undefined : props.variant ?? "ghost";
49
+ },
50
+ get ["data-icon-only"]() {
51
+ return iconOnly() ? "" : undefined;
52
+ },
53
+ get ["data-menu"]() {
54
+ return iconOnly() ? undefined : "";
55
+ },
56
+ get ["data-floats"]() {
57
+ return props.floats ? "" : undefined;
58
+ },
59
+ get ["aria-label"]() {
60
+ return _$memo(() => !!iconOnly())() ? name() : undefined;
61
+ },
62
+ get title() {
63
+ return _$memo(() => !!iconOnly())() ? name() : undefined;
64
+ },
65
+ get children() {
66
+ return _$createComponent(TriggerFace, {
67
+ get icon() {
68
+ return props.icon ?? (iconOnly() ? "dots" : undefined);
69
+ },
70
+ get label() {
71
+ return words();
72
+ },
73
+ get iconOnly() {
74
+ return iconOnly();
75
+ },
76
+ get chevron() {
77
+ return !iconOnly();
78
+ }
79
+ });
80
+ }
81
+ }), _$createComponent(popover.Popup, {
82
+ "class": "k2-pop",
83
+ "data-k2-part": "Popover",
84
+ side: "bottom",
85
+ get align() {
86
+ return align();
87
+ },
88
+ sideOffset: 4,
89
+ collisionPadding: 8,
90
+ get children() {
91
+ return [_$createComponent(Show, {
92
+ get when() {
93
+ return props.title;
94
+ },
95
+ children: title => _$createComponent(popover.Title, {
96
+ "class": "k2-pop-title",
97
+ get children() {
98
+ return title();
99
+ }
100
+ })
101
+ }), (() => {
102
+ var _el$ = _$getNextElement(_tmpl$);
103
+ _$insert(_el$, _$createComponent(OverPage, {
104
+ get children() {
105
+ return props.content;
106
+ }
107
+ }));
108
+ return _el$;
109
+ })()];
110
+ }
111
+ })];
112
+ };
113
+
114
+ /** A hint on the thing itself: the words show above it after a moment and name or describe it for assistive technology. */
115
+ const Tip = props => {
116
+ const tip = useTip();
117
+ const resolved = resolveChildren(() => props.children);
118
+ const element = () => resolved.toArray().find(node => node instanceof HTMLElement);
119
+ createEffect(() => {
120
+ const trigger = element();
121
+ if (!trigger) return;
122
+ // the browser's own hint (an icon button names itself in `title`) would show beside the tip; it comes back after
123
+ const title = trigger.getAttribute("title");
124
+ trigger.removeAttribute("title");
125
+ const unbind = tip.bindTrigger(trigger);
126
+ onCleanup(() => {
127
+ unbind();
128
+ if (title !== null) trigger.setAttribute("title", title);
129
+ });
130
+ });
131
+ // the tip stands at the end of the page, so the thing stays the last child of its place (see PageLayer)
132
+ return [_$memo(resolved), _$createComponent(PageLayer, {
133
+ from: element,
134
+ get children() {
135
+ return _$createComponent(tip.Popup, {
136
+ "class": "k2-tip",
137
+ "data-k2-part": "Popover",
138
+ side: "top",
139
+ sideOffset: 6,
140
+ collisionPadding: 8,
141
+ get children() {
142
+ return props.tip;
143
+ }
144
+ });
145
+ }
146
+ })];
147
+ };
148
+
149
+ /** A panel behind a button, or with `tip` a short hint on a thing. Tooltip and preview are both a Popover. */
150
+ // The kind is fixed where the Popover is written (`tip` or a panel), so it is chosen once.
151
+ export const Popover = props => "tip" in props ? _$createComponent(Tip, props) : _$createComponent(Panel, props);
152
+ //# sourceMappingURL=popover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["v2/popover.tsx"],"sourcesContent":["import { createEffect, createSignal, type JSX, onCleanup, children as resolveChildren, Show } from \"solid-js\";\nimport { usePopover } from \"./behavior/overlays\";\nimport { useTip } from \"./behavior/tip\";\nimport { OverPage } from \"./columns-context\";\nimport { alignTo, TriggerFace, type TriggerProps } from \"./menu\";\nimport { useOverlayMessages } from \"./overlay-messages\";\nimport { usePhone } from \"./overlays\";\nimport { PageLayer } from \"./page-layer\";\n\nexport type PopoverPanelProps = TriggerProps & {\n /** The heading of the panel, which also names it for assistive technology. */\n title?: string;\n /** What the panel shows: v2 primitives such as `Text`, `Facts`, `Check`, `Field`. */\n content: JSX.Element;\n /** Whether the panel is open, for a caller that closes it itself, such as after a pick; with `onOpenChange`. */\n open?: boolean;\n /** Called when the panel opens or closes, by its button, Escape or a press outside. */\n onOpenChange?: (open: boolean) => void;\n};\n\nexport type PopoverTipProps = {\n /** A short hint that shows after a moment on hover or keyboard focus, above the thing. */\n tip: string;\n /** The one element the hint belongs to, such as a `Button`; it gets no wrapper. */\n children: JSX.Element;\n};\n\nexport type PopoverProps = PopoverPanelProps | PopoverTipProps;\n\n/**\n * A panel behind a button, 280 px on a floating surface of 8 px radius, that does not block the page: Escape and a\n * press outside close it, focus moves in and back. The button looks like `Button`, like a menu's. On the phone (below\n * 768 px) the panel is a sheet from the bottom, and a button without words stays in a head as a menu's \"…\" does.\n */\nconst Panel = (props: PopoverPanelProps) => {\n const t = useOverlayMessages();\n const words = resolveChildren(() => props.children);\n const iconOnly = () => words() === undefined;\n const name = () => props.label ?? props.title ?? t().moreActions;\n const phone = usePhone();\n let trigger: HTMLElement | undefined;\n const [align, setAlign] = createSignal<\"start\" | \"end\">(\"start\");\n const popover = usePopover(() => ({\n presentation: phone() ? \"sheet\" : \"popover\",\n ...(props.open !== undefined ? { open: props.open } : {}),\n onOpenChange: (open: boolean) => {\n if (open) setAlign(alignTo(trigger));\n props.onOpenChange?.(open);\n },\n }));\n return (\n <>\n <popover.Trigger\n ref={(element: HTMLElement) => {\n trigger = element;\n }}\n disabled={props.disabled}\n class=\"k2-btn\"\n data-k2-part=\"Button\"\n data-variant={(props.variant ?? (iconOnly() ? \"ghost\" : \"secondary\")) === \"secondary\" ? undefined : (props.variant ?? \"ghost\")}\n data-icon-only={iconOnly() ? \"\" : undefined}\n data-menu={iconOnly() ? undefined : \"\"}\n data-floats={props.floats ? \"\" : undefined}\n aria-label={iconOnly() ? name() : undefined}\n title={iconOnly() ? name() : undefined}\n >\n <TriggerFace icon={props.icon ?? (iconOnly() ? \"dots\" : undefined)} label={words()} iconOnly={iconOnly()} chevron={!iconOnly()} />\n </popover.Trigger>\n <popover.Popup class=\"k2-pop\" data-k2-part=\"Popover\" side=\"bottom\" align={align()} sideOffset={4} collisionPadding={8}>\n <Show when={props.title}>{(title) => <popover.Title class=\"k2-pop-title\">{title()}</popover.Title>}</Show>\n <div class=\"k2-pop-body\">\n <OverPage>{props.content}</OverPage>\n </div>\n </popover.Popup>\n </>\n );\n};\n\n/** A hint on the thing itself: the words show above it after a moment and name or describe it for assistive technology. */\nconst Tip = (props: PopoverTipProps) => {\n const tip = useTip();\n const resolved = resolveChildren(() => props.children);\n const element = () => resolved.toArray().find((node): node is HTMLElement => node instanceof HTMLElement);\n createEffect(() => {\n const trigger = element();\n if (!trigger) return;\n // the browser's own hint (an icon button names itself in `title`) would show beside the tip; it comes back after\n const title = trigger.getAttribute(\"title\");\n trigger.removeAttribute(\"title\");\n const unbind = tip.bindTrigger(trigger);\n onCleanup(() => {\n unbind();\n if (title !== null) trigger.setAttribute(\"title\", title);\n });\n });\n // the tip stands at the end of the page, so the thing stays the last child of its place (see PageLayer)\n return (\n <>\n {resolved()}\n <PageLayer from={element}>\n <tip.Popup class=\"k2-tip\" data-k2-part=\"Popover\" side=\"top\" sideOffset={6} collisionPadding={8}>\n {props.tip}\n </tip.Popup>\n </PageLayer>\n </>\n );\n};\n\n/** A panel behind a button, or with `tip` a short hint on a thing. Tooltip and preview are both a Popover. */\n// The kind is fixed where the Popover is written (`tip` or a panel), so it is chosen once.\nexport const Popover = (props: PopoverProps) => (\"tip\" in props ? <Tip {...props} /> : <Panel {...props} />);\n"],"mappings":";;;;;;AAAA,SAAS,YAAY,EAAE,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I,GAAG,EAAK,KAAK,sBAAQ,KAAK,EAAK,KAAK,CAAK","ignoreList":[]}
@@ -0,0 +1,31 @@
1
+ import { i18n } from "@k2b/stdlib";
2
+ import { useLocale } from "../intl/locale";
3
+
4
+ /** The words of reactions and their picker, in the inherited render locale. */
5
+ const reactionMessages = i18n.define({
6
+ baseLocale: "en",
7
+ messages: {
8
+ en: {
9
+ add: "Add reaction",
10
+ emoji: "Emoji",
11
+ search: "Search emoji",
12
+ loading: "Loading emoji…",
13
+ failed: "Emoji could not be loaded.",
14
+ empty: "No emoji found."
15
+ },
16
+ de: {
17
+ add: "Reaktion hinzufügen",
18
+ emoji: "Emoji",
19
+ search: "Emoji suchen",
20
+ loading: "Emoji werden geladen…",
21
+ failed: "Emoji konnten nicht geladen werden.",
22
+ empty: "Keine Emoji gefunden."
23
+ }
24
+ }
25
+ });
26
+ export const useReactionMessages = () => {
27
+ const locale = useLocale();
28
+ return () => reactionMessages.resolve([locale()]).t;
29
+ };
30
+ export const checkReactionMessages = () => reactionMessages.check();
31
+ //# sourceMappingURL=reaction-messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["v2/reaction-messages.ts"],"sourcesContent":["import { i18n } from \"@k2b/stdlib\";\nimport { useLocale } from \"../intl/locale\";\n\n/** The words of reactions and their picker, in the inherited render locale. */\nconst reactionMessages = i18n.define({\n baseLocale: \"en\",\n messages: {\n en: {\n add: \"Add reaction\",\n emoji: \"Emoji\",\n search: \"Search emoji\",\n loading: \"Loading emoji…\",\n failed: \"Emoji could not be loaded.\",\n empty: \"No emoji found.\",\n },\n de: {\n add: \"Reaktion hinzufügen\",\n emoji: \"Emoji\",\n search: \"Emoji suchen\",\n loading: \"Emoji werden geladen…\",\n failed: \"Emoji konnten nicht geladen werden.\",\n empty: \"Keine Emoji gefunden.\",\n },\n },\n});\n\nexport const useReactionMessages = () => {\n const locale = useLocale();\n return () => reactionMessages.resolve([locale()]).t;\n};\n\nexport const checkReactionMessages = () => reactionMessages.check();\n"],"mappings":"AAAA,SAAS,IAAI,QAAQ,aAAa;AAClC,SAAS,SAAS,QAAQ,gBAAgB;;AAE1C;AACA,MAAM,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC;EACnC,UAAU,EAAE,IAAI;EAChB,QAAQ,EAAE;IACR,EAAE,EAAE;MACF,GAAG,EAAE,cAAc;MACnB,KAAK,EAAE,OAAO;MACd,MAAM,EAAE,cAAc;MACtB,OAAO,EAAE,gBAAgB;MACzB,MAAM,EAAE,4BAA4B;MACpC,KAAK,EAAE;IACT,CAAC;IACD,EAAE,EAAE;MACF,GAAG,EAAE,qBAAqB;MAC1B,KAAK,EAAE,OAAO;MACd,MAAM,EAAE,cAAc;MACtB,OAAO,EAAE,uBAAuB;MAChC,MAAM,EAAE,qCAAqC;MAC7C,KAAK,EAAE;IACT;EACF;AACF,CAAC,CAAC;AAEF,OAAO,MAAM,mBAAmB,GAAG,MAAM;EACvC,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC;EAC1B,OAAO,MAAM,gBAAgB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrD,CAAC;AAED,OAAO,MAAM,qBAAqB,GAAG,MAAM,gBAAgB,CAAC,KAAK,CAAC,CAAC","ignoreList":[]}