@k2b/ui 0.64.0 → 0.66.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 (319) hide show
  1. package/README.md +47 -0
  2. package/dist/base.css +3 -6
  3. package/dist/browser/actions/ContextMenu.js +1 -3
  4. package/dist/browser/actions/ContextMenu.js.map +1 -1
  5. package/dist/browser/actions/Dropdown.js +15 -69
  6. package/dist/browser/actions/Dropdown.js.map +1 -1
  7. package/dist/browser/actions/SortableList.js +1 -1
  8. package/dist/browser/actions/SortableList.js.map +1 -1
  9. package/dist/browser/actions/ViewTabs.js +5 -9
  10. package/dist/browser/actions/ViewTabs.js.map +1 -1
  11. package/dist/browser/actions/drag-and-drop.js +1 -1
  12. package/dist/browser/actions/drag-and-drop.js.map +1 -1
  13. package/dist/browser/actions/index.js.map +1 -1
  14. package/dist/browser/actions/menu-sheet.js +18 -80
  15. package/dist/browser/actions/menu-sheet.js.map +1 -1
  16. package/dist/browser/content/DataTable.js +197 -285
  17. package/dist/browser/content/DataTable.js.map +1 -1
  18. package/dist/browser/content/MessageRow.js +139 -115
  19. package/dist/browser/content/MessageRow.js.map +1 -1
  20. package/dist/browser/content/ProgressPath.js +25 -30
  21. package/dist/browser/content/ProgressPath.js.map +1 -1
  22. package/dist/browser/content/index.js +0 -2
  23. package/dist/browser/content/index.js.map +1 -1
  24. package/dist/browser/feedback/dialog-core.js +0 -11
  25. package/dist/browser/feedback/dialog-core.js.map +1 -1
  26. package/dist/browser/internal/field.js +2 -2
  27. package/dist/browser/internal/field.js.map +1 -1
  28. package/dist/browser/intl/messages.js +1 -1
  29. package/dist/browser/intl/messages.js.map +1 -1
  30. package/dist/browser/layout/AppWorkspace.js +8 -16
  31. package/dist/browser/layout/AppWorkspace.js.map +1 -1
  32. package/dist/browser/layout/Breadcrumbs.js +42 -188
  33. package/dist/browser/layout/Breadcrumbs.js.map +1 -1
  34. package/dist/browser/layout/DetailPanel.js +205 -209
  35. package/dist/browser/layout/DetailPanel.js.map +1 -1
  36. package/dist/browser/layout/PanelDialog.js +88 -176
  37. package/dist/browser/layout/PanelDialog.js.map +1 -1
  38. package/dist/browser/layout/app-workspace-controller.js +5 -12
  39. package/dist/browser/layout/app-workspace-controller.js.map +1 -1
  40. package/dist/browser/layout/app-workspace-state.js +2 -2
  41. package/dist/browser/layout/app-workspace-state.js.map +1 -1
  42. package/dist/browser/layout/index.js +0 -2
  43. package/dist/browser/layout/index.js.map +1 -1
  44. package/dist/browser/layout/workspace-messages.js +2 -12
  45. package/dist/browser/layout/workspace-messages.js.map +1 -1
  46. package/dist/browser/surfaces/NoticeCard.js +57 -69
  47. package/dist/browser/surfaces/NoticeCard.js.map +1 -1
  48. package/dist/browser/surfaces/Placeholder.js +5 -17
  49. package/dist/browser/surfaces/Placeholder.js.map +1 -1
  50. package/dist/browser/surfaces/Section.js +7 -22
  51. package/dist/browser/surfaces/Section.js.map +1 -1
  52. package/dist/browser/surfaces/StatusBadge.js +1 -5
  53. package/dist/browser/surfaces/StatusBadge.js.map +1 -1
  54. package/dist/browser/surfaces/index.js +0 -4
  55. package/dist/browser/surfaces/index.js.map +1 -1
  56. package/dist/browser/v2/button.js +180 -0
  57. package/dist/browser/v2/button.js.map +1 -0
  58. package/dist/browser/v2/components.js +763 -0
  59. package/dist/browser/v2/components.js.map +1 -0
  60. package/dist/browser/v2/content.js +1107 -0
  61. package/dist/browser/v2/content.js.map +1 -0
  62. package/dist/browser/v2/controls.js +568 -0
  63. package/dist/browser/v2/controls.js.map +1 -0
  64. package/dist/browser/v2/describe.js +397 -0
  65. package/dist/browser/v2/describe.js.map +1 -0
  66. package/dist/browser/v2/index.js +25 -0
  67. package/dist/browser/v2/index.js.map +1 -0
  68. package/dist/browser/v2/layout.js +578 -0
  69. package/dist/browser/v2/layout.js.map +1 -0
  70. package/dist/browser/v2/link.js +9 -0
  71. package/dist/browser/v2/link.js.map +1 -0
  72. package/dist/browser/v2/marks.js +211 -0
  73. package/dist/browser/v2/marks.js.map +1 -0
  74. package/dist/browser/v2/states.js +180 -0
  75. package/dist/browser/v2/states.js.map +1 -0
  76. package/dist/browser/v2/structure.js +328 -0
  77. package/dist/browser/v2/structure.js.map +1 -0
  78. package/dist/browser/v2/testing/index.js +23 -0
  79. package/dist/browser/v2/testing/index.js.map +1 -0
  80. package/dist/browser/v2/testing/measure-v2-layout.js +762 -0
  81. package/dist/browser/v2/testing/measure-v2-layout.js.map +1 -0
  82. package/dist/browser/v2/testing/settled.js +52 -0
  83. package/dist/browser/v2/testing/settled.js.map +1 -0
  84. package/dist/browser/v2/tokens.js +83 -0
  85. package/dist/browser/v2/tokens.js.map +1 -0
  86. package/dist/browser/v2/types.js +24 -0
  87. package/dist/browser/v2/types.js.map +1 -0
  88. package/dist/ssr/actions/ContextMenu.js +1 -3
  89. package/dist/ssr/actions/ContextMenu.js.map +1 -1
  90. package/dist/ssr/actions/Dropdown.js +15 -69
  91. package/dist/ssr/actions/Dropdown.js.map +1 -1
  92. package/dist/ssr/actions/SortableList.js +1 -1
  93. package/dist/ssr/actions/SortableList.js.map +1 -1
  94. package/dist/ssr/actions/ViewTabs.js +5 -9
  95. package/dist/ssr/actions/ViewTabs.js.map +1 -1
  96. package/dist/ssr/actions/drag-and-drop.js +1 -1
  97. package/dist/ssr/actions/drag-and-drop.js.map +1 -1
  98. package/dist/ssr/actions/index.js.map +1 -1
  99. package/dist/ssr/actions/menu-sheet.js +10 -62
  100. package/dist/ssr/actions/menu-sheet.js.map +1 -1
  101. package/dist/ssr/content/DataTable.js +54 -64
  102. package/dist/ssr/content/DataTable.js.map +1 -1
  103. package/dist/ssr/content/MessageRow.js +30 -10
  104. package/dist/ssr/content/MessageRow.js.map +1 -1
  105. package/dist/ssr/content/ProgressPath.js +8 -14
  106. package/dist/ssr/content/ProgressPath.js.map +1 -1
  107. package/dist/ssr/content/index.js +0 -2
  108. package/dist/ssr/content/index.js.map +1 -1
  109. package/dist/ssr/feedback/dialog-core.js +0 -11
  110. package/dist/ssr/feedback/dialog-core.js.map +1 -1
  111. package/dist/ssr/internal/field.js +2 -2
  112. package/dist/ssr/internal/field.js.map +1 -1
  113. package/dist/ssr/intl/messages.js +1 -1
  114. package/dist/ssr/intl/messages.js.map +1 -1
  115. package/dist/ssr/layout/AppWorkspace.js +8 -16
  116. package/dist/ssr/layout/AppWorkspace.js.map +1 -1
  117. package/dist/ssr/layout/Breadcrumbs.js +26 -140
  118. package/dist/ssr/layout/Breadcrumbs.js.map +1 -1
  119. package/dist/ssr/layout/DetailPanel.js +68 -70
  120. package/dist/ssr/layout/DetailPanel.js.map +1 -1
  121. package/dist/ssr/layout/PanelDialog.js +8 -82
  122. package/dist/ssr/layout/PanelDialog.js.map +1 -1
  123. package/dist/ssr/layout/app-workspace-controller.js +5 -12
  124. package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
  125. package/dist/ssr/layout/app-workspace-state.js +2 -2
  126. package/dist/ssr/layout/app-workspace-state.js.map +1 -1
  127. package/dist/ssr/layout/index.js +0 -2
  128. package/dist/ssr/layout/index.js.map +1 -1
  129. package/dist/ssr/layout/workspace-messages.js +2 -12
  130. package/dist/ssr/layout/workspace-messages.js.map +1 -1
  131. package/dist/ssr/surfaces/NoticeCard.js +5 -7
  132. package/dist/ssr/surfaces/NoticeCard.js.map +1 -1
  133. package/dist/ssr/surfaces/Placeholder.js +4 -15
  134. package/dist/ssr/surfaces/Placeholder.js.map +1 -1
  135. package/dist/ssr/surfaces/Section.js +4 -7
  136. package/dist/ssr/surfaces/Section.js.map +1 -1
  137. package/dist/ssr/surfaces/StatusBadge.js +1 -5
  138. package/dist/ssr/surfaces/StatusBadge.js.map +1 -1
  139. package/dist/ssr/surfaces/index.js +0 -4
  140. package/dist/ssr/surfaces/index.js.map +1 -1
  141. package/dist/ssr/v2/button.js +177 -0
  142. package/dist/ssr/v2/button.js.map +1 -0
  143. package/dist/ssr/v2/components.js +518 -0
  144. package/dist/ssr/v2/components.js.map +1 -0
  145. package/dist/ssr/v2/content.js +727 -0
  146. package/dist/ssr/v2/content.js.map +1 -0
  147. package/dist/ssr/v2/controls.js +268 -0
  148. package/dist/ssr/v2/controls.js.map +1 -0
  149. package/dist/ssr/v2/describe.js +397 -0
  150. package/dist/ssr/v2/describe.js.map +1 -0
  151. package/dist/ssr/v2/index.js +25 -0
  152. package/dist/ssr/v2/index.js.map +1 -0
  153. package/dist/ssr/v2/layout.js +377 -0
  154. package/dist/ssr/v2/layout.js.map +1 -0
  155. package/dist/ssr/v2/link.js +9 -0
  156. package/dist/ssr/v2/link.js.map +1 -0
  157. package/dist/ssr/v2/marks.js +126 -0
  158. package/dist/ssr/v2/marks.js.map +1 -0
  159. package/dist/ssr/v2/states.js +128 -0
  160. package/dist/ssr/v2/states.js.map +1 -0
  161. package/dist/ssr/v2/structure.js +229 -0
  162. package/dist/ssr/v2/structure.js.map +1 -0
  163. package/dist/ssr/v2/testing/index.js +23 -0
  164. package/dist/ssr/v2/testing/index.js.map +1 -0
  165. package/dist/ssr/v2/testing/measure-v2-layout.js +762 -0
  166. package/dist/ssr/v2/testing/measure-v2-layout.js.map +1 -0
  167. package/dist/ssr/v2/testing/settled.js +52 -0
  168. package/dist/ssr/v2/testing/settled.js.map +1 -0
  169. package/dist/ssr/v2/tokens.js +83 -0
  170. package/dist/ssr/v2/tokens.js.map +1 -0
  171. package/dist/ssr/v2/types.js +24 -0
  172. package/dist/ssr/v2/types.js.map +1 -0
  173. package/dist/styles.css +1 -1
  174. package/dist/types/actions/Dropdown.d.ts +1 -35
  175. package/dist/types/actions/ViewTabs.d.ts +2 -3
  176. package/dist/types/actions/index.d.ts +1 -1
  177. package/dist/types/actions/menu-sheet.d.ts +1 -3
  178. package/dist/types/content/DataTable.d.ts +0 -19
  179. package/dist/types/content/MessageRow.d.ts +11 -0
  180. package/dist/types/content/ProgressPath.d.ts +6 -12
  181. package/dist/types/content/index.d.ts +0 -2
  182. package/dist/types/feedback/dialog-core.d.ts +0 -5
  183. package/dist/types/layout/AppWorkspace.d.ts +2 -10
  184. package/dist/types/layout/Breadcrumbs.d.ts +5 -10
  185. package/dist/types/layout/PanelDialog.d.ts +0 -19
  186. package/dist/types/layout/app-workspace-state.d.ts +2 -2
  187. package/dist/types/layout/index.d.ts +1 -5
  188. package/dist/types/layout/workspace-messages.d.ts +0 -5
  189. package/dist/types/surfaces/NoticeCard.d.ts +4 -6
  190. package/dist/types/surfaces/Placeholder.d.ts +0 -7
  191. package/dist/types/surfaces/Section.d.ts +2 -8
  192. package/dist/types/surfaces/StatusBadge.d.ts +1 -2
  193. package/dist/types/surfaces/index.d.ts +1 -9
  194. package/dist/types/v2/button.d.ts +54 -0
  195. package/dist/types/v2/components.d.ts +173 -0
  196. package/dist/types/v2/content.d.ts +233 -0
  197. package/dist/types/v2/controls.d.ts +118 -0
  198. package/dist/types/v2/describe.d.ts +18 -0
  199. package/dist/types/v2/index.d.ts +22 -0
  200. package/dist/types/v2/layout.d.ts +124 -0
  201. package/dist/types/v2/link.d.ts +7 -0
  202. package/dist/types/v2/marks.d.ts +90 -0
  203. package/dist/types/v2/states.d.ts +45 -0
  204. package/dist/types/v2/structure.d.ts +47 -0
  205. package/dist/types/v2/testing/index.d.ts +16 -0
  206. package/dist/types/v2/testing/measure-v2-layout.d.ts +99 -0
  207. package/dist/types/v2/testing/settled.d.ts +13 -0
  208. package/dist/types/v2/tokens.d.ts +77 -0
  209. package/dist/types/v2/types.d.ts +44 -0
  210. package/dist/v2.css +3072 -0
  211. package/package.json +24 -10
  212. package/skills/k2b-ui/SKILL.md +201 -0
  213. package/skills/k2b-ui/images/form-1440.png +0 -0
  214. package/skills/k2b-ui/images/form-390.png +0 -0
  215. package/skills/k2b-ui/images/list-detail-1440.png +0 -0
  216. package/skills/k2b-ui/images/list-detail-390.png +0 -0
  217. package/skills/k2b-ui/images/mail-1440.png +0 -0
  218. package/skills/k2b-ui/images/mail-390.png +0 -0
  219. package/skills/k2b-ui/images/record-1440.png +0 -0
  220. package/skills/k2b-ui/images/record-390.png +0 -0
  221. package/skills/k2b-ui/images/record-groups-1440.png +0 -0
  222. package/skills/k2b-ui/images/record-groups-390.png +0 -0
  223. package/skills/k2b-ui/images/table-1440.png +0 -0
  224. package/skills/k2b-ui/images/table-390.png +0 -0
  225. package/skills/k2b-ui/recipes/form.tsx +54 -0
  226. package/skills/k2b-ui/recipes/list-detail.tsx +105 -0
  227. package/skills/k2b-ui/recipes/mail.tsx +193 -0
  228. package/skills/k2b-ui/recipes/record-groups.tsx +115 -0
  229. package/skills/k2b-ui/recipes/record.tsx +163 -0
  230. package/skills/k2b-ui/recipes/table.tsx +68 -0
  231. package/skills/k2b-ui/references/mistakes.md +162 -0
  232. package/skills/k2b-ui/references/primitives.md +310 -0
  233. package/skills/k2b-ui/references/recipes.md +101 -0
  234. package/skills/k2b-ui/references/seeing.md +94 -0
  235. package/dist/browser/actions/menu-sheet-messages.js +0 -26
  236. package/dist/browser/actions/menu-sheet-messages.js.map +0 -1
  237. package/dist/browser/actions/menu-submenu-panel.js +0 -392
  238. package/dist/browser/actions/menu-submenu-panel.js.map +0 -1
  239. package/dist/browser/content/FileName.js +0 -68
  240. package/dist/browser/content/FileName.js.map +0 -1
  241. package/dist/browser/content/TaskRow.js +0 -129
  242. package/dist/browser/content/TaskRow.js.map +0 -1
  243. package/dist/browser/content/progress-path-messages.js +0 -22
  244. package/dist/browser/content/progress-path-messages.js.map +0 -1
  245. package/dist/browser/feedback/dialog-foot.js +0 -45
  246. package/dist/browser/feedback/dialog-foot.js.map +0 -1
  247. package/dist/browser/internal/renders-something.js +0 -3
  248. package/dist/browser/internal/renders-something.js.map +0 -1
  249. package/dist/browser/layout/FloatingPill.js +0 -33
  250. package/dist/browser/layout/FloatingPill.js.map +0 -1
  251. package/dist/browser/layout/StatusRow.js +0 -174
  252. package/dist/browser/layout/StatusRow.js.map +0 -1
  253. package/dist/browser/layout/panel-dialog-error.js +0 -44
  254. package/dist/browser/layout/panel-dialog-error.js.map +0 -1
  255. package/dist/browser/layout/panel-sheet-handle.js +0 -86
  256. package/dist/browser/layout/panel-sheet-handle.js.map +0 -1
  257. package/dist/browser/layout-check.js +0 -232
  258. package/dist/browser/layout-check.js.map +0 -1
  259. package/dist/browser/surfaces/Area.js +0 -205
  260. package/dist/browser/surfaces/Area.js.map +0 -1
  261. package/dist/browser/surfaces/FactGroup.js +0 -148
  262. package/dist/browser/surfaces/FactGroup.js.map +0 -1
  263. package/dist/browser/surfaces/FieldGrid.js +0 -34
  264. package/dist/browser/surfaces/FieldGrid.js.map +0 -1
  265. package/dist/browser/surfaces/RowGroup.js +0 -82
  266. package/dist/browser/surfaces/RowGroup.js.map +0 -1
  267. package/dist/browser/surfaces/flat-block-messages.js +0 -37
  268. package/dist/browser/surfaces/flat-block-messages.js.map +0 -1
  269. package/dist/ssr/actions/menu-sheet-messages.js +0 -26
  270. package/dist/ssr/actions/menu-sheet-messages.js.map +0 -1
  271. package/dist/ssr/actions/menu-submenu-panel.js +0 -295
  272. package/dist/ssr/actions/menu-submenu-panel.js.map +0 -1
  273. package/dist/ssr/content/FileName.js +0 -46
  274. package/dist/ssr/content/FileName.js.map +0 -1
  275. package/dist/ssr/content/TaskRow.js +0 -95
  276. package/dist/ssr/content/TaskRow.js.map +0 -1
  277. package/dist/ssr/content/progress-path-messages.js +0 -22
  278. package/dist/ssr/content/progress-path-messages.js.map +0 -1
  279. package/dist/ssr/feedback/dialog-foot.js +0 -45
  280. package/dist/ssr/feedback/dialog-foot.js.map +0 -1
  281. package/dist/ssr/internal/renders-something.js +0 -3
  282. package/dist/ssr/internal/renders-something.js.map +0 -1
  283. package/dist/ssr/layout/FloatingPill.js +0 -16
  284. package/dist/ssr/layout/FloatingPill.js.map +0 -1
  285. package/dist/ssr/layout/StatusRow.js +0 -93
  286. package/dist/ssr/layout/StatusRow.js.map +0 -1
  287. package/dist/ssr/layout/panel-dialog-error.js +0 -28
  288. package/dist/ssr/layout/panel-dialog-error.js.map +0 -1
  289. package/dist/ssr/layout/panel-sheet-handle.js +0 -66
  290. package/dist/ssr/layout/panel-sheet-handle.js.map +0 -1
  291. package/dist/ssr/layout-check.js +0 -232
  292. package/dist/ssr/layout-check.js.map +0 -1
  293. package/dist/ssr/surfaces/Area.js +0 -147
  294. package/dist/ssr/surfaces/Area.js.map +0 -1
  295. package/dist/ssr/surfaces/FactGroup.js +0 -106
  296. package/dist/ssr/surfaces/FactGroup.js.map +0 -1
  297. package/dist/ssr/surfaces/FieldGrid.js +0 -22
  298. package/dist/ssr/surfaces/FieldGrid.js.map +0 -1
  299. package/dist/ssr/surfaces/RowGroup.js +0 -60
  300. package/dist/ssr/surfaces/RowGroup.js.map +0 -1
  301. package/dist/ssr/surfaces/flat-block-messages.js +0 -37
  302. package/dist/ssr/surfaces/flat-block-messages.js.map +0 -1
  303. package/dist/types/actions/menu-sheet-messages.d.ts +0 -11
  304. package/dist/types/actions/menu-submenu-panel.d.ts +0 -27
  305. package/dist/types/content/FileName.d.ts +0 -23
  306. package/dist/types/content/TaskRow.d.ts +0 -33
  307. package/dist/types/content/progress-path-messages.d.ts +0 -8
  308. package/dist/types/feedback/dialog-foot.d.ts +0 -9
  309. package/dist/types/internal/renders-something.d.ts +0 -2
  310. package/dist/types/layout/FloatingPill.d.ts +0 -20
  311. package/dist/types/layout/StatusRow.d.ts +0 -54
  312. package/dist/types/layout/panel-dialog-error.d.ts +0 -9
  313. package/dist/types/layout/panel-sheet-handle.d.ts +0 -8
  314. package/dist/types/layout-check.d.ts +0 -52
  315. package/dist/types/surfaces/Area.d.ts +0 -38
  316. package/dist/types/surfaces/FactGroup.d.ts +0 -33
  317. package/dist/types/surfaces/FieldGrid.d.ts +0 -14
  318. package/dist/types/surfaces/RowGroup.d.ts +0 -20
  319. package/dist/types/surfaces/flat-block-messages.d.ts +0 -16
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["content/TaskRow.tsx"],"sourcesContent":["import { createSignal, type JSX, Show } from \"solid-js\";\nimport { Dynamic, isServer } from \"solid-js/web\";\nimport { Tooltip } from \"../feedback/Tooltip\";\n\nexport type TaskRowProps = {\n /** Tabler icon class for the kind of task, such as `ti ti-package-export`. Decorative: the sentence names the task. */\n icon: string;\n /** How many things the task covers, as a chip before the sentence. Zero shows no chip; the sentence says it in words. */\n count?: number;\n /** The task in one sentence, such as \"3 unsold items are ready for pickup\". One line; a longer one ends in an ellipsis. */\n text: string;\n /** A quiet second line, such as the date the task is due. The row is then 52 px instead of 40 px. */\n detail?: JSX.Element;\n /** The action word at the end, such as \"Prepare handover\". It is never cut; the sentence gives way first. */\n action: string;\n /** Where the row leads. The row is then a link. */\n href?: string;\n /** What the row does when there is no `href`. The row is then a button. */\n onClick?: (event: MouseEvent) => void;\n /** The task cannot be started now. The row stays in place, reads as unavailable and does nothing. */\n disabled?: boolean;\n /**\n * The accessible name, when the visible text alone does not say what happens. Defaults to the row's text. Start it\n * with the visible sentence and action word, so people who speak a visible word can still reach the row.\n */\n label?: string;\n class?: string;\n};\n\n/**\n * A task that only has a date, such as items waiting for pickup until a day: the kind as a symbol, the count as a\n * chip, one sentence and, at the end, the action word. The whole row is one link or button. What needs someone now\n * and has a consequence is a notice cell instead (K10), not a task row.\n * @example <TaskRow icon=\"ti ti-package-export\" count={3} text=\"Unsold items are ready for pickup\" detail=\"until Dec 12, 2026\" action=\"Prepare handover\" href=\"/handover\" />\n */\nexport function TaskRow(props: TaskRowProps): JSX.Element {\n let row: HTMLElement | undefined;\n let body: HTMLSpanElement | undefined;\n let sentence: HTMLSpanElement | undefined;\n // The full sentence shows as a hint only while it is cut; it is measured when a pointer or the keyboard arrives.\n const [cut, setCut] = createSignal(false);\n const measure = () => setCut(Boolean(sentence && sentence.scrollWidth > sentence.clientWidth + 1));\n const link = () => props.href !== undefined && !props.disabled;\n const element = () => (props.href !== undefined ? \"a\" : \"button\");\n\n return (\n <Dynamic\n component={element()}\n ref={(node: HTMLElement) => {\n row = node;\n }}\n class={props.class ? `k2b-task-row ${props.class}` : \"k2b-task-row\"}\n href={link() ? props.href : undefined}\n type={element() === \"button\" ? \"button\" : undefined}\n disabled={element() === \"button\" ? props.disabled : undefined}\n role={props.disabled && element() === \"a\" ? \"link\" : undefined}\n aria-disabled={props.disabled && element() === \"a\" ? \"true\" : undefined}\n aria-label={props.label}\n data-detail={props.detail !== undefined ? \"\" : undefined}\n // The no-JavaScript hint; once hydrated, the shared tooltip shows the sentence, and only while it is cut.\n title={isServer ? props.text : undefined}\n onClick={(event: MouseEvent) => {\n if (props.disabled) {\n event.preventDefault();\n return;\n }\n props.onClick?.(event);\n }}\n on:pointerenter={measure}\n on:focusin={measure}\n >\n <span ref={body} class=\"k2b-task-row__body\">\n <i class={`${props.icon} k2b-task-row__icon`} aria-hidden=\"true\" />\n <span class=\"k2b-task-row__copy\">\n <span class=\"k2b-task-row__line\">\n <Show when={props.count}>\n <span class=\"k2b-count-chip\">{props.count}</span>\n </Show>\n <span ref={sentence} class=\"k2b-task-row__text\">\n {props.text}\n </span>\n </span>\n <Show when={props.detail !== undefined}>\n <span class=\"k2b-task-row__detail\">{props.detail}</span>\n </Show>\n </span>\n <span class=\"k2b-task-row__action\">{props.action}</span>\n {/* Inside the row, so a container that divides its rows (`k2b-divided`) sees only rows. The row keeps the\n focus; the hint is hidden from its name, which already holds the sentence. */}\n <Tooltip content={props.text} target={() => body} focusTarget={() => row} disabled={!cut()} />\n </span>\n </Dynamic>\n );\n}\n\nexport default TaskRow;\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,YAAY,EAAY,IAAI,QAAQ,UAAU;AACvD,SAAS,OAAO,EAAE,QAAQ,QAAQ,cAAc;AAChD,SAAS,OAAO,QAAQ,qBAAqB;AA2B7C;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAAS,OAAO,CAAC,KAAmB,EAAe;EACxD,IAAI,GAA4B;EAChC,IAAI,IAAiC;EACrC,IAAI,QAAqC;EACzC;EACA,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC;EACzC,MAAM,OAAO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A;IACxC,OAAO,EAAG,KAAiB,IAAK;MAC9B,IAAI,KAAK,CAAC,QAAQ,EAAE;QAClB,KAAK,CAAC,cAAc,CAAC,CAAC;QACtB;MACF;MACA,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC;IACxB,CAAC;IAAA,mBACgB,OAAO;IAAA,cACZ,OAAO;IAAA;MAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;QAAA;MAAA,YAER,IAAI;MAAA,mDAAJ,IAAI;MAAA,kCAIR,IAAI;QAAA,IAAC,IAAI;UAAA,OAAE,KAAK,CAAC,KAAK;QAAA;QAAA;UAAA;UAAA,sBACS,KAAK,CAAC,KAAK;UAAA;QAAA;MAAA;MAAA,aAEhC,QAAQ;MAAA,sDAAR,QAAQ;MAAA,sBAChB,KAAK,CAAC,IAAI;MAAA,kCAGd,IAAI;QAAA,IAAC,IAAI;UAAA,OAAE,KAAK,CAAC,MAAM,KAAK,SAAS;QAAA;QAAA;UAAA;UAAA,sBACA,KAAK,CAAC,MAAM;UAAA;QAAA;MAAA;MAAA,uBAGhB,KAAK,CAAC,MAAM;MAAA,iCAG/C,OAAO;QAAA,IAAC,OAAO;UAAA,OAAE,KAAK,CAAC,IAAI;QAAA;QAAE,MAAM,EAAE,MAAM,IAAI;QAAE,WAAW,EAAE,MAAM,GAAG;QAAA,IAAE,QAAQ;UAAA,OAAE,CAAC,GAAG,CAAC,CAAC;QAAA;MAAA;MAAA,kCAjBhF,GAAG,KAAK,CAAC,IAAI,qBAAqB;MAAA;IAAA;EAAA;AAqBpD;AAEA,eAAe,OAAO","ignoreList":[]}
@@ -1,22 +0,0 @@
1
- import { i18n } from "@k2b/stdlib";
2
- import { useLocale } from "../intl/locale";
3
-
4
- // The word for the current stage lives with the path, not in the common catalog every component loads.
5
- const progressPathMessages = i18n.define({
6
- baseLocale: "en",
7
- messages: {
8
- en: {
9
- current: "current step"
10
- },
11
- de: {
12
- current: "aktueller Schritt"
13
- }
14
- }
15
- });
16
- /** Resolved from the inherited render locale. */
17
- export const useProgressPathMessages = () => {
18
- const locale = useLocale();
19
- return () => progressPathMessages.resolve([locale()]).t;
20
- };
21
- export const checkProgressPathMessages = () => progressPathMessages.check();
22
- //# sourceMappingURL=progress-path-messages.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["content/progress-path-messages.ts"],"sourcesContent":["import { i18n } from \"@k2b/stdlib\";\nimport { useLocale } from \"../intl/locale\";\n\n// The word for the current stage lives with the path, not in the common catalog every component loads.\nconst progressPathMessages = i18n.define({\n baseLocale: \"en\",\n messages: {\n en: { current: \"current step\" },\n de: { current: \"aktueller Schritt\" },\n },\n});\n\nexport type ProgressPathMessages = ReturnType<(typeof progressPathMessages)[\"resolve\"]>[\"t\"];\n\n/** Resolved from the inherited render locale. */\nexport const useProgressPathMessages = (): (() => ProgressPathMessages) => {\n const locale = useLocale();\n return () => progressPathMessages.resolve([locale()]).t;\n};\n\nexport const checkProgressPathMessages = () => progressPathMessages.check();\n"],"mappings":"AAAA,SAAS,IAAI,QAAQ,aAAa;AAClC,SAAS,SAAS,QAAQ,gBAAgB;;AAE1C;AACA,MAAM,oBAAoB,GAAG,IAAI,CAAC,MAAM,CAAC;EACvC,UAAU,EAAE,IAAI;EAChB,QAAQ,EAAE;IACR,EAAE,EAAE;MAAE,OAAO,EAAE;IAAe,CAAC;IAC/B,EAAE,EAAE;MAAE,OAAO,EAAE;IAAoB;EACrC;AACF,CAAC,CAAC;AAIF;AACA,OAAO,MAAM,uBAAuB,GAAG,MAAoC;EACzE,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC;EAC1B,OAAO,MAAM,oBAAoB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACzD,CAAC;AAED,OAAO,MAAM,yBAAyB,GAAG,MAAM,oBAAoB,CAAC,KAAK,CAAC,CAAC","ignoreList":[]}
@@ -1,45 +0,0 @@
1
- import { DIALOG_LIFT } from "./dialog-core";
2
-
3
- /** The least room a lifted frame keeps above it, as the frame's own budget keeps at the viewport's edge. */
4
- const EDGE = 8;
5
-
6
- /** A frame centered by its stylesheet, which grows down by half of any new height: a sheet or a placed window does not. */
7
- const centered = frame => {
8
- if (frame.style.inset || frame.hasAttribute("data-k2b-follow-content") || frame.hasAttribute("data-k2b-frame-motion")) return false;
9
- const transform = getComputedStyle(frame).transform;
10
- return Boolean(transform && transform !== "none" && new DOMMatrixReadOnly(transform).m42 < -0.5);
11
- };
12
-
13
- /**
14
- * Keeps a dialog's footer where it is whenever the frame's height changes while it is open, such as when an error
15
- * shows above the footer (K16): a centered frame grows down by half of the new height, so it moves up by that much
16
- * and grows upwards only; it shrinks from the top as well. It never moves past the top edge: a frame at its full
17
- * height scrolls its body instead. A frame that follows its content folds from its top edge on its own, a placed
18
- * window keeps its place, and a sheet keeps its bottom anyway. A new window size centers the frame again.
19
- * Returns a function that stops it.
20
- */
21
- export const holdDialogFoot = footer => {
22
- const frame = footer.closest("dialog");
23
- if (!frame || typeof ResizeObserver === "undefined") return;
24
- // The first measure of an open frame is where the footer stands; opening is no change.
25
- let height;
26
- const observer = new ResizeObserver(() => {
27
- const next = frame.offsetHeight;
28
- const delta = height === undefined || !frame.open ? 0 : next - height;
29
- height = frame.open ? next : undefined;
30
- // Only the level on show holds its footer; a level hidden below another one changes nothing.
31
- if (Math.abs(delta) < 0.5 || !frame.open || !footer.isConnected || footer.offsetParent === null || !centered(frame)) return;
32
- const half = delta / 2;
33
- const shift = half > 0 ? Math.min(half, Math.max(0, frame.getBoundingClientRect().top - EDGE)) : half;
34
- const lift = Math.max(0, (Number.parseFloat(frame.style.getPropertyValue(DIALOG_LIFT)) || 0) + shift);
35
- if (lift < 0.5) frame.style.removeProperty(DIALOG_LIFT);else frame.style.setProperty(DIALOG_LIFT, `${Math.round(lift)}px`);
36
- });
37
- const recenter = () => frame.style.removeProperty(DIALOG_LIFT);
38
- observer.observe(frame);
39
- window.addEventListener("resize", recenter);
40
- return () => {
41
- observer.disconnect();
42
- window.removeEventListener("resize", recenter);
43
- };
44
- };
45
- //# sourceMappingURL=dialog-foot.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["feedback/dialog-foot.ts"],"sourcesContent":["import { DIALOG_LIFT } from \"./dialog-core\";\n\n/** The least room a lifted frame keeps above it, as the frame's own budget keeps at the viewport's edge. */\nconst EDGE = 8;\n\n/** A frame centered by its stylesheet, which grows down by half of any new height: a sheet or a placed window does not. */\nconst centered = (frame: HTMLElement): boolean => {\n if (frame.style.inset || frame.hasAttribute(\"data-k2b-follow-content\") || frame.hasAttribute(\"data-k2b-frame-motion\")) return false;\n const transform = getComputedStyle(frame).transform;\n return Boolean(transform && transform !== \"none\" && new DOMMatrixReadOnly(transform).m42 < -0.5);\n};\n\n/**\n * Keeps a dialog's footer where it is whenever the frame's height changes while it is open, such as when an error\n * shows above the footer (K16): a centered frame grows down by half of the new height, so it moves up by that much\n * and grows upwards only; it shrinks from the top as well. It never moves past the top edge: a frame at its full\n * height scrolls its body instead. A frame that follows its content folds from its top edge on its own, a placed\n * window keeps its place, and a sheet keeps its bottom anyway. A new window size centers the frame again.\n * Returns a function that stops it.\n */\nexport const holdDialogFoot = (footer: HTMLElement): (() => void) | undefined => {\n const frame = footer.closest(\"dialog\");\n if (!frame || typeof ResizeObserver === \"undefined\") return;\n // The first measure of an open frame is where the footer stands; opening is no change.\n let height: number | undefined;\n const observer = new ResizeObserver(() => {\n const next = frame.offsetHeight;\n const delta = height === undefined || !frame.open ? 0 : next - height;\n height = frame.open ? next : undefined;\n // Only the level on show holds its footer; a level hidden below another one changes nothing.\n if (Math.abs(delta) < 0.5 || !frame.open || !footer.isConnected || footer.offsetParent === null || !centered(frame)) return;\n const half = delta / 2;\n const shift = half > 0 ? Math.min(half, Math.max(0, frame.getBoundingClientRect().top - EDGE)) : half;\n const lift = Math.max(0, (Number.parseFloat(frame.style.getPropertyValue(DIALOG_LIFT)) || 0) + shift);\n if (lift < 0.5) frame.style.removeProperty(DIALOG_LIFT);\n else frame.style.setProperty(DIALOG_LIFT, `${Math.round(lift)}px`);\n });\n const recenter = () => frame.style.removeProperty(DIALOG_LIFT);\n observer.observe(frame);\n window.addEventListener(\"resize\", recenter);\n return () => {\n observer.disconnect();\n window.removeEventListener(\"resize\", recenter);\n };\n};\n"],"mappings":"AAAA,SAAS,WAAW,QAAQ,eAAe;;AAE3C;AACA,MAAM,IAAI,GAAG,CAAC;;AAEd;AACA,MAAM,QAAQ,GAAI,KAAkB,IAAc;EAChD,IAAI,KAAK,CAAC,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,YAAY,CAAC,yBAAyB,CAAC,IAAI,KAAK,CAAC,YAAY,CAAC,uBAAuB,CAAC,EAAE,OAAO,KAAK;EACnI,MAAM,SAAS,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC,SAAS;EACnD,OAAO,OAAO,CAAC,SAAS,IAAI,SAAS,KAAK,MAAM,IAAI,IAAI,iBAAiB,CAAC,SAAS,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC;AAClG,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM,cAAc,GAAI,MAAmB,IAA+B;EAC/E,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC;EACtC,IAAI,CAAC,KAAK,IAAI,OAAO,cAAc,KAAK,WAAW,EAAE;EACrD;EACA,IAAI,MAA0B;EAC9B,MAAM,QAAQ,GAAG,IAAI,cAAc,CAAC,MAAM;IACxC,MAAM,IAAI,GAAG,KAAK,CAAC,YAAY;IAC/B,MAAM,KAAK,GAAG,MAAM,KAAK,SAAS,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC,GAAG,IAAI,GAAG,MAAM;IACrE,MAAM,GAAG,KAAK,CAAC,IAAI,GAAG,IAAI,GAAG,SAAS;IACtC;IACA,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,YAAY,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;IACrH,MAAM,IAAI,GAAG,KAAK,GAAG,CAAC;IACtB,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC,GAAG,IAAI;IACrG,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC;IACrG,IAAI,IAAI,GAAG,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,KACnD,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;EACpE,CAAC,CAAC;EACF,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC;EAC9D,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC;EACvB,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC;EAC3C,OAAO,MAAM;IACX,QAAQ,CAAC,UAAU,CAAC,CAAC;IACrB,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC;EAChD,CAAC;AACH,CAAC","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- /** Whether resolved children render something; a Show whose condition is false, or a boolean, renders nothing. */
2
- export const rendersSomething = nodes => nodes.some(node => node != null && typeof node !== "boolean" && node !== "");
3
- //# sourceMappingURL=renders-something.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["internal/renders-something.ts"],"sourcesContent":["/** Whether resolved children render something; a Show whose condition is false, or a boolean, renders nothing. */\nexport const rendersSomething = (nodes: unknown[]): boolean =>\n nodes.some((node) => node != null && typeof node !== \"boolean\" && node !== \"\");\n"],"mappings":"AAAA;AACA,OAAO,MAAM,gBAAgB,GAAI,KAAgB,IAC/C,KAAK,CAAC,IAAI,CAAE,IAAI,IAAK,IAAI,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,EAAE,CAAC","ignoreList":[]}
@@ -1,33 +0,0 @@
1
- import { template as _$template } from "solid-js/web";
2
- import { setAttribute as _$setAttribute } from "solid-js/web";
3
- import { className as _$className } from "solid-js/web";
4
- import { effect as _$effect } from "solid-js/web";
5
- import { getNextElement as _$getNextElement } from "solid-js/web";
6
- import { insert as _$insert } from "solid-js/web";
7
- var _tmpl$ = /*#__PURE__*/_$template(`<div role=group>`),
8
- _tmpl$2 = /*#__PURE__*/_$template(`<span class=k2b-floating-pill__separator aria-hidden=true>`);
9
- /**
10
- * The floating pill of a reading column (K6, K16): views and actions of a column that has neither head nor status
11
- * row, such as a note. Place it as the first child of `AppWorkspace.Main width="reading"`. It stays at the column's
12
- * top end while the text scrolls below it, and takes no room from the text. It is a `k2b-pill`, so its look, size,
13
- * and round controls are the ones of every floating pill.
14
- */
15
- const FloatingPill = props => (() => {
16
- var _el$ = _$getNextElement(_tmpl$);
17
- _$insert(_el$, () => props.children);
18
- _$effect(_p$ => {
19
- var _v$ = `k2b-pill k2b-floating-pill${props.class ? ` ${props.class}` : ""}`,
20
- _v$2 = props.label;
21
- _v$ !== _p$.e && _$className(_el$, _p$.e = _v$);
22
- _v$2 !== _p$.t && _$setAttribute(_el$, "aria-label", _p$.t = _v$2);
23
- return _p$;
24
- }, {
25
- e: undefined,
26
- t: undefined
27
- });
28
- return _el$;
29
- })();
30
- FloatingPill.Separator = () => _$getNextElement(_tmpl$2);
31
- export { FloatingPill };
32
- export default FloatingPill;
33
- //# sourceMappingURL=FloatingPill.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["layout/FloatingPill.tsx"],"sourcesContent":["import type { JSX } from \"solid-js\";\n\nexport type FloatingPillProps = {\n /** Names the group for assistive technology, such as \"Note views and actions\". */\n label: string;\n /** Views and actions, usually small `IconButton`s or a `SegmentedControl`; `FloatingPill.Separator` parts them. */\n children: JSX.Element;\n class?: string;\n};\n\ntype FloatingPillComponent = ((props: FloatingPillProps) => JSX.Element) & { Separator: () => JSX.Element };\n\n/**\n * The floating pill of a reading column (K6, K16): views and actions of a column that has neither head nor status\n * row, such as a note. Place it as the first child of `AppWorkspace.Main width=\"reading\"`. It stays at the column's\n * top end while the text scrolls below it, and takes no room from the text. It is a `k2b-pill`, so its look, size,\n * and round controls are the ones of every floating pill.\n */\nconst FloatingPill = ((props: FloatingPillProps) => (\n <div class={`k2b-pill k2b-floating-pill${props.class ? ` ${props.class}` : \"\"}`} role=\"group\" aria-label={props.label}>\n {props.children}\n </div>\n)) as FloatingPillComponent;\n\nFloatingPill.Separator = () => <span class=\"k2b-floating-pill__separator\" aria-hidden=\"true\" />;\n\nexport { FloatingPill };\nexport default FloatingPill;\n"],"mappings":";;;;;;;;AAYA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,YAAY,GAAK,KAAwB;EAAA;EAAA,qBAE1C,KAAK,CAAC,QAAQ;EAAA;IAAA,UADL,6BAA6B,KAAK,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;MAAA,OAA2B,KAAK,CAAC,KAAK;IAAA;IAAA;IAAA;EAAA;IAAA;IAAA;EAAA;EAAA;AAAA,IAG5F;AAE3B,YAAY,CAAC,SAAS,GAAG,+BAAsE;AAE/F,SAAS,YAAY;AACrB,eAAe,YAAY","ignoreList":[]}
@@ -1,174 +0,0 @@
1
- import { template as _$template } from "solid-js/web";
2
- import { setAttribute as _$setAttribute } from "solid-js/web";
3
- import { className as _$className } from "solid-js/web";
4
- import { effect as _$effect } from "solid-js/web";
5
- import { getNextMarker as _$getNextMarker } from "solid-js/web";
6
- import { getNextElement as _$getNextElement } from "solid-js/web";
7
- import { memo as _$memo } from "solid-js/web";
8
- import { insert as _$insert } from "solid-js/web";
9
- import { createComponent as _$createComponent } from "solid-js/web";
10
- var _tmpl$ = /*#__PURE__*/_$template(`<span class=k2b-status-row__announcement>`),
11
- _tmpl$2 = /*#__PURE__*/_$template(`<div class=k2b-status-row__end>`),
12
- _tmpl$3 = /*#__PURE__*/_$template(`<div><p class=k2b-status-row__lead></p><div class=k2b-status-row__middle><!$><!/><!$><!/><!$><!/></div><!$><!/><span class=k2b-sr-only aria-live=polite aria-atomic=true>`),
13
- _tmpl$4 = /*#__PURE__*/_$template(`<i class="ti ti-check"aria-hidden=true>`),
14
- _tmpl$5 = /*#__PURE__*/_$template(`<span class=k2b-status-row__fact><b></b> <!$><!/>`),
15
- _tmpl$6 = /*#__PURE__*/_$template(`<span class=k2b-status-row__next><span class=k2b-status-row__next-label></span><time class=k2b-status-row__time>`),
16
- _tmpl$7 = /*#__PURE__*/_$template(`<span class=k2b-status-row__state><span class=k2b-status-row__sign aria-hidden=true><i></i></span><b></b><!$><!/>`);
17
- import { For, Show } from "solid-js";
18
- import { useWorkspaceMessages } from "./workspace-messages";
19
-
20
- /** A key figure of the status row: the number (bold) and what it counts. */
21
-
22
- /** A page-wide disturbance that needs nobody: the page tries again by itself (K10). */
23
-
24
- /** A selection in the list below: its count becomes the lead statement, its figures and actions take the places of the key figures and filters (K6). */
25
-
26
- const present = value => value !== undefined && value !== null && value !== false && value !== "";
27
-
28
- /** The state's hint in words, when its label and time are plain text: what is wrong and the next attempt. */
29
- const stateHint = (state, nextAttempt) => {
30
- const label = state.label;
31
- const next = state.next;
32
- if (typeof label !== "string") return undefined;
33
- if (!present(next)) return label;
34
- return typeof next === "string" ? `${label} · ${nextAttempt} ${next}` : undefined;
35
- };
36
-
37
- /**
38
- * The status row (K6, K10): the first line under a column's head, 52 px tall. The lead statement on the left keeps
39
- * its place and size in every state. Up to three key figures follow it; on the right stand the filters. A selection
40
- * shows its count and actions in the same places; a disturbance of the page shows a round sign, what is wrong, and
41
- * the next attempt in the place of the key figures. It shows only data that exists already.
42
- */
43
- export function StatusRow(props) {
44
- const messages = useWorkspaceMessages();
45
- const mode = () => props.selection ? "selection" : present(props.announcement) ? "announcement" : props.state ? "state" : "facts";
46
- return (() => {
47
- var _el$ = _$getNextElement(_tmpl$3),
48
- _el$2 = _el$.firstChild,
49
- _el$3 = _el$2.nextSibling,
50
- _el$5 = _el$3.firstChild,
51
- [_el$6, _co$] = _$getNextMarker(_el$5.nextSibling),
52
- _el$7 = _el$6.nextSibling,
53
- [_el$8, _co$2] = _$getNextMarker(_el$7.nextSibling),
54
- _el$9 = _el$8.nextSibling,
55
- [_el$0, _co$3] = _$getNextMarker(_el$9.nextSibling),
56
- _el$11 = _el$3.nextSibling,
57
- [_el$12, _co$4] = _$getNextMarker(_el$11.nextSibling),
58
- _el$10 = _el$12.nextSibling;
59
- _$insert(_el$2, _$createComponent(Show, {
60
- get when() {
61
- return props.selection;
62
- },
63
- get fallback() {
64
- return props.lead;
65
- },
66
- children: selection => [_$getNextElement(_tmpl$4), " ", _$memo(() => messages().statusSelected({
67
- count: selection().count
68
- }))]
69
- }));
70
- _$insert(_el$3, _$createComponent(Show, {
71
- get when() {
72
- return mode() === "facts" || mode() === "selection";
73
- },
74
- get children() {
75
- return _$createComponent(For, {
76
- get each() {
77
- return ((mode() === "selection" ? props.selection?.facts : props.facts) ?? []).slice(0, 3);
78
- },
79
- children: fact => (() => {
80
- var _el$14 = _$getNextElement(_tmpl$5),
81
- _el$15 = _el$14.firstChild,
82
- _el$16 = _el$15.nextSibling,
83
- _el$17 = _el$16.nextSibling,
84
- [_el$18, _co$5] = _$getNextMarker(_el$17.nextSibling);
85
- _$insert(_el$15, () => fact.value);
86
- _$insert(_el$14, () => fact.label, _el$18, _co$5);
87
- return _el$14;
88
- })()
89
- });
90
- }
91
- }), _el$6, _co$);
92
- _$insert(_el$3, _$createComponent(Show, {
93
- get when() {
94
- return _$memo(() => mode() === "state")() && props.state;
95
- },
96
- children: state => (() => {
97
- var _el$19 = _$getNextElement(_tmpl$7),
98
- _el$20 = _el$19.firstChild,
99
- _el$21 = _el$20.firstChild,
100
- _el$22 = _el$20.nextSibling,
101
- _el$26 = _el$22.nextSibling,
102
- [_el$27, _co$6] = _$getNextMarker(_el$26.nextSibling);
103
- _$insert(_el$22, () => state().label);
104
- _$insert(_el$19, _$createComponent(Show, {
105
- get when() {
106
- return present(state().next);
107
- },
108
- get children() {
109
- var _el$23 = _$getNextElement(_tmpl$6),
110
- _el$24 = _el$23.firstChild,
111
- _el$25 = _el$24.nextSibling;
112
- _$insert(_el$24, () => messages().statusNextAttempt);
113
- _$insert(_el$25, () => state().next);
114
- return _el$23;
115
- }
116
- }), _el$27, _co$6);
117
- _$effect(_p$ => {
118
- var _v$5 = stateHint(state(), messages().statusNextAttempt),
119
- _v$6 = state().icon ?? "ti ti-alert-triangle";
120
- _v$5 !== _p$.e && _$setAttribute(_el$19, "title", _p$.e = _v$5);
121
- _v$6 !== _p$.t && _$className(_el$21, _p$.t = _v$6);
122
- return _p$;
123
- }, {
124
- e: undefined,
125
- t: undefined
126
- });
127
- return _el$19;
128
- })()
129
- }), _el$8, _co$2);
130
- _$insert(_el$3, _$createComponent(Show, {
131
- get when() {
132
- return mode() === "announcement";
133
- },
134
- get children() {
135
- var _el$4 = _$getNextElement(_tmpl$);
136
- _$insert(_el$4, () => props.announcement);
137
- return _el$4;
138
- }
139
- }), _el$0, _co$3);
140
- _$insert(_el$, _$createComponent(Show, {
141
- get when() {
142
- return _$memo(() => mode() === "selection")() ? present(props.selection?.actions) : present(props.filters);
143
- },
144
- get children() {
145
- var _el$1 = _$getNextElement(_tmpl$2);
146
- _$insert(_el$1, (() => {
147
- var _c$ = _$memo(() => mode() === "selection");
148
- return () => _c$() ? props.selection?.actions : props.filters;
149
- })());
150
- return _el$1;
151
- }
152
- }), _el$12, _co$4);
153
- _$insert(_el$10, () => props.announcement);
154
- _$effect(_p$ => {
155
- var _v$ = `k2b-status-row${props.class ? ` ${props.class}` : ""}`,
156
- _v$2 = mode(),
157
- _v$3 = mode() === "state" ? props.state?.tone ?? "warning" : undefined,
158
- _v$4 = props.line ? "" : undefined;
159
- _v$ !== _p$.e && _$className(_el$, _p$.e = _v$);
160
- _v$2 !== _p$.t && _$setAttribute(_el$, "data-mode", _p$.t = _v$2);
161
- _v$3 !== _p$.a && _$setAttribute(_el$, "data-tone", _p$.a = _v$3);
162
- _v$4 !== _p$.o && _$setAttribute(_el$, "data-line", _p$.o = _v$4);
163
- return _p$;
164
- }, {
165
- e: undefined,
166
- t: undefined,
167
- a: undefined,
168
- o: undefined
169
- });
170
- return _el$;
171
- })();
172
- }
173
- export default StatusRow;
174
- //# sourceMappingURL=StatusRow.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["layout/StatusRow.tsx"],"sourcesContent":["import { For, type JSX, Show } from \"solid-js\";\nimport { useWorkspaceMessages } from \"./workspace-messages\";\n\n/** A key figure of the status row: the number (bold) and what it counts. */\nexport type StatusRowFact = { value: JSX.Element; label: JSX.Element };\n\n/** A page-wide disturbance that needs nobody: the page tries again by itself (K10). */\nexport type StatusRowState = {\n /** What is wrong, in a few words, such as \"Sync paused\". */\n label: JSX.Element;\n /** `warning` (the default) or `danger`; `neutral` for a quiet state such as \"Offline\". */\n tone?: \"neutral\" | \"warning\" | \"danger\";\n /** Tabler icon class inside the round sign, such as `ti ti-refresh`. Defaults to an alert sign. */\n icon?: string;\n /** The time of the next attempt as people read it, such as \"14:05\". Shows as \"next attempt 14:05\". */\n next?: JSX.Element;\n};\n\n/** A selection in the list below: its count becomes the lead statement, its figures and actions take the places of the key figures and filters (K6). */\nexport type StatusRowSelection = {\n /** The number of chosen items. A check and \"3 selected\" take the lead statement's place. */\n count: number;\n /** Up to three figures about the chosen items, such as their kinds or total size. */\n facts?: readonly StatusRowFact[];\n /** Actions on the chosen items, usually small buttons. */\n actions?: JSX.Element;\n};\n\nexport type StatusRowProps = {\n /** The lead statement (18 px, bold): what someone wants to know here first. It is never shortened. */\n lead: JSX.Element;\n /** Up to three key figures. Only the first three show; the rest give way in a fixed order when space is short. */\n facts?: readonly StatusRowFact[];\n /** Filters at the end of the row, usually `FilterChip` elements. */\n filters?: JSX.Element;\n /** A disturbance of the whole page; it takes the place of the key figures, the lead statement stays. */\n state?: StatusRowState;\n /** A selection; its count and actions take the place of the key figures and filters. */\n selection?: StatusRowSelection;\n /**\n * What is happening right now in words, announced politely to screen readers and shown in the place of the key\n * figures, such as \"Moving “Invoice 12” to Done\". Drag and drop fills it while an item moves (K7).\n */\n announcement?: JSX.Element;\n /** A hairline under the row, where the row stands above a list without its own column head. */\n line?: boolean;\n class?: string;\n};\n\nconst present = (value: unknown) => value !== undefined && value !== null && value !== false && value !== \"\";\n\n/** The state's hint in words, when its label and time are plain text: what is wrong and the next attempt. */\nconst stateHint = (state: StatusRowState, nextAttempt: string): string | undefined => {\n const label = state.label;\n const next = state.next;\n if (typeof label !== \"string\") return undefined;\n if (!present(next)) return label;\n return typeof next === \"string\" ? `${label} · ${nextAttempt} ${next}` : undefined;\n};\n\n/**\n * The status row (K6, K10): the first line under a column's head, 52 px tall. The lead statement on the left keeps\n * its place and size in every state. Up to three key figures follow it; on the right stand the filters. A selection\n * shows its count and actions in the same places; a disturbance of the page shows a round sign, what is wrong, and\n * the next attempt in the place of the key figures. It shows only data that exists already.\n */\nexport function StatusRow(props: StatusRowProps): JSX.Element {\n const messages = useWorkspaceMessages();\n const mode = () => (props.selection ? \"selection\" : present(props.announcement) ? \"announcement\" : props.state ? \"state\" : \"facts\");\n return (\n <div\n class={`k2b-status-row${props.class ? ` ${props.class}` : \"\"}`}\n data-mode={mode()}\n data-tone={mode() === \"state\" ? (props.state?.tone ?? \"warning\") : undefined}\n data-line={props.line ? \"\" : undefined}\n >\n <p class=\"k2b-status-row__lead\">\n <Show when={props.selection} fallback={props.lead}>\n {(selection) => (\n <>\n <i class=\"ti ti-check\" aria-hidden=\"true\" /> {messages().statusSelected({ count: selection().count })}\n </>\n )}\n </Show>\n </p>\n <div class=\"k2b-status-row__middle\">\n <Show when={mode() === \"facts\" || mode() === \"selection\"}>\n <For each={((mode() === \"selection\" ? props.selection?.facts : props.facts) ?? []).slice(0, 3)}>\n {(fact) => (\n <span class=\"k2b-status-row__fact\">\n <b>{fact.value}</b> {fact.label}\n </span>\n )}\n </For>\n </Show>\n <Show when={mode() === \"state\" && props.state}>\n {(state) => (\n <span\n class=\"k2b-status-row__state\"\n // The whole state stays readable when its label shortens (K15): the hint carries it with its time.\n title={stateHint(state(), messages().statusNextAttempt)}\n >\n <span class=\"k2b-status-row__sign\" aria-hidden=\"true\">\n <i class={state().icon ?? \"ti ti-alert-triangle\"} />\n </span>\n <b>{state().label}</b>\n <Show when={present(state().next)}>\n <span class=\"k2b-status-row__next\">\n <span class=\"k2b-status-row__next-label\">{messages().statusNextAttempt}</span>\n <time class=\"k2b-status-row__time\">{state().next}</time>\n </span>\n </Show>\n </span>\n )}\n </Show>\n <Show when={mode() === \"announcement\"}>\n <span class=\"k2b-status-row__announcement\">{props.announcement}</span>\n </Show>\n </div>\n <Show when={mode() === \"selection\" ? present(props.selection?.actions) : present(props.filters)}>\n <div class=\"k2b-status-row__end\">{mode() === \"selection\" ? props.selection?.actions : props.filters}</div>\n </Show>\n {/* The live region exists from the first frame, so the first announcement is heard. */}\n <span class=\"k2b-sr-only\" aria-live=\"polite\" aria-atomic=\"true\">\n {props.announcement}\n </span>\n </div>\n );\n}\n\nexport default StatusRow;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAS,GAAG,EAAY,IAAI,QAAQ,UAAU;AAC9C,SAAS,oBAAoB,QAAQ,sBAAsB;;AAE3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;QAAA,OAAE,iBAAI,CAAC,CAAC,KAAK,WAAW,MAAG,OAAO,CAAC,KAAK,CAAC,SAAS,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC;MAAA;MAAA;QAAA;QAAA;UAAA,uBAC3D,IAAI,CAAC,CAAC,KAAK,WAAW;UAAA,aAAtB,QAAyB,KAAK,CAAC,SAAS,EAAE,OAAO,GAAG,KAAK,CAAC,OAAO;QAAA;QAAA;MAAA;IAAA;IAAA,uBAIlG,KAAK,CAAC,YAAY;IAAA;MAAA,UArDd,iBAAiB,KAAK,CAAC,KAAK,GAAG,IAAI,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QAAA,OACnD,IAAI,CAAC,CAAC;QAAA,OACN,IAAI,CAAC,CAAC,KAAK,OAAO,GAAI,KAAK,CAAC,KAAK,EAAE,IAAI,IAAI,SAAS,GAAI,SAAS;QAAA,OACjE,KAAK,CAAC,IAAI,GAAG,EAAE,GAAG,SAAS;MAAA;MAAA;MAAA;MAAA;MAAA;IAAA;MAAA;MAAA;MAAA;MAAA;IAAA;IAAA;EAAA;AAsD5C;AAEA,eAAe,SAAS","ignoreList":[]}
@@ -1,44 +0,0 @@
1
- import { template as _$template } from "solid-js/web";
2
- import { getNextElement as _$getNextElement } from "solid-js/web";
3
- import { getNextMarker as _$getNextMarker } from "solid-js/web";
4
- import { insert as _$insert } from "solid-js/web";
5
- import { createComponent as _$createComponent } from "solid-js/web";
6
- var _tmpl$ = /*#__PURE__*/_$template(`<div class=k2b-panel-dialog__error role=alert><i class="ti ti-circle-x"aria-hidden=true></i><div class=k2b-panel-dialog__error-copy><strong></strong><!$><!/>`),
7
- _tmpl$2 = /*#__PURE__*/_$template(`<p>`);
8
- import { Show } from "solid-js";
9
- const text = error => typeof error === "string" ? {
10
- title: error
11
- } : error?.title ? error : undefined;
12
-
13
- /**
14
- * The tinted cell of a dialog error, the footer's first row (K10, K16). It loads with the first error, so dialogs
15
- * without one carry none of it; the footer holds its place while the cell comes and goes (`dialog-foot.ts`).
16
- */
17
- export function PanelDialogErrorCell(props) {
18
- return _$createComponent(Show, {
19
- get when() {
20
- return text(props.error());
21
- },
22
- children: error => (() => {
23
- var _el$ = _$getNextElement(_tmpl$),
24
- _el$2 = _el$.firstChild,
25
- _el$3 = _el$2.nextSibling,
26
- _el$4 = _el$3.firstChild,
27
- _el$5 = _el$4.nextSibling,
28
- [_el$6, _co$] = _$getNextMarker(_el$5.nextSibling);
29
- _$insert(_el$4, () => error().title);
30
- _$insert(_el$3, _$createComponent(Show, {
31
- get when() {
32
- return error().description;
33
- },
34
- children: detail => (() => {
35
- var _el$7 = _$getNextElement(_tmpl$2);
36
- _$insert(_el$7, detail);
37
- return _el$7;
38
- })()
39
- }), _el$6, _co$);
40
- return _el$;
41
- })()
42
- });
43
- }
44
- //# sourceMappingURL=panel-dialog-error.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["layout/panel-dialog-error.tsx"],"sourcesContent":["import { type JSX, Show } from \"solid-js\";\nimport type { PanelDialogError } from \"./PanelDialog\";\n\nconst text = (error: PanelDialogError | undefined) => (typeof error === \"string\" ? { title: error } : error?.title ? error : undefined);\n\n/**\n * The tinted cell of a dialog error, the footer's first row (K10, K16). It loads with the first error, so dialogs\n * without one carry none of it; the footer holds its place while the cell comes and goes (`dialog-foot.ts`).\n */\nexport function PanelDialogErrorCell(props: { error: () => PanelDialogError | undefined }): JSX.Element {\n return (\n <Show when={text(props.error())}>\n {(error) => (\n <div class=\"k2b-panel-dialog__error\" role=\"alert\">\n <i class=\"ti ti-circle-x\" aria-hidden=\"true\" />\n <div class=\"k2b-panel-dialog__error-copy\">\n <strong>{error().title}</strong>\n <Show when={error().description}>{(detail) => <p>{detail()}</p>}</Show>\n </div>\n </div>\n )}\n </Show>\n );\n}\n"],"mappings":";;;;;;;AAAA,SAAmB,IAAI,QAAQ,UAAU;AAGzC,MAAM,IAAI,GAAI,KAAmC,IAAM,OAAO,KAAK,KAAK,QAAQ,GAAG;EAAE,KAAK,EAAE;AAAM,CAAC,GAAG,KAAK,EAAE,KAAK,GAAG,KAAK,GAAG,SAAU;;AAEvI;AACA;AACA;AACA;AACA,OAAO,SAAS,oBAAoB,CAAC,KAAoD,EAAe;EACtG,yBACG,IAAI;IAAA,IAAC,IAAI;MAAA,OAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAAA;IAAA,UAC3B,KAAK;MAAA;QAAA;QAAA;QAAA;QAAA;QAAA;MAAA,sBAIQ,KAAK,CAAC,CAAC,CAAC,KAAK;MAAA,kCACrB,IAAI;QAAA,IAAC,IAAI;UAAA,OAAE,KAAK,CAAC,CAAC,CAAC,WAAW;QAAA;QAAA,UAAI,MAAM;UAAA;UAAA,gBAAS,MAAM;UAAA;QAAA;MAAO;MAAA;IAAA;EAGpE;AAGP","ignoreList":[]}
@@ -1,86 +0,0 @@
1
- import { template as _$template } from "solid-js/web";
2
- import { delegateEvents as _$delegateEvents } from "solid-js/web";
3
- import { setAttribute as _$setAttribute } from "solid-js/web";
4
- import { effect as _$effect } from "solid-js/web";
5
- import { getNextElement as _$getNextElement } from "solid-js/web";
6
- import { runHydrationEvents as _$runHydrationEvents } from "solid-js/web";
7
- import { use as _$use } from "solid-js/web";
8
- var _tmpl$ = /*#__PURE__*/_$template(`<button type=button class=k2b-bottom-sheet__handle><span aria-hidden=true>`);
9
- import { onCleanup, onMount } from "solid-js";
10
- import { suppressTextSelection } from "../internal/text-selection";
11
- import { useUiMessages } from "../intl/messages";
12
- import { attachSheetMotion } from "./sheet-motion";
13
-
14
- /**
15
- * Asks the dialog to close as Escape does, through its cancel event: its cancel behavior and guard decide. The promise
16
- * settles a frame later only if the sheet is still shown, so a guard that keeps it brings it back; a closed sheet
17
- * fades where it is.
18
- */
19
- const requestClose = (frame, panel) => new Promise(resolve => {
20
- frame.dispatchEvent(new Event("cancel", {
21
- cancelable: true
22
- }));
23
- requestAnimationFrame(() => {
24
- if (frame.open && panel.isConnected && panel.offsetParent !== null) resolve();
25
- });
26
- });
27
-
28
- /**
29
- * The grip of a `PanelDialog` that opened as a sheet below 48rem (K13, K16): the finger pulls the sheet down to close
30
- * it, a tap closes it, and it moves like a `BottomSheet`. `PanelDialog` renders it only when it opens on a phone.
31
- */
32
- export function PanelSheetHandle(props) {
33
- const messages = useUiMessages();
34
- let handle;
35
- let motion;
36
- let releaseTextSelection;
37
- onMount(() => {
38
- const panel = handle.parentElement;
39
- if (!panel) return;
40
- const own = attachSheetMotion({
41
- frame: props.frame,
42
- panel,
43
- handle,
44
- detents: false,
45
- canDismiss: () => true,
46
- dismiss: () => requestClose(props.frame, panel)
47
- });
48
- motion = own;
49
- queueMicrotask(() => own.open());
50
- // Turned to 48rem and wider, the dialog is centered again: the sheet's motion lets go of the frame.
51
- const wide = window.matchMedia("(min-width: 48rem)");
52
- const release = () => {
53
- if (!wide.matches) return;
54
- motion?.dispose();
55
- motion = undefined;
56
- };
57
- wide.addEventListener("change", release);
58
- onCleanup(() => wide.removeEventListener("change", release));
59
- });
60
- onCleanup(() => {
61
- releaseTextSelection?.();
62
- motion?.dispose();
63
- });
64
- const release = () => {
65
- releaseTextSelection?.();
66
- releaseTextSelection = undefined;
67
- };
68
- return (() => {
69
- var _el$ = _$getNextElement(_tmpl$);
70
- _el$.$$click = () => motion?.press();
71
- _el$.addEventListener("pointercancel", release);
72
- _el$.$$pointerup = release;
73
- _el$.$$pointerdown = event => {
74
- if (!event.isPrimary || event.button !== 0) return;
75
- release();
76
- releaseTextSelection = suppressTextSelection(event.pointerId);
77
- };
78
- var _ref$ = handle;
79
- typeof _ref$ === "function" ? _$use(_ref$, _el$) : handle = _el$;
80
- _$effect(() => _$setAttribute(_el$, "aria-label", messages().close));
81
- _$runHydrationEvents();
82
- return _el$;
83
- })();
84
- }
85
- _$delegateEvents(["pointerdown", "pointerup", "click"]);
86
- //# sourceMappingURL=panel-sheet-handle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["layout/panel-sheet-handle.tsx"],"sourcesContent":["import { type JSX, onCleanup, onMount } from \"solid-js\";\nimport { suppressTextSelection } from \"../internal/text-selection\";\nimport { useUiMessages } from \"../intl/messages\";\nimport { attachSheetMotion, type SheetMotion } from \"./sheet-motion\";\n\n/**\n * Asks the dialog to close as Escape does, through its cancel event: its cancel behavior and guard decide. The promise\n * settles a frame later only if the sheet is still shown, so a guard that keeps it brings it back; a closed sheet\n * fades where it is.\n */\nconst requestClose = (frame: HTMLDialogElement, panel: HTMLElement) =>\n new Promise<void>((resolve) => {\n frame.dispatchEvent(new Event(\"cancel\", { cancelable: true }));\n requestAnimationFrame(() => {\n if (frame.open && panel.isConnected && panel.offsetParent !== null) resolve();\n });\n });\n\n/**\n * The grip of a `PanelDialog` that opened as a sheet below 48rem (K13, K16): the finger pulls the sheet down to close\n * it, a tap closes it, and it moves like a `BottomSheet`. `PanelDialog` renders it only when it opens on a phone.\n */\nexport function PanelSheetHandle(props: { frame: HTMLDialogElement }): JSX.Element {\n const messages = useUiMessages();\n let handle!: HTMLButtonElement;\n let motion: SheetMotion | undefined;\n let releaseTextSelection: (() => void) | undefined;\n onMount(() => {\n const panel = handle.parentElement;\n if (!panel) return;\n const own = attachSheetMotion({\n frame: props.frame,\n panel,\n handle,\n detents: false,\n canDismiss: () => true,\n dismiss: () => requestClose(props.frame, panel),\n });\n motion = own;\n queueMicrotask(() => own.open());\n // Turned to 48rem and wider, the dialog is centered again: the sheet's motion lets go of the frame.\n const wide = window.matchMedia(\"(min-width: 48rem)\");\n const release = () => {\n if (!wide.matches) return;\n motion?.dispose();\n motion = undefined;\n };\n wide.addEventListener(\"change\", release);\n onCleanup(() => wide.removeEventListener(\"change\", release));\n });\n onCleanup(() => {\n releaseTextSelection?.();\n motion?.dispose();\n });\n const release = () => {\n releaseTextSelection?.();\n releaseTextSelection = undefined;\n };\n return (\n <button\n ref={handle}\n type=\"button\"\n class=\"k2b-bottom-sheet__handle\"\n aria-label={messages().close}\n onPointerDown={(event) => {\n if (!event.isPrimary || event.button !== 0) return;\n release();\n releaseTextSelection = suppressTextSelection(event.pointerId);\n }}\n onPointerUp={release}\n onPointerCancel={release}\n onClick={() => motion?.press()}\n >\n <span aria-hidden=\"true\" />\n </button>\n );\n}\n"],"mappings":";;;;;;;;AAAA,SAAmB,SAAS,EAAE,OAAO,QAAQ,UAAU;AACvD,SAAS,qBAAqB,QAAQ,4BAA4B;AAClE,SAAS,aAAa,QAAQ,kBAAkB;AAChD,SAAS,iBAAiB,QAA0B,gBAAgB;;AAEpE;AACA;AACA;AACA;AACA;AACA,MAAM,YAAY,GAAG,CAAC,KAAwB,EAAE,KAAkB,KAChE,IAAI,OAAO,CAAQ,OAAO,IAAK;EAC7B,KAAK,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,QAAQ,EAAE;IAAE,UAAU,EAAE;EAAK,CAAC,CAAC,CAAC;EAC9D,qBAAqB,CAAC,MAAM;IAC1B,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,YAAY,KAAK,IAAI,EAAE,OAAO,CAAC,CAAC;EAC/E,CAAC,CAAC;AACJ,CAAC,CAAC;;AAEJ;AACA;AACA;AACA;AACA,OAAO,SAAS,gBAAgB,CAAC,KAAmC,EAAe;EACjF,MAAM,QAAQ,GAAG,aAAa,CAAC,CAAC;EAChC,IAAI,MAA0B;EAC9B,IAAI,MAA+B;EACnC,IAAI,oBAA8C;EAClD,OAAO,CAAC,MAAM;IACZ,MAAM,KAAK,GAAG,MAAM,CAAC,aAAa;IAClC,IAAI,CAAC,KAAK,EAAE;IACZ,MAAM,GAAG,GAAG,iBAAiB,CAAC;MAC5B,KAAK,EAAE,KAAK,CAAC,KAAK;MAClB,KAAK;MACL,MAAM;MACN,OAAO,EAAE,KAAK;MACd,UAAU,EAAE,MAAM,IAAI;MACtB,OAAO,EAAE,MAAM,YAAY,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK;IAChD,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