@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
@@ -0,0 +1,173 @@
1
+ import { type JSX } from "solid-js";
2
+ import type { Action, OnNavigate, Person, Status, TwoActions } from "./types";
3
+ export type NavItem = {
4
+ label: string;
5
+ icon: string;
6
+ href?: string;
7
+ /** With `href`: opens the page in place on a plain click (see `OnNavigate`). */
8
+ onNavigate?: OnNavigate;
9
+ onClick?: () => void;
10
+ count?: number | string;
11
+ /** The open one. */
12
+ current?: boolean;
13
+ /** One level in, such as the folders of a mailbox. */
14
+ nested?: boolean;
15
+ /** Something new here. */
16
+ dot?: Status;
17
+ };
18
+ export type NavGroup = {
19
+ label?: string;
20
+ action?: Action;
21
+ items: readonly NavItem[];
22
+ };
23
+ export type NavProps = {
24
+ /** The app's name and symbol at the top. */
25
+ title: string;
26
+ icon: string;
27
+ groups: readonly NavGroup[];
28
+ /** Entries at the foot, such as "Hidden (2)". */
29
+ foot?: readonly NavItem[];
30
+ };
31
+ /** The sidebar of an app: its name, groups of round entries with counts, entries at the foot. */
32
+ export declare const Nav: (props: NavProps) => JSX.Element;
33
+ export type Tab = {
34
+ label: string;
35
+ icon?: string;
36
+ count?: number | string;
37
+ /** The tab leads to this page … */
38
+ href?: string;
39
+ /** … opens it in place on a plain click, while the link still opens in a new tab (see `OnNavigate`) … */
40
+ onNavigate?: OnNavigate;
41
+ /** … or switches the view in place. */
42
+ onClick?: () => void;
43
+ current?: boolean;
44
+ menu?: boolean;
45
+ };
46
+ export type TabsProps = {
47
+ items: readonly Tab[];
48
+ label: string;
49
+ };
50
+ /**
51
+ * The views of a head or of an object. In the start of a head bar they share it with the actions and give way to
52
+ * them; as the head of a pane they are a bar of their own, 44 px. The open tab stands on the line of its bar. (The
53
+ * keyboard comes with the behaviour layer.)
54
+ */
55
+ export declare const Tabs: (props: TabsProps) => JSX.Element;
56
+ /**
57
+ * Where a page stands, in the start of its head instead of tabs: the places before it quiet, the page itself in 600.
58
+ * On the phone the head with a path gives way to the phone bar of the shell, which names the page.
59
+ */
60
+ export type PathProps = {
61
+ items: readonly {
62
+ label: string;
63
+ href?: string;
64
+ }[];
65
+ label: string;
66
+ };
67
+ export declare const Path: (props: PathProps) => JSX.Element;
68
+ /** A key figure: words before and after, the value itself in 600 (leave it out for words alone, such as "12 offen"). */
69
+ export type StatusFact = {
70
+ before?: string;
71
+ value?: string | number;
72
+ after?: string;
73
+ };
74
+ export type StatusRowProps = {
75
+ /** The one main statement, such as "7 unread". */
76
+ lead: string;
77
+ /** Key figures after it; they leave on the phone. */
78
+ facts?: readonly StatusFact[];
79
+ /** A box at the start that selects all entries. */
80
+ select?: {
81
+ label: string;
82
+ checked?: boolean | "mixed";
83
+ onChange?: (checked: boolean) => void;
84
+ };
85
+ /** Filters or a segment at the end; they leave on the phone. */
86
+ filters?: JSX.Element;
87
+ /**
88
+ * While entries are selected the row becomes the bar of what can be done with them (rule 6): the count, the
89
+ * actions, and the way out.
90
+ */
91
+ selection?: {
92
+ count: string;
93
+ actions: readonly Action[];
94
+ clear: Action;
95
+ };
96
+ };
97
+ /** The status row of a pane (52 px): the one lead statement, key figures, filters on the right. */
98
+ export declare const StatusRow: (props: StatusRowProps) => JSX.Element;
99
+ export type NoticeProps = {
100
+ /** What it is: a note of a person, a summary by AI, something wrong, something waiting. */
101
+ tone: "note" | "ai" | "bad" | "warn";
102
+ /** A symbol other than the one of the tone, such as a pin for a pinned note. */
103
+ icon?: string;
104
+ /** A short title; the text then runs under it across the full width. */
105
+ title?: string;
106
+ /** Quiet words after the title: who and when. */
107
+ meta?: string;
108
+ /** Text buttons at the end; at most two. */
109
+ actions?: TwoActions;
110
+ children: JSX.Element;
111
+ };
112
+ /** A band with a sign, a sentence and its consequence, and at most two deeds. The tint is its edge. */
113
+ export declare const Notice: (props: NoticeProps) => JSX.Element;
114
+ export type DigestEntry = {
115
+ icon: string;
116
+ color?: string;
117
+ /** A short date, such as "17. Nov.". */
118
+ date: string;
119
+ /** The number or name of the thing. */
120
+ title: string;
121
+ /** Its state: a symbol and a word. */
122
+ state: {
123
+ icon: string;
124
+ label: string;
125
+ tone?: Status;
126
+ };
127
+ /** One sentence about it; `<Text weight="strong">` stresses a word. */
128
+ text: JSX.Element;
129
+ href?: string;
130
+ };
131
+ export type DigestProps = {
132
+ items: readonly DigestEntry[];
133
+ children?: never;
134
+ label?: string;
135
+ } | {
136
+ items?: never;
137
+ children: JSX.Element;
138
+ label?: string;
139
+ };
140
+ /**
141
+ * The newest few on a first page, without lines (decided 22.11.): dated entries in a grid of date, number with state
142
+ * and sentence, or plain rows whose second line is a sentence.
143
+ */
144
+ export declare const Digest: (props: DigestProps) => JSX.Element;
145
+ export type Step = {
146
+ label: string;
147
+ /** A quiet line under the step, such as a date or "10 von 18". */
148
+ meta?: string;
149
+ /** Done (grey with a tick), the one running now (a blue ring), or still to come (empty). */
150
+ state: "done" | "now" | "next";
151
+ };
152
+ /** A way of a few steps: done ones grey with a tick, the running one a blue ring, the coming ones empty. */
153
+ export type StepsProps = {
154
+ items: readonly Step[];
155
+ label: string;
156
+ };
157
+ export declare const Steps: (props: StepsProps) => JSX.Element;
158
+ export type RecordId = {
159
+ label?: string;
160
+ value: string;
161
+ icon?: string;
162
+ copy?: boolean;
163
+ };
164
+ export type RecordHeadProps = {
165
+ name: string;
166
+ avatar?: Person;
167
+ /** Kinds of the record, such as "Private". */
168
+ kinds?: readonly string[];
169
+ /** Identifiers and contact at a glance; they leave on the phone. */
170
+ ids?: readonly RecordId[];
171
+ };
172
+ /** The identity of a record in its head: avatar, name, kinds, identifiers. Put it in the start of the head `Bar`. */
173
+ export declare const RecordHead: (props: RecordHeadProps) => JSX.Element;
@@ -0,0 +1,233 @@
1
+ import { type JSX } from "solid-js";
2
+ import { type EmptyProps } from "./states";
3
+ import type { TypeRole } from "./tokens";
4
+ import type { Action, OnNavigate, Person, Status } from "./types";
5
+ export type TextProps = {
6
+ /**
7
+ * One of the four type roles. Without one, text takes the role of its place (13/20 in a pane, the role of the
8
+ * sentence it stands in). (Named `type`, not `role`, so it never reads as an ARIA role.)
9
+ */
10
+ type?: TypeRole;
11
+ /**
12
+ * Emphasis is a weight, never a size: `strong` (600) stresses a word, `medium` (500) lets a state or an amount stand
13
+ * out a little, such as "Quittung offen".
14
+ */
15
+ weight?: "medium" | "strong";
16
+ /** The muted ink, for a second voice beside the main text. */
17
+ muted?: boolean;
18
+ /** A colour of meaning, never decoration. */
19
+ tone?: Status | "ai" | "draft";
20
+ /** The words lead to this page: they keep the ink of the text and are underlined (blue is only the main action). */
21
+ href?: string;
22
+ children: JSX.Element;
23
+ };
24
+ /**
25
+ * Text in one of the four type roles. Standing in the flow of a column (a pane, a band, a section, a group) it is a
26
+ * block that carries the text edge itself; anywhere else (a bar, a row, a sentence) it runs inline, and in a bar it is
27
+ * cut to one line with "…". The stylesheet decides by place, so text passed as data behaves the same.
28
+ */
29
+ export declare const Text: (props: TextProps) => JSX.Element;
30
+ export type ProseProps = {
31
+ /**
32
+ * Text in Markdown, such as a message. Raw HTML in it shows as text; links lead only to web pages and mail
33
+ * addresses; images show their words, they load nothing.
34
+ */
35
+ markdown: string;
36
+ children?: never;
37
+ } | {
38
+ markdown?: never;
39
+ children: JSX.Element;
40
+ };
41
+ /** Reading text: 14/22, a measure of 720 px, headings at 16 and 18. It carries the text edge itself. */
42
+ export declare const Prose: (props: ProseProps) => JSX.Element;
43
+ export type InlineProps = {
44
+ children: JSX.Element;
45
+ };
46
+ /**
47
+ * One line of things with the one fixed gap of 8 px. In a column it carries the text edge itself. In a column narrower
48
+ * than 480 px it wraps onto more lines instead of cutting a thing; in a bar it flows together with the bar's end.
49
+ */
50
+ export declare const Inline: (props: InlineProps) => JSX.Element;
51
+ export type Fact = {
52
+ label: string;
53
+ value: JSX.Element;
54
+ /** A quiet word under the value, such as "Standard". */
55
+ hint?: string;
56
+ /** Offers a copy button at the value; the text that is copied. */
57
+ copy?: string;
58
+ };
59
+ export type FactsProps = {
60
+ items: readonly Fact[];
61
+ /** All facts on one line, labels quiet before their values. */
62
+ inline?: boolean;
63
+ /** At the end of the inline line, such as "Print". */
64
+ end?: JSX.Element;
65
+ };
66
+ /** Values with their labels: label 12 quiet, value 13, 32 px a row, copy at the value. */
67
+ export declare const Facts: (props: FactsProps) => JSX.Element;
68
+ export type ListProps = {
69
+ children: JSX.Element;
70
+ label?: string;
71
+ };
72
+ /** Rows one under the other. (Selection, keyboard and drag come with the behaviour layer.) */
73
+ export declare const List: (props: ListProps) => JSX.Element;
74
+ export type RowLines = readonly [JSX.Element] | readonly [JSX.Element, JSX.Element] | readonly [JSX.Element, JSX.Element, JSX.Element];
75
+ export type RowProps = {
76
+ /**
77
+ * One to three lines; the role follows the position: one line 40 px, two lines 52 px (the second quiet, 12 px),
78
+ * three lines 72 px (the second a row, the third quiet). A row of three lines cuts each line with "…".
79
+ */
80
+ lines: RowLines;
81
+ /** A quiet note after the title, such as a count or an address. */
82
+ meta?: JSX.Element;
83
+ /** The lead: a symbol in the colour of its area … */
84
+ icon?: string;
85
+ /** … the data colour of that symbol … */
86
+ color?: string;
87
+ /** … or a person. */
88
+ avatar?: Person;
89
+ /** Unread: a dot leads and the first two lines turn 600. */
90
+ unread?: boolean;
91
+ /** The title in 600. */
92
+ strong?: boolean;
93
+ /** The open one, in the tint of the app. */
94
+ selected?: boolean;
95
+ /** "You are next", in the blue tint. */
96
+ yours?: boolean;
97
+ /** Top right, quiet: a time or a date. */
98
+ time?: JSX.Element;
99
+ /** Bottom right on the third line: chips, icons, people. */
100
+ marks?: JSX.Element;
101
+ /** The one deed of this entry, a framed button at the end; on the phone it moves under the text. */
102
+ action?: Action;
103
+ /** At the end: a few icon buttons, such as "Reply" and "More". */
104
+ end?: JSX.Element;
105
+ /** The row opens this link … */
106
+ href?: string;
107
+ /** … in place on a plain click, while the link still opens in a new tab (see `OnNavigate`) … */
108
+ onNavigate?: OnNavigate;
109
+ /** … or calls this. */
110
+ onOpen?: () => void;
111
+ };
112
+ /**
113
+ * What opens an entry: the title becomes a link or a button, stretched over the whole entry. It is never the entry
114
+ * itself, so buttons and links inside the entry stay buttons and links of their own (no control inside a control).
115
+ */
116
+ export declare const RowOpen: (props: {
117
+ href?: string;
118
+ onNavigate?: OnNavigate;
119
+ onOpen?: () => void;
120
+ children: JSX.Element;
121
+ }) => JSX.Element;
122
+ /** One entry: from column edge to column edge, square, also when it opens something. */
123
+ export declare const Row: (props: RowProps) => JSX.Element;
124
+ /** Two lines of a cell: the line itself and a quiet second line under it. */
125
+ export type CellLines = {
126
+ lines: readonly [JSX.Element, JSX.Element];
127
+ };
128
+ /** What a cell shows: one line, or two lines named as such (`{ lines: [first, second] }`). */
129
+ export type CellValue = JSX.Element | CellLines;
130
+ export type Column<T> = {
131
+ title: string;
132
+ cell: (row: T) => CellValue;
133
+ /** Numbers and amounts stand at the end. */
134
+ align?: "start" | "end";
135
+ /**
136
+ * A column that can be dragged wider or narrower: its minimum and default in px. The column is exactly its
137
+ * default wide; cut text never widens it.
138
+ */
139
+ width?: {
140
+ min: number;
141
+ default: number;
142
+ };
143
+ /** A text column that may wrap to at most three lines; the row grows, every other cell stays on its first line. */
144
+ wrap?: boolean;
145
+ /** Drops away on the phone (rule 7: columns drop, they do not shrink). */
146
+ drop?: boolean;
147
+ };
148
+ /** Where an entry leads: a page (a real link, also before the page is live) or a deed in place. */
149
+ export type OpenTarget = {
150
+ href: string;
151
+ onNavigate?: OnNavigate;
152
+ onOpen?: () => void;
153
+ } | {
154
+ href?: undefined;
155
+ onNavigate?: undefined;
156
+ onOpen: () => void;
157
+ };
158
+ type TableBase<T> = {
159
+ columns: readonly Column<T>[];
160
+ rows: readonly T[];
161
+ /** A name for the table, for assistive technology. */
162
+ label?: string;
163
+ /** The first column (and the box column) stays while the table scrolls sideways; an edge shows behind it. */
164
+ sticky?: boolean;
165
+ /** The column the rows are sorted by: an arrow in its head. */
166
+ sort?: {
167
+ column: number;
168
+ direction: "ascending" | "descending";
169
+ };
170
+ /** What a row opens, on the desktop and on the phone: its first cell is the link or button. */
171
+ open?: (row: T) => OpenTarget;
172
+ /** On the phone each row becomes a row of two lines instead (rule 7). */
173
+ phone?: (row: T) => {
174
+ lines: readonly [JSX.Element, JSX.Element];
175
+ avatar?: Person;
176
+ time?: JSX.Element;
177
+ };
178
+ /**
179
+ * While the rows load: the head stays and square placeholders hold the place of the rows, so nothing moves when they
180
+ * come; `rows` (3 when not set) and `lines` (1 or 2) say how many and how high.
181
+ */
182
+ loading?: boolean | {
183
+ rows?: number;
184
+ lines?: 1 | 2;
185
+ };
186
+ /** No rows and nothing loading: the empty state stands in place of the table, such as "Keine Aufträge mit diesem Filter." */
187
+ empty?: EmptyProps;
188
+ };
189
+ /** A table whose rows are told apart: selection, the open row and groups need the stable key of a row. */
190
+ type KeyedTable<T> = {
191
+ /** The stable key of a row. */
192
+ rowKey: (row: T) => string;
193
+ /**
194
+ * A large table (Grids): a box column to select rows. The status row shows what can be done with them
195
+ * (`StatusRow selection`).
196
+ */
197
+ select?: {
198
+ selected: readonly string[];
199
+ onChange: (keys: readonly string[]) => void;
200
+ /** The name of the box of all rows and of one row, such as "Alle Aufträge" and the row's title. */
201
+ all: string;
202
+ row: (row: T) => string;
203
+ };
204
+ /** The key of the open row, in the tint of the app. */
205
+ current?: string;
206
+ /** Rows of a group follow one another under a tinted group row of 36 px (no frame: it would cut the columns). */
207
+ group?: (row: T) => TableGroup;
208
+ };
209
+ type PlainTable = {
210
+ rowKey?: undefined;
211
+ select?: undefined;
212
+ current?: undefined;
213
+ group?: undefined;
214
+ };
215
+ export type TableProps<T> = TableBase<T> & (KeyedTable<T> | PlainTable);
216
+ /**
217
+ * A group of rows: its key, its head (such as a state chip), quiet figures after it, and the count for the phone.
218
+ * The head is made where it stands (the table and the phone list each make their own), so it is a function.
219
+ */
220
+ export type TableGroup = {
221
+ key: string;
222
+ head: () => JSX.Element;
223
+ meta?: string;
224
+ count?: string;
225
+ };
226
+ /**
227
+ * Many like things in columns: head 36, a line under every row, none between columns. Long text stays on one line
228
+ * with "…" and a fixed row height (variant a, decided 22.11.); `wrap` lets one text column take three lines. With
229
+ * `select` or `sticky` it is the large table of Grids: one scroller for head and rows, a sticky head and first column,
230
+ * rows and cells under the pointer, groups as tinted rows.
231
+ */
232
+ export declare const Table: <T>(props: TableProps<T>) => JSX.Element;
233
+ export {};
@@ -0,0 +1,118 @@
1
+ import { type JSX } from "solid-js";
2
+ export type FieldProps = {
3
+ label: string;
4
+ /** The name the value is sent under; the control inside takes it. */
5
+ name?: string;
6
+ /** A quiet hint under the control. */
7
+ hint?: string;
8
+ /** The error at the field; it replaces the hint and marks the control. */
9
+ error?: string;
10
+ /** "Optional" or a unit, quiet at the end of the label line. */
11
+ optional?: string;
12
+ /**
13
+ * The form is not sent without a value here: the control says so to the browser and to assistive technology. The
14
+ * label line shows nothing for it; the fields that may stay empty say "optional" instead (as the mockup does).
15
+ */
16
+ required?: boolean;
17
+ children: JSX.Element;
18
+ };
19
+ export declare function Field(props: FieldProps): JSX.Element;
20
+ export declare namespace Field {
21
+ var Row: (props: {
22
+ children: JSX.Element;
23
+ }) => JSX.Element;
24
+ }
25
+ export type InputProps = {
26
+ value?: string;
27
+ placeholder?: string;
28
+ type?: "text" | "email" | "number" | "search" | "tel" | "url" | "password";
29
+ /** A Tabler icon before the text, such as `search`. */
30
+ icon?: string;
31
+ /** A text of several lines (80 px). */
32
+ multiline?: boolean;
33
+ min?: number;
34
+ max?: number;
35
+ name?: string;
36
+ /** A name when the input stands without a Field, such as a search in a head. */
37
+ label?: string;
38
+ onInput?: (value: string) => void;
39
+ /**
40
+ * A key in the field, such as Enter to search or Escape to clear; the handler may call `preventDefault`. While
41
+ * `event.isComposing` is true the key belongs to an input method (Japanese, Chinese, …): Enter then confirms the
42
+ * characters and must not search.
43
+ */
44
+ onKeyDown?: (event: KeyboardEvent) => void;
45
+ /**
46
+ * The text field itself, to focus it (`input.focus()`) or select its text: `let input; <Input ref={input} />` or a
47
+ * function that takes it.
48
+ */
49
+ ref?: HTMLInputElement | HTMLTextAreaElement | ((element: HTMLInputElement | HTMLTextAreaElement) => void);
50
+ /** At the end inside the field: a symbol, or a ghost icon button such as the filter of a search. */
51
+ end?: JSX.Element;
52
+ };
53
+ /** A round text field: 36 px, 1 px edge, a blue ring on focus. In a field it takes its name and error. */
54
+ export declare const Input: (props: InputProps) => JSX.Element;
55
+ export type SelectProps = {
56
+ options: readonly (string | {
57
+ value: string;
58
+ label: string;
59
+ })[];
60
+ /** The chosen value. With `onChange` the caller holds it; without, the selection keeps the choice itself. */
61
+ value?: string;
62
+ onChange?: (value: string) => void;
63
+ placeholder?: string;
64
+ name?: string;
65
+ label?: string;
66
+ };
67
+ /**
68
+ * The closed shape of a selection: the value and a chevron in the round field. (The list opens with the behaviour
69
+ * layer; until then it is a native select laid over the shape, so it works with the keyboard and in forms.) The
70
+ * shape always shows the value that is chosen now.
71
+ */
72
+ export declare const Select: (props: SelectProps) => JSX.Element;
73
+ export type DateInputProps = {
74
+ value?: string;
75
+ onInput?: (value: string) => void;
76
+ placeholder?: string;
77
+ name?: string;
78
+ label?: string;
79
+ };
80
+ /** The shape of a date field: the date and a calendar symbol. (The picker opens with the behaviour layer.) */
81
+ export declare const DateInput: (props: DateInputProps) => JSX.Element;
82
+ export type CheckProps = {
83
+ label: JSX.Element;
84
+ name?: string;
85
+ /** Set, not set, or mixed (some of a group). */
86
+ checked?: boolean | "mixed";
87
+ /** A switch instead of a box: on and off take effect at once. */
88
+ switch?: boolean;
89
+ disabled?: boolean;
90
+ onChange?: (checked: boolean) => void;
91
+ };
92
+ /**
93
+ * A box, or a switch, with its label. The mark takes exactly one 20 px text line and never aligns by baseline, so it
94
+ * sits on the same pixel empty, set and mixed (guard: mark-geometry).
95
+ */
96
+ export declare const Check: (props: CheckProps) => JSX.Element;
97
+ /** A box without visible words, named for assistive technology (internal: "select all", "select this row"). */
98
+ export declare const MarkCheck: (props: {
99
+ label: string;
100
+ checked?: boolean | "mixed";
101
+ onChange?: (checked: boolean) => void;
102
+ }) => JSX.Element;
103
+ export type ChoiceProps = {
104
+ name: string;
105
+ options: readonly (string | {
106
+ value: string;
107
+ label: string;
108
+ })[];
109
+ value?: string;
110
+ /** The question of the choice when it stands without a Field: shown as the label line of a field of its own. */
111
+ label?: string;
112
+ onChange?: (value: string) => void;
113
+ };
114
+ /**
115
+ * A few visible options, one of which is chosen: round points, each on one 20 px text line. With a `label` and no
116
+ * Field around it, it stands in a field of its own, so its question is visible and names the group.
117
+ */
118
+ export declare const Choice: (props: ChoiceProps) => JSX.Element;
@@ -0,0 +1,18 @@
1
+ export type DescribeV2Options = {
2
+ /**
3
+ * The page is laid out (a real browser): parts without a box are reported as hidden at this width instead of being
4
+ * described, and a table names the columns it dropped. Leave it off for markup without layout, such as a DOM built
5
+ * from server-rendered HTML.
6
+ */
7
+ layout?: boolean;
8
+ };
9
+ /**
10
+ * A short text outline of a v2 screen, read from the `data-k2-part` marks of the primitives: which parts stand where,
11
+ * what they say, how many rows a list or table has, and the problems a person would see (an element no primitive
12
+ * owns, loose text, a group in a group, two primary buttons). It costs a few hundred tokens and needs no picture, so
13
+ * an agent reads it after every change and asks for a screenshot only when the outline leaves a doubt.
14
+ *
15
+ * The function is self-contained (no imports, no outer names), so a test can also run it inside a browser page:
16
+ * `await page.evaluate(\`(${describeV2})(document.body, { layout: true })\`)`.
17
+ */
18
+ export declare function describeV2(root: Element, options?: DescribeV2Options): string;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * `@k2b/ui/v2`: the second generation of `@k2b/ui`, built beside v1.
3
+ *
4
+ * **Provisional until the maintainer approves v2.** Names, props and styles may change in any release until then;
5
+ * no application ships a v2 screen before its screen is approved against the mockup.
6
+ *
7
+ * - Styles: `@k2b/ui/v2.css`, everything below the root class `k2-ui`, in the `k2-` namespace beside v1's `k2b-`.
8
+ * - Primitives own spacing, lines and type. They take no `class`, `style`, `size` or `gap`; free drawing belongs in
9
+ * `Canvas` only. The repository checks `v2-primitive-props`, `v2-app-layout-css` and `v2-no-ui-sdk-outside-ui`
10
+ * enforce this.
11
+ */
12
+ export { Button, type ButtonProps } from "./button";
13
+ export { Digest, type DigestEntry, type DigestProps, Nav, type NavGroup, type NavItem, type NavProps, Notice, type NoticeProps, Path, type PathProps, RecordHead, type RecordHeadProps, type RecordId, type StatusFact, StatusRow, type StatusRowProps, type Step, Steps, type StepsProps, type Tab, Tabs, type TabsProps, } from "./components";
14
+ export { type CellValue, type Column, type Fact, Facts, type FactsProps, Inline, type InlineProps, List, type ListProps, type OpenTarget, Prose, type ProseProps, Row, type RowLines, type RowProps, Table, type TableGroup, type TableProps, Text, type TextProps, } from "./content";
15
+ export { Check, type CheckProps, Choice, type ChoiceProps, DateInput, type DateInputProps, Field, type FieldProps, Input, type InputProps, Select, type SelectProps, } from "./controls";
16
+ export { type DescribeV2Options, describeV2 } from "./describe";
17
+ export { Band, type BandProps, Bar, type BarProps, Canvas, type CanvasProps, type CellProps, Cells, Pane, type PaneProps, type Tile, Tiles, type TilesProps, Workspace, type WorkspaceProps, } from "./layout";
18
+ export { Avatar, type AvatarProps, Chip, type ChipProps, Icon, type IconProps, Progress, type ProgressProps } from "./marks";
19
+ export { Empty, type EmptyProps, Failed, type FailedProps, Loading, type LoadingProps } from "./states";
20
+ export { Group, type GroupProps, Section, type SectionProps } from "./structure";
21
+ export { fontWeights, gripTolerance, hairline, heights, radii, type TypeRole, textEdge, typeRoles } from "./tokens";
22
+ export type { Action, OnNavigate, Person, Status, TwoActions, Width } from "./types";